bd1529
From 6fba8e9a94026ee7b8791844ed1e7c6d464f7666 Mon Sep 17 00:00:00 2001
bd1529
From: Martin Wilck <mwilck@suse.com>
bd1529
Date: Tue, 24 Apr 2018 22:24:43 +0200
bd1529
Subject: [PATCH] test/udev-test.pl: add repeat count
bd1529
bd1529
for easier reproduction of sporadic test failures.
bd1529
bd1529
(cherry picked from commit 2ab0a8d00bc48d3531e953d938db889d8a932d65)
bd1529
bd1529
Related: #1642728
bd1529
---
bd1529
 test/udev-test.pl | 5 +++++
bd1529
 1 file changed, 5 insertions(+)
bd1529
bd1529
diff --git a/test/udev-test.pl b/test/udev-test.pl
bd1529
index d964c664b6..8b1ab3c06c 100755
bd1529
--- a/test/udev-test.pl
bd1529
+++ b/test/udev-test.pl
bd1529
@@ -2125,6 +2125,7 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "multiple devices, same link name, positive prio",
bd1529
+                repeat          => 100,
bd1529
                 devices => [
bd1529
                         {
bd1529
                                 devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
@@ -2635,6 +2636,7 @@ sub run_test {
bd1529
         print "TEST $number: $rules->{desc}\n";
bd1529
         create_rules(\$rules->{rules});
bd1529
 
bd1529
+      REPEAT:
bd1529
         fork_and_run_udev("add", $rules, $sema);
bd1529
 
bd1529
         foreach my $dev (@devices) {
bd1529
@@ -2653,6 +2655,9 @@ sub run_test {
bd1529
         }
bd1529
 
bd1529
         print "\n";
bd1529
+        if (defined($rules->{repeat}) && --($rules->{repeat}) > 0) {
bd1529
+                goto REPEAT;
bd1529
+        }
bd1529
 
bd1529
         if (defined($rules->{option}) && $rules->{option} eq "clean") {
bd1529
                 udev_setup();