aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-08-16 04:25:20 +0200
committerKay Sievers <kay.sievers@suse.de>2005-08-16 04:25:20 +0200
commit5618b5611bccf64a1e22f8cbcebe8ecba9713c9c (patch)
tree18d27982b65de15ec4e4b7cd134edf07e629830c /test
parentbeb9f9ccb83b2c6f367b34e28ed6841141a42d48 (diff)
downloadudev-5618b5611bccf64a1e22f8cbcebe8ecba9713c9c.tar.gz
ENV{TEST}=="1" compares and ENV{TEST}="1" sets the environment
This can be uses to export stuff to the event environment or to carry a state from one rule to another, like enabling/disabling later rules conditionally. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'test')
-rwxr-xr-xtest/udev-test.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 94cffeab..c32cfe7e 100755
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -1294,6 +1294,31 @@ BUS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="bad", NAME="bad"
EOF
},
{
+ desc => "ENV{} test (assign)",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "true",
+ rules => <<EOF
+BUS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="true"
+BUS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="yes", NAME="no"
+BUS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="true", NAME="true"
+BUS=="scsi", KERNEL=="sda1", NAME="bad"
+EOF
+ },
+ {
+ desc => "ENV{} test (assign2)",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "part",
+ rules => <<EOF
+SUBSYSTEM=="block", KERNEL="*[0-9]", ENV{PARTITION}="true", ENV{MAINDEVICE}="false"
+SUBSYSTEM=="block", KERNEL="*[!0-9]", ENV{PARTITION}="false", ENV{MAINDEVICE}="true"
+ENV{MAINDEVICE}=="true", NAME="disk"
+ENV{PARTITION}=="true", NAME="part"
+NAME="bad"
+EOF
+ },
+ {
desc => "untrusted string sanitize",
subsys => "block",
devpath => "/block/sda/sda1",