Commit b038c58b authored by Paul E. McKenney's avatar Paul E. McKenney

torture: Provide TMPDIR environment variable to specify tmpdir

Both rcutorture and locktorture currently place temporary files in /tmp,
in keeping with decades-long tradition.  However, sometimes it is useful
to specify an alternative temporary directory, for example, for space
or performance reasons.  This commit therefore causes the torture-test
scripting to use the path specified in the TMPDIR environment variable,
or to fall back to traditional /tmp if this variable is not set.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 0032f4e8
......@@ -42,7 +42,7 @@ else
exit 1
fi
T=/tmp/config_override.sh.$$
T=${TMPDIR-/tmp}/config_override.sh.$$
trap 'rm -rf $T' 0
mkdir $T
......
......@@ -19,7 +19,7 @@
#
# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
T=/tmp/abat-chk-config.sh.$$
T=${TMPDIR-/tmp}/abat-chk-config.sh.$$
trap 'rm -rf $T' 0
mkdir $T
......
......@@ -32,7 +32,7 @@
#
# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
T=/tmp/configinit.sh.$$
T=${TMPDIR-/tmp}/configinit.sh.$$
trap 'rm -rf $T' 0
mkdir $T
......
......@@ -35,7 +35,7 @@ then
exit 1
fi
T=/tmp/test-linux.sh.$$
T=${TMPDIR-/tmp}/test-linux.sh.$$
trap 'rm -rf $T' 0
mkdir $T
......
......@@ -38,7 +38,7 @@
#
# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
T=/tmp/kvm-test-1-run.sh.$$
T=${TMPDIR-/tmp}/kvm-test-1-run.sh.$$
trap 'rm -rf $T' 0
mkdir $T
......
......@@ -30,7 +30,7 @@
scriptname=$0
args="$*"
T=/tmp/kvm.sh.$$
T=${TMPDIR-/tmp}/kvm.sh.$$
trap 'rm -rf $T' 0
mkdir $T
......@@ -222,7 +222,7 @@ do
exit 1
fi
done
sort -k2nr $T/cfgcpu > $T/cfgcpu.sort
sort -k2nr $T/cfgcpu -T="$T" > $T/cfgcpu.sort
# Use a greedy bin-packing algorithm, sorting the list accordingly.
awk < $T/cfgcpu.sort > $T/cfgcpu.pack -v ncpus=$cpus '
......
......@@ -28,7 +28,7 @@
F=$1
title=$2
T=/tmp/parse-build.sh.$$
T=${TMPDIR-/tmp}/parse-build.sh.$$
trap 'rm -rf $T' 0
mkdir $T
......
......@@ -27,7 +27,7 @@
#
# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
T=/tmp/parse-torture.sh.$$
T=${TMPDIR-/tmp}/parse-torture.sh.$$
file="$1"
title="$2"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment