X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=test%2Fudev-test.pl;h=63715ac093d77f742c4a01593ccd7195ecf87a6f;hp=94cffeab07d9a2bb9dd77887812dcd5bae5afd55;hb=d4ae9925eecf6df33ca5bc4d285bdc71f9274952;hpb=594dd610252923591ed0f310695e82d3fb87e581 diff --git a/test/udev-test.pl b/test/udev-test.pl index 94cffeab0..63715ac09 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -24,7 +24,6 @@ my $PWD = $ENV{PWD}; my $sysfs = "sys/"; my $udev_bin = "../udev"; my $udev_root = "udev-root/"; # !!! directory will be removed !!! -my $udev_db = ".udevdb"; my $udev_conf = "udev-test.conf"; my $udev_rules = "udev-test.rules"; @@ -232,7 +231,7 @@ KERNEL=="ttyUSB0", NAME="sub/direct/ory/visor" EOF }, { - desc => "place on bus of scsi partition", + desc => "parent device name match of scsi partition", subsys => "block", devpath => "/block/sda/sda3", exp_name => "first_disk3" , @@ -244,9 +243,9 @@ EOF desc => "test substitution chars", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "Major:8:minor:3:kernelnumber:3:bus:0:0:0:0" , + exp_name => "Major:8:minor:3:kernelnumber:3:id:0:0:0:0" , rules => < "import of shell-value file", subsys => "block", devpath => "/block/sda", - exp_name => "subdir/sys/node" , + exp_name => "subdir/info/node" , rules => < "program result substitution (no argument should be subsystem)", - subsys => "block", - devpath => "/block/sda/sda3", - exp_name => "subsys_block" , - rules => < "test substitution by variable name", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "Major:8-minor:3-kernelnumber:3-bus:0:0:0:0" , + exp_name => "Major:8-minor:3-kernelnumber:3-id:0:0:0:0", rules => < "test substitution by variable name 2", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "Major:8-minor:3-kernelnumber:3-bus:0:0:0:0" , + exp_name => "Major:8-minor:3-kernelnumber:3-id:0:0:0:0", rules => < "/block/sda/sda3", exp_name => "830:0:0:03" , rules => < "/block/sda/sda3", exp_name => "833" , rules => < "/block/sda/sda3", exp_name => "8330:0:0:0" , rules => < "invalid program for device with no bus", + desc => "non matching BUS for device with no parent", subsys => "tty", devpath => "/class/tty/console", - exp_name => "TTY" , + exp_name => "TTY", rules => < "valid program for device with no bus", - subsys => "tty", - devpath => "/class/tty/console", - exp_name => "foo" , - rules => < "invalid label for device with no bus", + desc => "non matching BUS", subsys => "tty", devpath => "/class/tty/console", exp_name => "TTY" , @@ -458,7 +438,7 @@ KERNEL=="console", NAME="TTY" EOF }, { - desc => "valid label for device with no bus", + desc => "SYSFS match", subsys => "tty", devpath => "/class/tty/console", exp_name => "foo" , @@ -882,6 +862,7 @@ EOF devpath => "/class/tty/tty0", exp_name => "link", exp_target => "link", + exp_add_error => "yes", exp_rem_error => "yes", option => "clean", rules => < "node", rules => < "enumeration char test (single test)", - subsys => "block", - devpath => "/block/sda", - exp_name => "cdrom", - rules => < "enumeration char test sequence 1/5 (keep)", - subsys => "block", - devpath => "/block/sda", - exp_name => "cdrom", - option => "keep", - rules => < "enumeration char test sequence 2/5 (keep)", - subsys => "block", - devpath => "/block/sda/sda1", - exp_name => "enum", - option => "keep", - rules => < "enumeration char test sequence 3/5 (keep)", - subsys => "block", - devpath => "/block/sda/sda2", - exp_name => "cdrom1", - option => "keep", - rules => < "enumeration char test sequence 4/5 (keep)", - subsys => "block", - devpath => "/block/sda/sda3", - exp_name => "enum1", - option => "keep", - rules => < "enumeration char test sequence 5/5 (clean)", - subsys => "block", - devpath => "/block/sda/sda4", - exp_name => "cdrom2", - option => "clean", - rules => < "enumeration char test after cleanup (single test)", - subsys => "block", - devpath => "/block/sda", - exp_name => "cdrom", - rules => < "ENV{} test (assign)", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "true", + rules => < "ENV{} test (assign2)", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "part", + rules => < "/block/sda/sda1", exp_name => "sane", rules => < "untrusted string sanitize (don't replace utf8)", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "uber", + rules => < "untrusted string sanitize (replace invalid utf8)", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "replaced", + rules => < "NAME compare test", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "link", + exp_target => "node", + not_exp_name => "wronglink", + rules => < "NAME compare test 2", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "link2", + exp_target => "sda1", + not_exp_name => "link", + rules => < "invalid key operation", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "yes", + rules => < "overlong comment line", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "yes", + rules => <{option}) && $rules->{option} eq "clean") { - system("rm -rf $udev_db"); system("rm -rf $udev_root"); mkdir($udev_root) || die "unable to create udev_root: $udev_root\n"; } @@ -1718,8 +1722,8 @@ mkdir($udev_root) || die "unable to create udev_root: $udev_root\n"; # create config file open CONF, ">$udev_conf" || die "unable to create config file: $udev_conf"; print CONF "udev_root=\"$udev_root\"\n"; -print CONF "udev_db=\"$udev_db\"\n"; print CONF "udev_rules=\"$udev_rules\"\n"; +print CONF "udev_log=\"info\"\n"; close CONF; my $test_num = 1; @@ -1747,7 +1751,6 @@ if ($ARGV[0]) { print "$error errors occured\n\n"; # cleanup -system("rm -rf $udev_db"); system("rm -rf $udev_root"); unlink($udev_rules); unlink($udev_conf);