From 647f7c49e8ddfbbe2afd9545484a3ad936f438e9 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 30 Jan 2009 03:53:09 +0100 Subject: fix NAME="" logic Reported-By: Soh Kam Yung --- test/udev-test.pl | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'test') diff --git a/test/udev-test.pl b/test/udev-test.pl index 61e91c48b6..1b81eb8d72 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); } -- cgit v1.2.3-54-g00ecf