naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
bd1529
From 66c41fbbeb472563993724352b1984aa3e7e47db Mon Sep 17 00:00:00 2001
bd1529
From: Yu Watanabe <watanabe.yu+github@gmail.com>
bd1529
Date: Tue, 19 Feb 2019 09:22:45 +0900
bd1529
Subject: [PATCH] test-udev: add more tests for line continuations and comments
bd1529
bd1529
(cherry picked from commit d35976c670b0e5c2d4081b781e5af88c0689ff00)
bd1529
bd1529
Related: #1642728
bd1529
---
bd1529
 test/udev-test.pl | 12 ++++++++++--
bd1529
 1 file changed, 10 insertions(+), 2 deletions(-)
bd1529
bd1529
diff --git a/test/udev-test.pl b/test/udev-test.pl
bd1529
index 58b5dc85e1..a5e1f8cda3 100755
bd1529
--- a/test/udev-test.pl
bd1529
+++ b/test/udev-test.pl
bd1529
@@ -1453,13 +1453,21 @@ TAGS=="test1", TAGS=="test500", TAGS=="test1234", TAGS=="test9999", TAGS=="test1
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
-                desc            => "don't crash with lots of tags with continuation",
bd1529
+                desc            => "continuations",
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           => $rules_10k_tags_continuation . <
bd1529
 TAGS=="test1", TAGS=="test500", TAGS=="test1234", TAGS=="test9999", TAGS=="test10000", SYMLINK+="bad"
bd1529
-KERNEL=="sda", SYMLINK+="found"
bd1529
+KERNEL=="sda",\\
bd1529
+# comment in continuation
bd1529
+TAG+="hoge1",\\
bd1529
+  # space before comment
bd1529
+TAG+="hoge2",\\
bd1529
+# spaces before and after token are dropped
bd1529
+  TAG+="hoge3",   \\
bd1529
+TAG+="hoge4"
bd1529
+TAGS=="hoge1", TAGS=="hoge2", TAGS=="hoge3", TAGS=="hoge4", SYMLINK+="found"
bd1529
 EOF
bd1529
         },
bd1529
 );