21255d
From 134a415c2d690e57d0f1add23e900e60bcef4627 Mon Sep 17 00:00:00 2001
21255d
From: Martin Wilck <mwilck@suse.com>
21255d
Date: Tue, 24 Apr 2018 18:09:50 +0200
21255d
Subject: [PATCH] test/udev-test.pl: Make some tests a little harder
21255d
21255d
Add some rules that make it a bit harder to pass, mainly the
21255d
non-existence checks.
21255d
21255d
(cherry picked from commit 06d4d4e24e7d0b51120b165e540d278842e8b1a3)
21255d
21255d
Related: #1642728
21255d
---
21255d
 test/udev-test.pl | 13 +++++++++----
21255d
 1 file changed, 9 insertions(+), 4 deletions(-)
21255d
21255d
diff --git a/test/udev-test.pl b/test/udev-test.pl
21255d
index a9c2dd95f1..7465b5859e 100755
21255d
--- a/test/udev-test.pl
21255d
+++ b/test/udev-test.pl
21255d
@@ -1358,7 +1358,7 @@ EOF
21255d
                                 exp_links       => ["sda-part-1"],
21255d
                         }],
21255d
                 rules           => <
21255d
-SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="%P-part-1"
21255d
+SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="%P-part-%n"
21255d
 EOF
21255d
         },
21255d
         {
21255d
@@ -1486,6 +1486,7 @@ SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="true"
21255d
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="absolutely-\$env{ASSIGN}"
21255d
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="before"
21255d
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="yes", SYMLINK+="no"
21255d
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="true", SYMLINK+="bad"
21255d
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="absolutely-true", SYMLINK+="true"
21255d
 EOF
21255d
         },
21255d
@@ -1497,6 +1498,11 @@ EOF
21255d
                                 exp_links       => ["part"],
21255d
                                 not_exp_links   => ["disk"],
21255d
                         },
21255d
+                        {
21255d
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
21255d
+                                exp_links       => ["disk"],
21255d
+                                not_exp_links   => ["part"],
21255d
+                        },
21255d
                     ],
21255d
                 rules           => <
21255d
 SUBSYSTEM=="block", KERNEL=="*[0-9]", ENV{PARTITION}="true", ENV{MAINDEVICE}="false"
21255d
@@ -1588,7 +1594,7 @@ EOF
21255d
                         }],
21255d
                 rules           => <
21255d
 KERNEL=="sda", GROUP:="tty"
21255d
-KERNEL=="sda", GROUP="not-ok", MODE="0640", SYMLINK+="ok"
21255d
+KERNEL=="sda", GROUP="root", MODE="0640", SYMLINK+="ok"
21255d
 EOF
21255d
         },
21255d
         {
21255d
@@ -1602,7 +1608,7 @@ EOF
21255d
                 rules           => <
21255d
 KERNEL=="sda", GROUP:="tty"
21255d
 SUBSYSTEM=="block", MODE:="640"
21255d
-KERNEL=="sda", GROUP="not-ok", MODE="0666", SYMLINK+="ok"
21255d
+KERNEL=="sda", GROUP="root", MODE="0666", SYMLINK+="ok"
21255d
 EOF
21255d
         },
21255d
         {
21255d
@@ -1983,7 +1989,6 @@ EOF
21255d
                         {
21255d
                                 devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
21255d
                                 exp_perms       => "1:1:0400",
21255d
-                                exp_rem_error   => "yes",
21255d
                         }],
21255d
                 rules           => <
21255d
 KERNEL=="sda", MODE="666"