summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-03-28 12:20:05 +0200
committerGreg KH <gregkh@suse.de>2005-04-26 23:55:00 -0700
commitdb949b02489f521e32a052280f913e06b7c87e37 (patch)
treeaa34de4f1dc3f5ade218359668251c68662db321 /test
parent98bbc835f584ed6792e895519326cc637f64f411 (diff)
[PATCH] allow to match against empty key values
Diffstat (limited to 'test')
-rw-r--r--test/udev-test.pl20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl
index ed94629dd1..27ca37115c 100644
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -806,7 +806,7 @@ EOF
exp_name => "link",
exp_target => "link",
exp_rem_error => "yes",
- option => "clear",
+ option => "clean",
rules => <<EOF
KERNEL=="tty0", NAME="link", SYMLINK="link"
EOF
@@ -1006,7 +1006,7 @@ EOF
subsys => "block",
devpath => "/block/sda/sda4",
exp_name => "cdrom2",
- option => "clear",
+ option => "clean",
rules => <<EOF
KERNEL=="sda4", NAME="cdrom%e"
EOF
@@ -1067,7 +1067,7 @@ EOF
devpath => "/block/sda",
exp_name => "node14",
exp_rem_error => "yes",
- option => "clear",
+ option => "clean",
rules => <<EOF
BUS=="scsi", KERNEL=="sda", NAME="node", OPTIONS="ignore_remove, all_partitions"
EOF
@@ -1233,6 +1233,18 @@ EOF
KERNEL=="ttyUSB*", NAME="serial-%s{serial}"
EOF
},
+ {
+ desc => "match against empty key string",
+ subsys => "block",
+ devpath => "/block/sda",
+ exp_name => "ok",
+ rules => <<EOF
+KERNEL=="sda", SYSFS{nothing}!="", NAME="not-1-ok"
+KERNEL=="sda", SYSFS{nothing}=="", NAME="not-2-ok"
+KERNEL=="sda", SYSFS{vendor}!="", NAME="ok"
+KERNEL=="sda", SYSFS{vendor}=="", NAME="not-3-ok"
+EOF
+ },
);
# set env
@@ -1415,7 +1427,7 @@ sub run_test {
print "\n";
- if (defined($rules->{option}) && $rules->{option} eq "clear") {
+ if (defined($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";