X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=test%2Fudev-test.pl;h=1b81eb8d722ad29e8e06cd0805248627600aa92c;hp=61e91c48b66e9ec5381ea72b87cee7beb5bfd900;hb=647f7c49e8ddfbbe2afd9545484a3ad936f438e9;hpb=57d057d28d96fdbf36b7a5f32ded7af5d3b8d6f1 diff --git a/test/udev-test.pl b/test/udev-test.pl index 61e91c48b..1b81eb8d7 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1032,7 +1032,7 @@ EOF not_exp_name => "node", exp_add_error => "yes", rules => < "tty", devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0", exp_name => "", + not_exp_name => "ttyACM0", + exp_add_error => "yes", + rules => < "test empty NAME (empty override)", + subsys => "tty", + devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0", + exp_name => "", not_exp_name => "wrong", exp_add_error => "yes", rules => < "test empty NAME 2", + desc => "test empty NAME (non-empty override)", subsys => "tty", devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0", exp_name => "right", @@ -1593,16 +1604,6 @@ EOF rules => < "TEST invalid NAME= only (skip invalid rule)", - subsys => "block", - devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", - exp_name => "yes", - rules => <{subsys}, $rules->{devpath}, \$rules->{rules}); + if (defined($rules->{not_exp_name})) { + if ((-e "$PWD/$udev_root$rules->{not_exp_name}") || + (-l "$PWD/$udev_root$rules->{not_exp_name}")) { + print "nonexistent: error \'$rules->{not_exp_name}\' not expected to be there\n"; + $error++ + } + } + if ((-e "$PWD/$udev_root$rules->{exp_name}") || (-l "$PWD/$udev_root$rules->{exp_name}")) { my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat("$PWD/$udev_root$rules->{exp_name}"); - if (defined($rules->{not_exp_name})) { - if ((-e "$PWD/$udev_root$rules->{not_exp_name}") || - (-l "$PWD/$udev_root$rules->{not_exp_name}")) { - print "nonexistent: error \'$rules->{not_exp_name}\' not expected to be there\n"; - $error++ - } - } if (defined($rules->{exp_perms})) { permissions_test($rules, $uid, $gid, $mode); }