naccyde / rpms / systemd

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