5 # runs udevstart in a temporary directory with our test sysfs-tree
6 # and counts the created nodes to compare it with the expected numbers.
8 # Kay Sievers <kay.sievers@vrfy.org>, 2005
16 my $udev_bin = "../udev";
17 my $udev_root = "udev-root/"; # !!! directory will be removed !!!
18 my $udev_db = ".udevdb";
19 my $main_conf = "udev-test.conf";
20 my $conf_tmp = "udev-test.rules";
23 $ENV{UDEV_TEST} = "yes";
24 $ENV{SYSFS_PATH} = $sysfs;
25 $ENV{UDEV_CONFIG_FILE} = $main_conf;
26 $ENV{UDEV_NO_DEVD} = "yes";
27 $ENV{UDEV_NO_HOTPLUGD} = "yes";
29 # due to mknod restrictions
31 print "Must have root permissions to run properly.\n";
36 system("rm -rf $udev_root");
37 mkdir($udev_root) || die "unable to create udev_root: $udev_root\n";
39 # create initial config file
40 open CONF, ">$main_conf" || die "unable to create config file: $main_conf";
41 print CONF "udev_root=\"$udev_root\"\n";
42 print CONF "udev_db=\"$udev_db\"\n";
43 print CONF "udev_rules=\"$conf_tmp\"\n";
46 system("$udev_bin udevstart");
47 my $block = int( `find $udev_root -type b -print | wc -l`);
48 my $char = int( `find $udev_root -type c -print | wc -l`);
50 print "block devices: $block/10\n";
51 print "char devices: $char/91\n";
54 system("rm -rf $udev_db");
55 system("rm -rf $udev_root");