]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test/udev-test.pl: add repeat count
authorMartin Wilck <mwilck@suse.com>
Tue, 24 Apr 2018 20:24:43 +0000 (22:24 +0200)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Mon, 25 Jan 2021 14:05:18 +0000 (15:05 +0100)
for easier reproduction of sporadic test failures.

(cherry picked from commit 2ab0a8d00bc48d3531e953d938db889d8a932d65)

Related: #1642728

test/udev-test.pl

index d964c664b6b17cdf97339b5abfe3bfeda17a5924..8b1ab3c06c95c21842342dd85282be77910af103 100755 (executable)
@@ -2125,6 +2125,7 @@ EOF
         },
         {
                 desc            => "multiple devices, same link name, positive prio",
+                repeat          => 100,
                 devices => [
                         {
                                 devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
@@ -2635,6 +2636,7 @@ sub run_test {
         print "TEST $number: $rules->{desc}\n";
         create_rules(\$rules->{rules});
 
+      REPEAT:
         fork_and_run_udev("add", $rules, $sema);
 
         foreach my $dev (@devices) {
@@ -2653,6 +2655,9 @@ sub run_test {
         }
 
         print "\n";
+        if (defined($rules->{repeat}) && --($rules->{repeat}) > 0) {
+                goto REPEAT;
+        }
 
         if (defined($rules->{option}) && $rules->{option} eq "clean") {
                 udev_setup();