daandemeyer / rpms / systemd

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