daandemeyer / rpms / systemd

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