torture: Make kvm-again.sh use "scenarios" rather than "batches" file
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 5 Mar 2021 01:52:59 +0000 (17:52 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 10 May 2021 23:05:05 +0000 (16:05 -0700)
This commit saves a few lines of code by making kvm-again.sh use the
"scenarios" file rather than the "batches" file, both of which are
generated by kvm.sh.

This results in a break point because new versions of kvm-again.sh cannot
handle "res" directories produced by old versions of kvm.sh, which lack
the "scenarios" file.  In the unlikely event that this becomes a problem,
a trivial script suffices to convert the "batches" file to a "scenarios"
file, and this script may be easily extracted from kvm.sh.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/testing/selftests/rcutorture/bin/kvm-again.sh

index 46e47a00a7db4dd47e71f4db24ded498b182bfe3..b74bb4343ab9adf0c3a4e67d9de92b761f0179bf 100755 (executable)
@@ -29,7 +29,7 @@ then
        echo "Usage: $scriptname /path/to/old/run [ options ]"
        exit 1
 fi
-if ! cp "$oldrun/batches" $T/batches.oldrun
+if ! cp "$oldrun/scenarios" $T/scenarios.oldrun
 then
        # Later on, can reconstitute this from console.log files.
        echo Prior run batches file does not exist: $oldrun/batches
@@ -165,22 +165,12 @@ done
 grep '^#' $i | sed -e 's/^# //' > $T/qemu-cmd-settings
 . $T/qemu-cmd-settings
 
-grep -v '^#' $T/batches.oldrun | awk '
-BEGIN {
-       oldbatch = 1;
-}
-
+grep -v '^#' $T/scenarios.oldrun | awk '
 {
-       if (oldbatch != $1) {
-               print "kvm-test-1-run-batch.sh" curbatch;
-               curbatch = "";
-               oldbatch = $1;
-       }
-       curbatch = curbatch " " $2;
-}
-
-END {
-       print "kvm-test-1-run-batch.sh" curbatch
+       curbatch = "";
+       for (i = 2; i <= NF; i++)
+               curbatch = curbatch " " $i;
+       print "kvm-test-1-run-batch.sh" curbatch;
 }' > $T/runbatches.sh
 
 if test -n "$dryrun"