daandemeyer / rpms / systemd

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