2 # SPDX-License-Identifier: GPL-2.0+
4 # Carry out a kvm-based run for the specified batch of scenarios, which
5 # might have been built by --build-only kvm.sh run.
7 # Usage: kvm-test-1-run-batch.sh SCENARIO [ SCENARIO ... ]
9 # Each SCENARIO is the name of a directory in the current directory
10 # containing a ready-to-run qemu-cmd file.
12 # Copyright (C) 2021 Facebook, Inc.
14 # Authors: Paul E. McKenney <paulmck@kernel.org>
16 T=${TMPDIR-/tmp}/kvm-test-1-run-batch.sh.$$
20 echo ---- Running batch $*
25 if ! echo $i | grep -q '^[^/.a-z]\+\(\.[0-9]\+\)\?$'
27 echo Bad scenario name: \"$i\" 1>&2
32 echo Scenario name not a directory: \"$i\" 1>&2
35 if ! test -f "$i/qemu-cmd"
37 echo Scenario lacks a command file: \"$i/qemu-cmd\" 1>&2
42 runfiles="$runfiles $i/build.run"
45 # Extract settings from the qemu-cmd file.
46 grep '^#' $1/qemu-cmd | sed -e 's/^# //' > $T/qemu-cmd-settings
47 . $T/qemu-cmd-settings
49 # Start up jitter, start each scenario, wait, end jitter.
50 echo ---- System running test: `uname -a`
51 echo ---- Starting kernels. `date` | tee -a log
55 echo ---- System running test: `uname -a` > $i/kvm-test-1-run-qemu.sh.out
56 echo > $i/kvm-test-1-run-qemu.sh.out
57 kvm-test-1-run-qemu.sh $i >> $i/kvm-test-1-run-qemu.sh.out 2>&1 &
61 while ls $i > /dev/null 2>&1
66 echo ---- All kernel runs complete. `date` | tee -a log