summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-09-11 09:06:15 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-09-21 22:58:46 +0200
commit5d84a7ad1c2d8d96a3ffb5c275e8704de361b7fc (patch)
tree83399b02c6df08928c3fa5de1bcf276c44a39933
parent1536348cc863f12312d8f7e7ea1826e54561c18f (diff)
downloadsystemd-5d84a7ad1c2d8d96a3ffb5c275e8704de361b7fc.tar.gz
test: add test cases for empty string match
(cherry picked from commit 48d26c90852c22ec94be961f5fbdcf462bb9a6e8)
-rwxr-xr-xtest/udev-test.pl66
1 files changed, 66 insertions, 0 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 85ec41b641..95013279b8 100755
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -1259,6 +1259,72 @@ KERNEL=="ttyACM0a|nothing", SYMLINK+="wrong3"
EOF
},
{
+ desc => "test multi matches 5",
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+ exp_name => "found",
+ not_exp_name => "bad",
+ rules => <<EOF
+KERNEL=="sda", TAG="foo"
+TAGS=="|foo", SYMLINK+="found"
+TAGS=="|aaa", SYMLINK+="bad"
+EOF
+ },
+ {
+ desc => "test multi matches 6",
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+ exp_name => "found",
+ not_exp_name => "bad",
+ rules => <<EOF
+KERNEL=="sda", TAG=""
+TAGS=="|foo", SYMLINK+="found"
+TAGS=="aaa|bbb", SYMLINK+="bad"
+EOF
+ },
+ {
+ desc => "test multi matches 7",
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+ exp_name => "found",
+ not_exp_name => "bad",
+ rules => <<EOF
+KERNEL=="sda", TAG="foo"
+TAGS=="foo||bar", SYMLINK+="found"
+TAGS=="aaa||bbb", SYMLINK+="bad"
+EOF
+ },
+ {
+ desc => "test multi matches 8",
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+ exp_name => "found",
+ not_exp_name => "bad",
+ rules => <<EOF
+KERNEL=="sda", TAG=""
+TAGS=="foo||bar", SYMLINK+="found"
+TAGS=="aaa|bbb", SYMLINK+="bad"
+EOF
+ },
+ {
+ desc => "test multi matches 9",
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+ exp_name => "found",
+ not_exp_name => "bad",
+ rules => <<EOF
+KERNEL=="sda", TAG="foo"
+TAGS=="foo|", SYMLINK+="found"
+TAGS=="aaa|", SYMLINK+="bad"
+EOF
+ },
+ {
+ desc => "test multi matches 10",
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+ exp_name => "found",
+ not_exp_name => "bad",
+ rules => <<EOF
+KERNEL=="sda", TAG=""
+TAGS=="foo|", SYMLINK+="found"
+TAGS=="aaa|bbb", SYMLINK+="bad"
+EOF
+ },
+ {
desc => "IMPORT parent test sequence 1/2 (keep)",
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
exp_name => "parent",