From: Sage Weil Date: Fri, 2 Apr 2010 22:47:25 +0000 (-0700) Subject: qa: run tests in random order X-Git-Tag: v0.20~124 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4d5ce888f252afe2df294f125c5b93ea9b3ceba4;p=ceph.git qa: run tests in random order --- diff --git a/qa/loopall.sh b/qa/loopall.sh index d317f7a8814e..b533a7ca0955 100755 --- a/qa/loopall.sh +++ b/qa/loopall.sh @@ -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 diff --git a/qa/runallonce.sh b/qa/runallonce.sh index ea35f69e6bcc..1aeda70e4cb1 100755 --- a/qa/runallonce.sh +++ b/qa/runallonce.sh @@ -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 index 000000000000..63dd910a1f91 --- /dev/null +++ b/src/script/permute @@ -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); +}