summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-08-21 23:20:42 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-08-22 13:37:35 +0200
commit3febc4d4de97f330e9cabc5484c6815883967e0c (patch)
tree026a5e7ab231ee6cfb7a27f61f5da14a5368aeed
parentcbf95a0b117461473f05ab3cce4d01ba2b29e60a (diff)
downloadqemu-3febc4d4de97f330e9cabc5484c6815883967e0c.tar.gz
qemu-iotests: stop using /tmp directly
Before this patch you could not run multiple tests concurrently as they might clobber each other test files. This patch solves that by using random temporary directory instead of `/tmp` (for writing output in the individual tests and valgrind logs). Furthermore, this patch stops removing everything in `/tmp/` matching a certain pattern (`/tmp/*.{err,out,time}`). These might not be a property of QEMU. Running multiple concurrent tests in the same object directory is still not supported though as the scratch directory and .bad and .notrun files still interfere with each other. Also not touched is the situation that /tmp/check.log and /tmp/check.sts are hard-coded (and thus unusable in concurrent tests). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rwxr-xr-xtests/qemu-iotests/0012
-rwxr-xr-xtests/qemu-iotests/0022
-rwxr-xr-xtests/qemu-iotests/0032
-rwxr-xr-xtests/qemu-iotests/0042
-rwxr-xr-xtests/qemu-iotests/0052
-rwxr-xr-xtests/qemu-iotests/0062
-rwxr-xr-xtests/qemu-iotests/0072
-rwxr-xr-xtests/qemu-iotests/0082
-rwxr-xr-xtests/qemu-iotests/0092
-rwxr-xr-xtests/qemu-iotests/0102
-rwxr-xr-xtests/qemu-iotests/0112
-rwxr-xr-xtests/qemu-iotests/0122
-rwxr-xr-xtests/qemu-iotests/0132
-rwxr-xr-xtests/qemu-iotests/0142
-rwxr-xr-xtests/qemu-iotests/0152
-rwxr-xr-xtests/qemu-iotests/0162
-rwxr-xr-xtests/qemu-iotests/0172
-rwxr-xr-xtests/qemu-iotests/0182
-rwxr-xr-xtests/qemu-iotests/0192
-rwxr-xr-xtests/qemu-iotests/0202
-rwxr-xr-xtests/qemu-iotests/0212
-rwxr-xr-xtests/qemu-iotests/0222
-rwxr-xr-xtests/qemu-iotests/0232
-rwxr-xr-xtests/qemu-iotests/0242
-rwxr-xr-xtests/qemu-iotests/0252
-rwxr-xr-xtests/qemu-iotests/0262
-rwxr-xr-xtests/qemu-iotests/0272
-rwxr-xr-xtests/qemu-iotests/0282
-rwxr-xr-xtests/qemu-iotests/0292
-rwxr-xr-xtests/qemu-iotests/0312
-rwxr-xr-xtests/qemu-iotests/0322
-rwxr-xr-xtests/qemu-iotests/0332
-rwxr-xr-xtests/qemu-iotests/0342
-rwxr-xr-xtests/qemu-iotests/0352
-rwxr-xr-xtests/qemu-iotests/0362
-rwxr-xr-xtests/qemu-iotests/0372
-rwxr-xr-xtests/qemu-iotests/0382
-rwxr-xr-xtests/qemu-iotests/0392
-rwxr-xr-xtests/qemu-iotests/0422
-rwxr-xr-xtests/qemu-iotests/0432
-rwxr-xr-xtests/qemu-iotests/0462
-rwxr-xr-xtests/qemu-iotests/0472
-rwxr-xr-xtests/qemu-iotests/0492
-rwxr-xr-xtests/qemu-iotests/0502
-rwxr-xr-xtests/qemu-iotests/0512
-rwxr-xr-xtests/qemu-iotests/0522
-rwxr-xr-xtests/qemu-iotests/0532
-rwxr-xr-xtests/qemu-iotests/0542
-rwxr-xr-xtests/qemu-iotests/0582
-rwxr-xr-xtests/qemu-iotests/0592
-rwxr-xr-xtests/qemu-iotests/0602
-rwxr-xr-xtests/qemu-iotests/0612
-rwxr-xr-xtests/qemu-iotests/0622
-rwxr-xr-xtests/qemu-iotests/0632
-rwxr-xr-xtests/qemu-iotests/0642
-rwxr-xr-xtests/qemu-iotests/0662
-rwxr-xr-xtests/qemu-iotests/0672
-rwxr-xr-xtests/qemu-iotests/0682
-rwxr-xr-xtests/qemu-iotests/0692
-rwxr-xr-xtests/qemu-iotests/0702
-rwxr-xr-xtests/qemu-iotests/0712
-rwxr-xr-xtests/qemu-iotests/0722
-rwxr-xr-xtests/qemu-iotests/0732
-rwxr-xr-xtests/qemu-iotests/0752
-rwxr-xr-xtests/qemu-iotests/0762
-rwxr-xr-xtests/qemu-iotests/0772
-rwxr-xr-xtests/qemu-iotests/0782
-rwxr-xr-xtests/qemu-iotests/0792
-rwxr-xr-xtests/qemu-iotests/0802
-rwxr-xr-xtests/qemu-iotests/0812
-rwxr-xr-xtests/qemu-iotests/0822
-rwxr-xr-xtests/qemu-iotests/0832
-rwxr-xr-xtests/qemu-iotests/0842
-rwxr-xr-xtests/qemu-iotests/0862
-rwxr-xr-xtests/qemu-iotests/0872
-rwxr-xr-xtests/qemu-iotests/0882
-rwxr-xr-xtests/qemu-iotests/0892
-rwxr-xr-xtests/qemu-iotests/0902
-rwxr-xr-xtests/qemu-iotests/0922
-rwxr-xr-xtests/qemu-iotests/check9
-rw-r--r--tests/qemu-iotests/common.rc7
81 files changed, 89 insertions, 85 deletions
diff --git a/tests/qemu-iotests/001 b/tests/qemu-iotests/001
index 4e1646941b..6472c67181 100755
--- a/tests/qemu-iotests/001
+++ b/tests/qemu-iotests/001
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/002 b/tests/qemu-iotests/002
index 6a865aac73..112280a469 100755
--- a/tests/qemu-iotests/002
+++ b/tests/qemu-iotests/002
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/003 b/tests/qemu-iotests/003
index 98638d4ce7..f60b6d7f41 100755
--- a/tests/qemu-iotests/003
+++ b/tests/qemu-iotests/003
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/004 b/tests/qemu-iotests/004
index 651072ef89..d8783519f6 100755
--- a/tests/qemu-iotests/004
+++ b/tests/qemu-iotests/004
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
index ba1236dfbf..e18d1c5bf9 100755
--- a/tests/qemu-iotests/005
+++ b/tests/qemu-iotests/005
@@ -28,7 +28,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/006 b/tests/qemu-iotests/006
index 0c0cf5d32f..84589b772f 100755
--- a/tests/qemu-iotests/006
+++ b/tests/qemu-iotests/006
@@ -26,7 +26,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/007 b/tests/qemu-iotests/007
index fe1a743806..bbbe0fcbb4 100755
--- a/tests/qemu-iotests/007
+++ b/tests/qemu-iotests/007
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/008 b/tests/qemu-iotests/008
index 2d28efd428..c0e67745e2 100755
--- a/tests/qemu-iotests/008
+++ b/tests/qemu-iotests/008
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/009 b/tests/qemu-iotests/009
index 57a43f5a16..2cf52f77ce 100755
--- a/tests/qemu-iotests/009
+++ b/tests/qemu-iotests/009
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/010 b/tests/qemu-iotests/010
index 896a0058ff..e9c32e1f3e 100755
--- a/tests/qemu-iotests/010
+++ b/tests/qemu-iotests/010
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/011 b/tests/qemu-iotests/011
index 1c5158af43..da7fc701ac 100755
--- a/tests/qemu-iotests/011
+++ b/tests/qemu-iotests/011
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/012 b/tests/qemu-iotests/012
index 7c5b6892d3..d1d59b1381 100755
--- a/tests/qemu-iotests/012
+++ b/tests/qemu-iotests/012
@@ -27,7 +27,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/013 b/tests/qemu-iotests/013
index ea3cab91d6..6943933d19 100755
--- a/tests/qemu-iotests/013
+++ b/tests/qemu-iotests/013
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/014 b/tests/qemu-iotests/014
index b23c2db9b6..2398864ec7 100755
--- a/tests/qemu-iotests/014
+++ b/tests/qemu-iotests/014
@@ -27,7 +27,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/015 b/tests/qemu-iotests/015
index 099d75723c..ea96464506 100755
--- a/tests/qemu-iotests/015
+++ b/tests/qemu-iotests/015
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/016 b/tests/qemu-iotests/016
index 7ea9e94b5d..f1864b727b 100755
--- a/tests/qemu-iotests/016
+++ b/tests/qemu-iotests/016
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017
index 3af3cdfbc3..4f46bb7f70 100755
--- a/tests/qemu-iotests/017
+++ b/tests/qemu-iotests/017
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018
index d8a7d435ab..8da230454a 100755
--- a/tests/qemu-iotests/018
+++ b/tests/qemu-iotests/018
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
index f5ecbf5451..537912fcbc 100755
--- a/tests/qemu-iotests/019
+++ b/tests/qemu-iotests/019
@@ -27,7 +27,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index 2f258dc6e9..e190043701 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/021 b/tests/qemu-iotests/021
index 1c69024ccb..66089d7a18 100755
--- a/tests/qemu-iotests/021
+++ b/tests/qemu-iotests/021
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/022 b/tests/qemu-iotests/022
index d35b8162be..df6c537963 100755
--- a/tests/qemu-iotests/022
+++ b/tests/qemu-iotests/022
@@ -27,7 +27,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/023 b/tests/qemu-iotests/023
index 9ad06b990e..76692ef14e 100755
--- a/tests/qemu-iotests/023
+++ b/tests/qemu-iotests/023
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024
index 9bf99e198a..b75dcf28dd 100755
--- a/tests/qemu-iotests/024
+++ b/tests/qemu-iotests/024
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/025 b/tests/qemu-iotests/025
index a5f45b454c..528d822a1c 100755
--- a/tests/qemu-iotests/025
+++ b/tests/qemu-iotests/025
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026
index df2884ba51..8be5d422b9 100755
--- a/tests/qemu-iotests/026
+++ b/tests/qemu-iotests/026
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/027 b/tests/qemu-iotests/027
index 3fa81b83bb..5feba32637 100755
--- a/tests/qemu-iotests/027
+++ b/tests/qemu-iotests/027
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index a1f4423d4a..ee1272d252 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -28,7 +28,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029
index fa46ace67b..2de8ec521b 100755
--- a/tests/qemu-iotests/029
+++ b/tests/qemu-iotests/029
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/031 b/tests/qemu-iotests/031
index 2a77ba8cbb..4ce2be301a 100755
--- a/tests/qemu-iotests/031
+++ b/tests/qemu-iotests/031
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/032 b/tests/qemu-iotests/032
index b1ba5c3218..60523b8141 100755
--- a/tests/qemu-iotests/032
+++ b/tests/qemu-iotests/032
@@ -27,7 +27,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033
index ea3351c3e7..00ee111dfe 100755
--- a/tests/qemu-iotests/033
+++ b/tests/qemu-iotests/033
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/034 b/tests/qemu-iotests/034
index 69c7858586..539d0c7d22 100755
--- a/tests/qemu-iotests/034
+++ b/tests/qemu-iotests/034
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/035 b/tests/qemu-iotests/035
index ebe9b8c925..6778c70f48 100755
--- a/tests/qemu-iotests/035
+++ b/tests/qemu-iotests/035
@@ -26,7 +26,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/036 b/tests/qemu-iotests/036
index 392f1ef3e6..65c6b66c0e 100755
--- a/tests/qemu-iotests/036
+++ b/tests/qemu-iotests/036
@@ -28,7 +28,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037
index 9171d8c8a6..aa5f8f33cc 100755
--- a/tests/qemu-iotests/037
+++ b/tests/qemu-iotests/037
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/038 b/tests/qemu-iotests/038
index cfaf00a783..817ea4eced 100755
--- a/tests/qemu-iotests/038
+++ b/tests/qemu-iotests/038
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index 84c9167660..d34968b408 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -28,7 +28,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/042 b/tests/qemu-iotests/042
index 94ce3a9cc3..674e529dee 100755
--- a/tests/qemu-iotests/042
+++ b/tests/qemu-iotests/042
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043
index b316b97c0c..dcceaf6fd0 100755
--- a/tests/qemu-iotests/043
+++ b/tests/qemu-iotests/043
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046
index e0be46cf2b..740ed48493 100755
--- a/tests/qemu-iotests/046
+++ b/tests/qemu-iotests/046
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/047 b/tests/qemu-iotests/047
index c35cd096b8..6bc0b788c8 100755
--- a/tests/qemu-iotests/047
+++ b/tests/qemu-iotests/047
@@ -26,7 +26,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/049 b/tests/qemu-iotests/049
index 93aa0ea55f..e8880a95eb 100755
--- a/tests/qemu-iotests/049
+++ b/tests/qemu-iotests/049
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050
index 07802bc49c..5ed97cfdad 100755
--- a/tests/qemu-iotests/050
+++ b/tests/qemu-iotests/050
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index a41334e022..3d67f906c2 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/052 b/tests/qemu-iotests/052
index 6bdae92780..b849f1b972 100755
--- a/tests/qemu-iotests/052
+++ b/tests/qemu-iotests/052
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/053 b/tests/qemu-iotests/053
index e589e5f126..9fb1e9320b 100755
--- a/tests/qemu-iotests/053
+++ b/tests/qemu-iotests/053
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/054 b/tests/qemu-iotests/054
index bd94153d66..316b8a2d3a 100755
--- a/tests/qemu-iotests/054
+++ b/tests/qemu-iotests/054
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058
index 14584cdea2..5602bffafd 100755
--- a/tests/qemu-iotests/058
+++ b/tests/qemu-iotests/058
@@ -27,7 +27,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
nbd_unix_socket=$TEST_DIR/test_qemu_nbd_socket
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index 3c053c29b4..82d94d3754 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index 830386fdaa..b79578fce6 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -25,7 +25,7 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
index ab98def6d4..49c08ef71c 100755
--- a/tests/qemu-iotests/061
+++ b/tests/qemu-iotests/061
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/062 b/tests/qemu-iotests/062
index 0511246dee..06bcfe5d65 100755
--- a/tests/qemu-iotests/062
+++ b/tests/qemu-iotests/062
@@ -26,7 +26,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063
index a47493a076..43d37d66bc 100755
--- a/tests/qemu-iotests/063
+++ b/tests/qemu-iotests/063
@@ -26,7 +26,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/064 b/tests/qemu-iotests/064
index 1c74c31a1a..be791c7ee7 100755
--- a/tests/qemu-iotests/064
+++ b/tests/qemu-iotests/064
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/066 b/tests/qemu-iotests/066
index 1c2452b0c5..e079845b94 100755
--- a/tests/qemu-iotests/066
+++ b/tests/qemu-iotests/066
@@ -25,7 +25,7 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
index d025192c83..d3ac7d75dd 100755
--- a/tests/qemu-iotests/067
+++ b/tests/qemu-iotests/067
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
# get standard environment, filters and checks
diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068
index b72e55599b..9fa5ef2b3a 100755
--- a/tests/qemu-iotests/068
+++ b/tests/qemu-iotests/068
@@ -25,7 +25,7 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/069 b/tests/qemu-iotests/069
index e661598c4a..c41312aa60 100755
--- a/tests/qemu-iotests/069
+++ b/tests/qemu-iotests/069
@@ -25,7 +25,7 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070
index ea0dae7e9c..ef1b28f988 100755
--- a/tests/qemu-iotests/070
+++ b/tests/qemu-iotests/070
@@ -26,7 +26,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071
index 3924e51f51..a6fd2a2c16 100755
--- a/tests/qemu-iotests/071
+++ b/tests/qemu-iotests/071
@@ -25,7 +25,7 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/072 b/tests/qemu-iotests/072
index 58faa8b5a7..61ad7f495c 100755
--- a/tests/qemu-iotests/072
+++ b/tests/qemu-iotests/072
@@ -25,7 +25,7 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/073 b/tests/qemu-iotests/073
index 392db54999..d8b61a668f 100755
--- a/tests/qemu-iotests/073
+++ b/tests/qemu-iotests/073
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/075 b/tests/qemu-iotests/075
index 40032c563d..c835a02630 100755
--- a/tests/qemu-iotests/075
+++ b/tests/qemu-iotests/075
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/076 b/tests/qemu-iotests/076
index b614a7dd6e..3950e5a31a 100755
--- a/tests/qemu-iotests/076
+++ b/tests/qemu-iotests/076
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/077 b/tests/qemu-iotests/077
index 4dd1bdde20..d6e5dcb2e7 100755
--- a/tests/qemu-iotests/077
+++ b/tests/qemu-iotests/077
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/078 b/tests/qemu-iotests/078
index d4d6da7b09..88cc7d42df 100755
--- a/tests/qemu-iotests/078
+++ b/tests/qemu-iotests/078
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/079 b/tests/qemu-iotests/079
index 2142bbb377..df546edc1a 100755
--- a/tests/qemu-iotests/079
+++ b/tests/qemu-iotests/079
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080
index 6b3a3e77a5..d470d8ae94 100755
--- a/tests/qemu-iotests/080
+++ b/tests/qemu-iotests/080
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081
index 7ae4be2053..5f688a36e6 100755
--- a/tests/qemu-iotests/081
+++ b/tests/qemu-iotests/081
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082
index f6eb75f624..eeab7f7af6 100755
--- a/tests/qemu-iotests/082
+++ b/tests/qemu-iotests/082
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/083 b/tests/qemu-iotests/083
index 991a9d91db..4d8116039d 100755
--- a/tests/qemu-iotests/083
+++ b/tests/qemu-iotests/083
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
# get standard environment, filters and checks
diff --git a/tests/qemu-iotests/084 b/tests/qemu-iotests/084
index ae33c2cba4..bbd06b11dc 100755
--- a/tests/qemu-iotests/084
+++ b/tests/qemu-iotests/084
@@ -26,7 +26,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/086 b/tests/qemu-iotests/086
index d9a80cf863..763fc67c1b 100755
--- a/tests/qemu-iotests/086
+++ b/tests/qemu-iotests/086
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/087 b/tests/qemu-iotests/087
index 82c56b1394..b5e8d7c722 100755
--- a/tests/qemu-iotests/087
+++ b/tests/qemu-iotests/087
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
# get standard environment, filters and checks
diff --git a/tests/qemu-iotests/088 b/tests/qemu-iotests/088
index c09adf8023..5b05f3ee38 100755
--- a/tests/qemu-iotests/088
+++ b/tests/qemu-iotests/088
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/089 b/tests/qemu-iotests/089
index dffc977e1c..0e2dd91a78 100755
--- a/tests/qemu-iotests/089
+++ b/tests/qemu-iotests/089
@@ -25,7 +25,7 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/090 b/tests/qemu-iotests/090
index 8d032f8111..2cffc46889 100755
--- a/tests/qemu-iotests/090
+++ b/tests/qemu-iotests/090
@@ -25,7 +25,7 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/092 b/tests/qemu-iotests/092
index a8c0c9ca2b..7f55083a8a 100755
--- a/tests/qemu-iotests/092
+++ b/tests/qemu-iotests/092
@@ -25,7 +25,7 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 8ca40116d7..8e1061eb7c 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -19,7 +19,6 @@
# Control script for QA
#
-tmp=/tmp/$$
status=0
needwrap=true
try=0
@@ -121,6 +120,10 @@ then
_init_error "failed to source common.rc"
fi
+# Temporary directory to store test results, will be removed by _wrapup
+QEMU_IOTESTS_TMPDIR=$(mktemp -d --tmpdir qemu-iotests.XXXXXXXX)
+tmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$
+
# we need common
. "$source_iotests/common"
@@ -197,9 +200,8 @@ END { if (NR > 0) {
needwrap=false
fi
- rm -f /tmp/*.out /tmp/*.err /tmp/*.time
rm -f /tmp/check.pid /tmp/check.sts
- rm -f $tmp.*
+ rm -rf "$QEMU_IOTESTS_TMPDIR"
}
trap "_wrapup; exit \$status" 0 1 2 3 15
@@ -349,6 +351,7 @@ do
fi
fi
fi
+ rm -f "$tmp.out"
fi
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 9c49deb3dd..51762c2d53 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -72,11 +72,12 @@ fi
function valgrind_qemu_io()
{
- valgrind --log-file=/tmp/$$.valgrind --error-exitcode=99 $REAL_QEMU_IO "$@"
+ local vgtmp=${QEMU_IOTESTS_TMPDIR:-/tmp}/$$.valgrind
+ valgrind --log-file="$vgtmp" --error-exitcode=99 $REAL_QEMU_IO "$@"
if [ $? != 0 ]; then
- cat /tmp/$$.valgrind
+ cat "$vgtmp"
fi
- rm -f /tmp/$$.valgrind
+ rm -f "$vgtmp"
}