diff options
| author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-27 23:26:57 -0500 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-05-14 12:45:56 -0400 |
| commit | 14d9d84c9e9b54e02ea69ab5cb6e2114f3639160 (patch) | |
| tree | 9baae8f1f6902eed553397b29e2f5a22739b4c0d /tools/testing/selftests/rcutorture | |
| parent | 1f5d09205f8c12de4b3d612259fb2ec6464ba8ff (diff) | |
torture: Make "--dryrun script" use same environment as normal run
In a normal torture-test run, the script inherits its environment
variables, but this does not work when producing a script that is
to run later. Therefore, definitions and exports are prepended to
a dryrun script but not to a script that is run immediately. This
commit reconciles this by placing definitions and exports at the
beginning of the script in both cases.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Conflicts:
tools/testing/selftests/rcutorture/bin/kvm.sh
Diffstat (limited to 'tools/testing/selftests/rcutorture')
| -rw-r--r-- | tools/testing/selftests/rcutorture/bin/kvm.sh | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh index b5a5d6c15e78..8547886ca629 100644 --- a/tools/testing/selftests/rcutorture/bin/kvm.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh | |||
| @@ -241,8 +241,18 @@ END { | |||
| 241 | 241 | ||
| 242 | # Generate a script to execute the tests in appropriate batches. | 242 | # Generate a script to execute the tests in appropriate batches. |
| 243 | cat << ___EOF___ > $T/script | 243 | cat << ___EOF___ > $T/script |
| 244 | TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE | 244 | CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG |
| 245 | KVM="$KVM"; export KVM | ||
| 246 | KVPATH="$KVPATH"; export KVPATH | ||
| 247 | PATH="$PATH"; export PATH | ||
| 248 | TORTURE_BUILDONLY="$TORTURE_BUILDONLY"; export TORTURE_BUILDONLY | ||
| 245 | TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG | 249 | TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG |
| 250 | TORTURE_INITRD="$TORTURE_INITRD"; export TORTURE_INITRD | ||
| 251 | TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG"; export TORTURE_KMAKE_ARG | ||
| 252 | TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD"; export TORTURE_QEMU_CMD | ||
| 253 | TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE"; export TORTURE_QEMU_INTERACTIVE | ||
| 254 | TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC"; export TORTURE_QEMU_MAC | ||
| 255 | TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE | ||
| 246 | if ! test -e $resdir | 256 | if ! test -e $resdir |
| 247 | then | 257 | then |
| 248 | mkdir -p "$resdir" || : | 258 | mkdir -p "$resdir" || : |
| @@ -371,20 +381,6 @@ ___EOF___ | |||
| 371 | 381 | ||
| 372 | if test "$dryrun" = script | 382 | if test "$dryrun" = script |
| 373 | then | 383 | then |
| 374 | # Dump out the script, but define the environment variables that | ||
| 375 | # it needs to run standalone. | ||
| 376 | echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG" | ||
| 377 | echo KVM="$KVM; export KVM" | ||
| 378 | echo KVPATH="$KVPATH; export KVPATH" | ||
| 379 | echo PATH="$PATH; export PATH" | ||
| 380 | echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY" | ||
| 381 | echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD" | ||
| 382 | echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG" | ||
| 383 | echo TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD; export TORTURE_QEMU_CMD" | ||
| 384 | echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE; export TORTURE_QEMU_INTERACTIVE" | ||
| 385 | echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC" | ||
| 386 | echo "mkdir -p "$resdir" || :" | ||
| 387 | echo "mkdir $resdir/$ds" | ||
| 388 | cat $T/script | 384 | cat $T/script |
| 389 | exit 0 | 385 | exit 0 |
| 390 | elif test "$dryrun" = sched | 386 | elif test "$dryrun" = sched |
