daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
6136c1
From ac0def8fb2b51a17b7ef256c5c0edf786fffff2a Mon Sep 17 00:00:00 2001
6136c1
From: Yu Watanabe <watanabe.yu+github@gmail.com>
6136c1
Date: Thu, 21 Feb 2019 18:03:32 +0900
6136c1
Subject: [PATCH] test-udev: add more tests for line continuation
6136c1
6136c1
(cherry picked from commit 84a0819c9d89a2ddb195a5d975ae1fd5c62fde3c)
6136c1
6136c1
Related: #1642728
6136c1
---
6136c1
 test/udev-test.pl | 34 ++++++++++++++++++++++++++++++++++
6136c1
 1 file changed, 34 insertions(+)
6136c1
6136c1
diff --git a/test/udev-test.pl b/test/udev-test.pl
6136c1
index a5e1f8cda3..002fabd9fd 100755
6136c1
--- a/test/udev-test.pl
6136c1
+++ b/test/udev-test.pl
6136c1
@@ -1466,8 +1466,42 @@ TAG+="hoge1",\\
6136c1
 TAG+="hoge2",\\
6136c1
 # spaces before and after token are dropped
6136c1
   TAG+="hoge3",   \\
6136c1
+\\
6136c1
+ \\
6136c1
 TAG+="hoge4"
6136c1
 TAGS=="hoge1", TAGS=="hoge2", TAGS=="hoge3", TAGS=="hoge4", SYMLINK+="found"
6136c1
+EOF
6136c1
+        },
6136c1
+        {
6136c1
+                desc            => "continuations with empty line",
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
+# empty line finishes continuation
6136c1
+KERNEL=="sda", TAG+="foo" \\
6136c1
+
6136c1
+KERNEL=="sdb", TAG+="hoge"
6136c1
+KERNEL=="sda", TAG+="aaa" \\
6136c1
+KERNEL=="sdb", TAG+="bbb"
6136c1
+TAGS=="foo", SYMLINK+="found"
6136c1
+TAGS=="aaa", SYMLINK+="bad"
6136c1
+EOF
6136c1
+        },
6136c1
+        {
6136c1
+                desc            => "continuations with white only line",
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
+# space only line finishes continuation
6136c1
+KERNEL=="sda", TAG+="foo" \\
6136c1
+   \t
6136c1
+KERNEL=="sdb", TAG+="hoge"
6136c1
+KERNEL=="sda", TAG+="aaa" \\
6136c1
+KERNEL=="sdb", TAG+="bbb"
6136c1
+TAGS=="foo", SYMLINK+="found"
6136c1
+TAGS=="aaa", SYMLINK+="bad"
6136c1
 EOF
6136c1
         },
6136c1
 );