|
|
21255d |
From 03bc565e6e3249385c4e1ca0ae27670ca2ad9a41 Mon Sep 17 00:00:00 2001
|
|
|
21255d |
From: Yu Watanabe <watanabe.yu+github@gmail.com>
|
|
|
21255d |
Date: Wed, 11 Sep 2019 09:06:15 +0900
|
|
|
21255d |
Subject: [PATCH] test: add test cases for empty string match
|
|
|
21255d |
|
|
|
21255d |
(cherry picked from commit 48d26c90852c22ec94be961f5fbdcf462bb9a6e8)
|
|
|
21255d |
|
|
|
21255d |
Related: #1642728
|
|
|
21255d |
---
|
|
|
21255d |
test/udev-test.pl | 66 +++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
21255d |
1 file changed, 66 insertions(+)
|
|
|
21255d |
|
|
|
21255d |
diff --git a/test/udev-test.pl b/test/udev-test.pl
|
|
|
21255d |
index 2fea72875b..50d978391b 100755
|
|
|
21255d |
--- a/test/udev-test.pl
|
|
|
21255d |
+++ b/test/udev-test.pl
|
|
|
21255d |
@@ -1256,6 +1256,72 @@ KERNEL=="dontknow|ttyACM0a|nothing|attyACM0", SYMLINK+="wrong1"
|
|
|
21255d |
KERNEL=="X|attyACM0|dontknow|ttyACM0a|nothing|attyACM0", SYMLINK+="wrong2"
|
|
|
21255d |
KERNEL=="all|dontknow|ttyACM0", SYMLINK+="right"
|
|
|
21255d |
KERNEL=="ttyACM0a|nothing", SYMLINK+="wrong3"
|
|
|
21255d |
+EOF
|
|
|
21255d |
+ },
|
|
|
21255d |
+ {
|
|
|
21255d |
+ desc => "test multi matches 5",
|
|
|
21255d |
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
|
21255d |
+ exp_name => "found",
|
|
|
21255d |
+ not_exp_name => "bad",
|
|
|
21255d |
+ rules => <
|
|
|
21255d |
+KERNEL=="sda", TAG="foo"
|
|
|
21255d |
+TAGS=="|foo", SYMLINK+="found"
|
|
|
21255d |
+TAGS=="|aaa", SYMLINK+="bad"
|
|
|
21255d |
+EOF
|
|
|
21255d |
+ },
|
|
|
21255d |
+ {
|
|
|
21255d |
+ desc => "test multi matches 6",
|
|
|
21255d |
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
|
21255d |
+ exp_name => "found",
|
|
|
21255d |
+ not_exp_name => "bad",
|
|
|
21255d |
+ rules => <
|
|
|
21255d |
+KERNEL=="sda", TAG=""
|
|
|
21255d |
+TAGS=="|foo", SYMLINK+="found"
|
|
|
21255d |
+TAGS=="aaa|bbb", SYMLINK+="bad"
|
|
|
21255d |
+EOF
|
|
|
21255d |
+ },
|
|
|
21255d |
+ {
|
|
|
21255d |
+ desc => "test multi matches 7",
|
|
|
21255d |
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
|
21255d |
+ exp_name => "found",
|
|
|
21255d |
+ not_exp_name => "bad",
|
|
|
21255d |
+ rules => <
|
|
|
21255d |
+KERNEL=="sda", TAG="foo"
|
|
|
21255d |
+TAGS=="foo||bar", SYMLINK+="found"
|
|
|
21255d |
+TAGS=="aaa||bbb", SYMLINK+="bad"
|
|
|
21255d |
+EOF
|
|
|
21255d |
+ },
|
|
|
21255d |
+ {
|
|
|
21255d |
+ desc => "test multi matches 8",
|
|
|
21255d |
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
|
21255d |
+ exp_name => "found",
|
|
|
21255d |
+ not_exp_name => "bad",
|
|
|
21255d |
+ rules => <
|
|
|
21255d |
+KERNEL=="sda", TAG=""
|
|
|
21255d |
+TAGS=="foo||bar", SYMLINK+="found"
|
|
|
21255d |
+TAGS=="aaa|bbb", SYMLINK+="bad"
|
|
|
21255d |
+EOF
|
|
|
21255d |
+ },
|
|
|
21255d |
+ {
|
|
|
21255d |
+ desc => "test multi matches 9",
|
|
|
21255d |
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
|
21255d |
+ exp_name => "found",
|
|
|
21255d |
+ not_exp_name => "bad",
|
|
|
21255d |
+ rules => <
|
|
|
21255d |
+KERNEL=="sda", TAG="foo"
|
|
|
21255d |
+TAGS=="foo|", SYMLINK+="found"
|
|
|
21255d |
+TAGS=="aaa|", SYMLINK+="bad"
|
|
|
21255d |
+EOF
|
|
|
21255d |
+ },
|
|
|
21255d |
+ {
|
|
|
21255d |
+ desc => "test multi matches 10",
|
|
|
21255d |
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
|
21255d |
+ exp_name => "found",
|
|
|
21255d |
+ not_exp_name => "bad",
|
|
|
21255d |
+ rules => <
|
|
|
21255d |
+KERNEL=="sda", TAG=""
|
|
|
21255d |
+TAGS=="foo|", SYMLINK+="found"
|
|
|
21255d |
+TAGS=="aaa|bbb", SYMLINK+="bad"
|
|
|
21255d |
EOF
|
|
|
21255d |
},
|
|
|
21255d |
{
|