]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: run tests in random order
authorSage Weil <sage@newdream.net>
Fri, 2 Apr 2010 22:47:25 +0000 (15:47 -0700)
committerSage Weil <sage@newdream.net>
Sat, 3 Apr 2010 03:07:34 +0000 (20:07 -0700)
qa/loopall.sh
qa/runallonce.sh
src/script/permute [new file with mode: 0755]

index d317f7a8814e0fc4c4e3f50c163a34113137243b..b533a7ca0955a215b988eea49aac239d6cb89bdc 100755 (executable)
@@ -13,7 +13,7 @@ cd $testdir
 
 while true
 do
-    for test in `cd $basedir/workunits && ls | grep .sh`
+    for test in `cd $basedir/workunits && ls | grep .sh | $basedir/../src/script/permute`
     do
        echo "------ running test $test ------"
        pwd
index ea35f69e6bcc56e15d5f104141cd878cc8ee542e..1aeda70e4cb11891f8bdab6f383f5254cb0906de 100755 (executable)
@@ -11,7 +11,7 @@ testdir="$1"
 [ -z "$testdir" ] || [ ! -d "$testdir" ] && echo "specify test dir" && exit 1
 cd $testdir
 
-for test in `cd $basedir/workunits && ls | grep .sh`
+for test in `cd $basedir/workunits && ls | grep .sh | $basedir/../src/script/permute`
 do
   echo "------ running test $test ------"
   pwd
diff --git a/src/script/permute b/src/script/permute
new file mode 100755 (executable)
index 0000000..63dd910
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+
+use strict;
+my @lines = <>;
+
+while (@lines) {
+    my $r = int rand(scalar(@lines));
+    print $lines[$r];
+    splice(@lines, $r, 1);
+}