summaryrefslogtreecommitdiff
path: root/test/udev-test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'test/udev-test.pl')
-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 94cffeab07..c32cfe7eeb 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",