Skip to contentSkip to conversation

qemu-iotests: don't use /tmp

PATCH In review Sascha Silbe 2 participants 11 messages Apr 12, 2016 – Apr 14, 2016

lore
Share & tools
lore
#3 lore raw

PATCH 2/4 qemu-iotests: common.rc: drop unused _do()

In reply to Sascha Silbe

_do() was never used and possibly creates temporary files at predictable, world-writable locations. Get rid of it.

---
 tests/qemu-iotests/common.rc | 46 --------------------------------------------
 1 file changed, 46 deletions(-)
tests/qemu-iotests/common.rc +0 -46
index d9913f8..5249ec5 100644
@@ -287,52 +287,6 @@ _need_to_be_root()
     fi
 }
 
-
-# Do a command, log it to $seq.full, optionally test return status
-# and die if command fails. If called with one argument _do executes the
-# command, logs it, and returns its exit status. With two arguments _do
-# first prints the message passed in the first argument, and then "done"
-# or "fail" depending on the return status of the command passed in the
-# second argument. If the command fails and the variable _do_die_on_error
-# is set to "always" or the two argument form is used and _do_die_on_error
-# is set to "message_only" _do will print an error message to
-# $seq.out and exit.
-
-_do()
-{
-    if [ $# -eq 1 ]; then
-        _cmd=$1
-    elif [ $# -eq 2 ]; then
-        _note=$1
-        _cmd=$2
-        echo -n "$_note... "
-    else
-        echo "Usage: _do [note] cmd" 1>&2
-        status=1; exit
-    fi
-
-    (eval "echo '---' \"$_cmd\"") >>"$OUTPUT_DIR/$seq.full"
-    (eval "$_cmd") >$tmp._out 2>&1; ret=$?
-    cat $tmp._out >>"$OUTPUT_DIR/$seq.full"
-    if [ $# -eq 2 ]; then
-        if [ $ret -eq 0 ]; then
-            echo "done"
-        else
-            echo "fail"
-        fi
-    fi
-    if [ $ret -ne 0  ] \
-        && [ "$_do_die_on_error" = "always" \
-            -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
-    then
-        [ $# -ne 2 ] && echo
-        eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
-        status=1; exit
-    fi
-
-    return $ret
-}
-
 # bail out, setting up .notrun file
 #
 _notrun()
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/4 qemu-iotests: drop unused _within_tolerance() filter

In reply to Sascha Silbe

_within_tolerance() isn't used anymore and possibly creates temporary files at predictable, world-writable locations. Get rid of it.

If it's needed again in the future it can be revived easily and fixed up to use TEST_DIR and / or safely created temporary files.

---
 tests/qemu-iotests/common.filter | 101 ---------------------------------------
 1 file changed, 101 deletions(-)
tests/qemu-iotests/common.filter +0 -101
index 84b7434..8a6e1b5 100644
@@ -19,107 +19,6 @@
 # standard filters
 #
 
-# Checks that given_value is in range of correct_value +/- tolerance.
-# Tolerance can be an absolute value or a percentage of the correct value
-# (see examples with tolerances below).
-# Outputs suitable message to stdout if it's not in range.
-#
-# A verbose option, -v, may be used as the LAST argument
-#
-# e.g.
-# foo: 0.0298 = 0.03 +/- 5%
-# _within_tolerance "foo" 0.0298 0.03 5%
-#
-# foo: 0.0298 = 0.03 +/- 0.01
-# _within_tolerance "foo" 0.0298 0.03 0.01
-#
-# foo: 0.0298 = 0.03 -0.01 +0.002
-# _within_tolerance "foo" 0.0298 0.03 0.01 0.002
-#
-# foo: verbose output of 0.0298 = 0.03 +/- 5%
-# _within_tolerance "foo" 0.0298 0.03 5% -v
-_within_tolerance()
-{
-  _name=$1
-  _given_val=$2
-  _correct_val=$3
-  _mintol=$4
-  _maxtol=$_mintol
-  _verbose=0
-  _debug=false
-
-  # maxtol arg is optional
-  # verbose arg is optional
-  if [ $# -ge 5 ]
-  then
-     if [ "$5" = "-v" ]
-     then
-        _verbose=1
-     else
-        _maxtol=$5
-     fi
-  fi
-  if [ $# -ge 6 ]
-  then
-     [ "$6" = "-v" ] && _verbose=1
-  fi
-
-  # find min with or without %
-  _mintolerance=`echo $_mintol | sed -e 's/%//'`
-  if [ $_mintol = $_mintolerance ]
-  then
-      _min=`echo "scale=5; $_correct_val-$_mintolerance" | bc`
-  else
-      _min=`echo "scale=5; $_correct_val-$_mintolerance*0.01*$_correct_val" | bc`
-  fi
-
-  # find max with or without %
-  _maxtolerance=`echo $_maxtol | sed -e 's/%//'`
-  if [ $_maxtol = $_maxtolerance ]
-  then
-      _max=`echo "scale=5; $_correct_val+$_maxtolerance" | bc`
-  else
-      _max=`echo "scale=5; $_correct_val+$_maxtolerance*0.01*$_correct_val" | bc`
-  fi
-
-  $_debug && echo "min = $_min"
-  $_debug && echo "max = $_max"
-
-  cat <<EOF >$tmp.bc.1
-scale=5;
-if ($_min <= $_given_val) 1;
-if ($_min > $_given_val) 0;
-EOF
-
-  cat <<EOF >$tmp.bc.2
-scale=5;
-if ($_given_val <= $_max) 1;
-if ($_given_val > $_max) 0;
-EOF
-
-  _above_min=`bc <$tmp.bc.1`
-  _below_max=`bc <$tmp.bc.2`
-
-  rm -f $tmp.bc.[12]
-
-  _in_range=`expr $_above_min \& $_below_max`
-
-  # fix up min, max precision for output
-  # can vary for 5.3, 6.2
-  _min=`echo $_min | sed -e 's/0*$//'` # get rid of trailling zeroes
-  _max=`echo $_max | sed -e 's/0*$//'` # get rid of trailling zeroes
-
-  if [ $_in_range -eq 1 ]
-  then
-        [ $_verbose -eq 1 ] && echo $_name is in range
-        return 0
-  else
-        [ $_verbose -eq 1 ] && echo $_name has value of $_given_val
-        [ $_verbose -eq 1 ] && echo $_name is NOT in range $_min .. $_max
-        return 1
-  fi
-}
-
 # ctime(3) dates
 #
 _filter_date()
Signature · 1 line
1.9.1
#7 lore raw

PATCH 4/4 qemu-iotests: place valgrind log file in scratch dir

In reply to Sascha Silbe

Do not place the valgrind log file at a predictable path in a world-writable location. Use the common scratch directory (${TEST_DIR}) instead.

---
 tests/qemu-iotests/common.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/common.config +1 -1
index 60bfabf..f824651 100644
@@ -122,7 +122,7 @@ _qemu_img_wrapper()
 
 _qemu_io_wrapper()
 {
-    local VALGRIND_LOGFILE=/tmp/$$.valgrind
+    local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
     local RETVAL
     (
         if [ "${VALGRIND_QEMU}" == "y" ]; then
Signature · 1 line
1.9.1
#5 lore raw

PATCH 3/4 qemu-iotests: tests: do not set unused tmp variable

In reply to Sascha Silbe

The previous commit removed the last usage of ${tmp} inside the tests themselves; the only remaining users are sourced by check. So we can now drop this variable from the tests.

---
 tests/qemu-iotests/001 | 1 -
 tests/qemu-iotests/002 | 1 -
 tests/qemu-iotests/003 | 1 -
 tests/qemu-iotests/004 | 1 -
 tests/qemu-iotests/005 | 1 -
 tests/qemu-iotests/007 | 1 -
 tests/qemu-iotests/008 | 1 -
 tests/qemu-iotests/009 | 1 -
 tests/qemu-iotests/010 | 1 -
 tests/qemu-iotests/011 | 1 -
 tests/qemu-iotests/012 | 1 -
 tests/qemu-iotests/013 | 1 -
 tests/qemu-iotests/014 | 1 -
 tests/qemu-iotests/015 | 1 -
 tests/qemu-iotests/017 | 1 -
 tests/qemu-iotests/018 | 1 -
 tests/qemu-iotests/019 | 1 -
 tests/qemu-iotests/020 | 1 -
 tests/qemu-iotests/021 | 1 -
 tests/qemu-iotests/022 | 1 -
 tests/qemu-iotests/023 | 1 -
 tests/qemu-iotests/024 | 1 -
 tests/qemu-iotests/025 | 1 -
 tests/qemu-iotests/026 | 1 -
 tests/qemu-iotests/027 | 1 -
 tests/qemu-iotests/028 | 1 -
 tests/qemu-iotests/029 | 1 -
 tests/qemu-iotests/031 | 1 -
 tests/qemu-iotests/032 | 1 -
 tests/qemu-iotests/033 | 1 -
 tests/qemu-iotests/034 | 1 -
 tests/qemu-iotests/035 | 1 -
 tests/qemu-iotests/036 | 1 -
 tests/qemu-iotests/037 | 1 -
 tests/qemu-iotests/038 | 1 -
 tests/qemu-iotests/039 | 1 -
 tests/qemu-iotests/042 | 1 -
 tests/qemu-iotests/043 | 1 -
 tests/qemu-iotests/046 | 1 -
 tests/qemu-iotests/047 | 1 -
 tests/qemu-iotests/049 | 1 -
 tests/qemu-iotests/050 | 1 -
 tests/qemu-iotests/051 | 1 -
 tests/qemu-iotests/052 | 1 -
 tests/qemu-iotests/053 | 1 -
 tests/qemu-iotests/054 | 1 -
 tests/qemu-iotests/058 | 1 -
 tests/qemu-iotests/059 | 1 -
 tests/qemu-iotests/060 | 1 -
 tests/qemu-iotests/061 | 1 -
 tests/qemu-iotests/062 | 1 -
 tests/qemu-iotests/063 | 1 -
 tests/qemu-iotests/064 | 1 -
 tests/qemu-iotests/066 | 1 -
 tests/qemu-iotests/067 | 1 -
 tests/qemu-iotests/068 | 1 -
 tests/qemu-iotests/069 | 1 -
 tests/qemu-iotests/070 | 1 -
 tests/qemu-iotests/071 | 1 -
 tests/qemu-iotests/072 | 1 -
 tests/qemu-iotests/073 | 1 -
 tests/qemu-iotests/075 | 1 -
 tests/qemu-iotests/076 | 1 -
 tests/qemu-iotests/077 | 1 -
 tests/qemu-iotests/078 | 1 -
 tests/qemu-iotests/079 | 1 -
 tests/qemu-iotests/080 | 1 -
 tests/qemu-iotests/081 | 1 -
 tests/qemu-iotests/082 | 1 -
 tests/qemu-iotests/083 | 1 -
 tests/qemu-iotests/084 | 1 -
 tests/qemu-iotests/086 | 1 -
 tests/qemu-iotests/087 | 1 -
 tests/qemu-iotests/088 | 1 -
 tests/qemu-iotests/089 | 1 -
 tests/qemu-iotests/090 | 1 -
 tests/qemu-iotests/092 | 1 -
 tests/qemu-iotests/094 | 1 -
 tests/qemu-iotests/097 | 1 -
 tests/qemu-iotests/098 | 1 -
 tests/qemu-iotests/099 | 1 -
 tests/qemu-iotests/100 | 1 -
 tests/qemu-iotests/101 | 1 -
 tests/qemu-iotests/102 | 1 -
 tests/qemu-iotests/103 | 1 -
 tests/qemu-iotests/104 | 1 -
 tests/qemu-iotests/105 | 1 -
 tests/qemu-iotests/107 | 1 -
 tests/qemu-iotests/108 | 1 -
 tests/qemu-iotests/109 | 1 -
 tests/qemu-iotests/110 | 1 -
 tests/qemu-iotests/111 | 1 -
 tests/qemu-iotests/112 | 1 -
 tests/qemu-iotests/113 | 1 -
 tests/qemu-iotests/114 | 1 -
 tests/qemu-iotests/115 | 1 -
 tests/qemu-iotests/116 | 1 -
 tests/qemu-iotests/117 | 1 -
 tests/qemu-iotests/119 | 1 -
 tests/qemu-iotests/120 | 1 -
 tests/qemu-iotests/121 | 1 -
 tests/qemu-iotests/122 | 1 -
 tests/qemu-iotests/123 | 1 -
 tests/qemu-iotests/128 | 1 -
 tests/qemu-iotests/130 | 1 -
 tests/qemu-iotests/131 | 1 -
 tests/qemu-iotests/133 | 1 -
 tests/qemu-iotests/134 | 1 -
 tests/qemu-iotests/135 | 1 -
 tests/qemu-iotests/137 | 1 -
 tests/qemu-iotests/138 | 1 -
 tests/qemu-iotests/140 | 1 -
 tests/qemu-iotests/141 | 1 -
 tests/qemu-iotests/142 | 1 -
 tests/qemu-iotests/143 | 1 -
 tests/qemu-iotests/145 | 1 -
 tests/qemu-iotests/150 | 1 -
 117 files changed, 117 deletions(-)
tests/qemu-iotests/001 +0 -1
index 4e16469..ffd14e2 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/002 +0 -1
index 6a865aa..d4f8e91 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/003 +0 -1
index 98638d4..19889b9 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/004 +0 -1
index 2ad77ed..67e1beb 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/005 +0 -1
index ba1236d..4447377 100755
@@ -28,7 +28,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/007 +0 -1
index 7b5aff5..fa543ee 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/008 +0 -1
index 2d28efd..8e89d74 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/009 +0 -1
index 57a43f5..16e4475 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/010 +0 -1
index 896a005..151dac2 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/011 +0 -1
index 1c5158a..f8d044e 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/012 +0 -1
index 7c5b689..d1d3f22 100755
@@ -27,7 +27,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/013 +0 -1
index ea3cab9..d013f87 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/014 +0 -1
index b23c2db..2ea79e8 100755
@@ -27,7 +27,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/015 +0 -1
index 6f26095..aaf9c3f 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/017 +0 -1
index 3af3cdf..e3f9e75 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/018 +0 -1
index 07b2de9..1d39d35 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/019 +0 -1
index 0937b5c..24a789a 100755
@@ -27,7 +27,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/020 +0 -1
index 6625b55..9c4a68c 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/021 +0 -1
index 1c69024..11e8ed7 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/022 +0 -1
index d35b816..2452a9f 100755
@@ -27,7 +27,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/023 +0 -1
index 9ad06b9..497ae1e 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/024 +0 -1
index 2c2d148..e0d77ce 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/025 +0 -1
index 467a4b7..c41370f 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/026 +0 -1
index ba1047c..f5a7f02 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/027 +0 -1
index 3fa81b8..08593da 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/028 +0 -1
index 4909b9b..7783e57 100755
@@ -28,7 +28,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/029 +0 -1
index b9cd826..e639ac0 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/031 +0 -1
index 2a77ba8..1e08abc 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/032 +0 -1
index b1ba5c3..24bcb52 100755
@@ -27,7 +27,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/033 +0 -1
index a61d8ce..75e9f20 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/034 +0 -1
index c769dd8..c711cfc 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/035 +0 -1
index ebe9b8c..efc38e4 100755
@@ -26,7 +26,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/036 +0 -1
index c4cc91b..ce638d6 100755
@@ -28,7 +28,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/037 +0 -1
index 5862451..c476b82 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/038 +0 -1
index 34fe698..d99a150 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/039 +0 -1
index 9e9b379..1f48339 100755
@@ -28,7 +28,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/042 +0 -1
index 94ce3a9..351b283 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/043 +0 -1
index b316b97..1c6c22d 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/046 +0 -1
index e0be46c..e528b67 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/047 +0 -1
index c35cd09..1b8f3d4 100755
@@ -26,7 +26,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/049 +0 -1
index 93aa0ea..fff0760 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/050 +0 -1
index 13006dd..03b4a5d 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/051 +0 -1
index 88b3d91..630cb7a 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/052 +0 -1
index 61959e2..4b64724 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/053 +0 -1
index e589e5f..2a04f5f 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/054 +0 -1
index bd94153..bf47ef9 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/058 +0 -1
index 63a6598..2253c6a 100755
@@ -27,7 +27,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 nbd_unix_socket=$TEST_DIR/test_qemu_nbd_socket
tests/qemu-iotests/059 +0 -1
index 0332bbb..6655aaf 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/060 +0 -1
index c81319c..8e95c45 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/061 +0 -1
index e191e65..f5678b1 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/062 +0 -1
index 0511246..051fb9f 100755
@@ -26,7 +26,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/063 +0 -1
index a47493a..352e78c 100755
@@ -26,7 +26,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/064 +0 -1
index 7564563..5792fbb 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/066 +0 -1
index 1c2452b..364166d 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/067 +0 -1
index 77dec0d..c1df48e 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 # get standard environment, filters and checks
tests/qemu-iotests/068 +0 -1
index 58d1d80..7a44ae0 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/069 +0 -1
index ce9e054..96e55ef 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/070 +0 -1
index d649ddf..8d08d74 100755
@@ -26,7 +26,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/071 +0 -1
index 92ab991..bdfd91f 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/072 +0 -1
index e4a723d..aa027c7 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/073 +0 -1
index 392db54..ad37a61 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/075 +0 -1
index 6117660..770d51c 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/076 +0 -1
index c9b55a9..ef9e6a4 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/077 +0 -1
index 8a7223f..4dc680b 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/078 +0 -1
index 7be2c3f..f333e9a 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/079 +0 -1
index ade6efa..b2e3f74 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/080 +0 -1
index a2c58ae..55044c7 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/081 +0 -1
index e4b4c6c..d89fabc 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/082 +0 -1
index c83e01e..ad1d9fa 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/083 +0 -1
index aa99278..bc724ae 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 # get standard environment, filters and checks
tests/qemu-iotests/084 +0 -1
index 733018d..04f2aa9 100755
@@ -26,7 +26,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/086 +0 -1
index 5527e86..cd4494a 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/087 +0 -1
index 27cbebc..e7bca37 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 # get standard environment, filters and checks
tests/qemu-iotests/088 +0 -1
index f9c3129..b8076f2 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/089 +0 -1
index 3e0038d..9bfe230 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/090 +0 -1
index 70b5a6f..7380503 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/092 +0 -1
index 52c529b..5bbdd07 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/094 +0 -1
index 57a68f8..0ba0b0c 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 trap "exit \$status" 0 1 2 3 15
tests/qemu-iotests/097 +0 -1
index c7a613b..01d8dd0 100755
@@ -26,7 +26,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/098 +0 -1
index e2230ad..b002e96 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/099 +0 -1
index 80f3d9a..caaf58e 100755
@@ -26,7 +26,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/100 +0 -1
index 7c1b235..5b2fb33 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/101 +0 -1
index 70fbf25..ea53f8b 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/102 +0 -1
index 161b197..64b4af9 100755
@@ -25,7 +25,6 @@ seq=$(basename $0)
 echo "QA output created by $seq"
 
 here=$PWD
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/103 +0 -1
index fa9a3c1..ecbd8eb 100755
@@ -25,7 +25,6 @@ seq=$(basename $0)
 echo "QA output created by $seq"
 
 here=$PWD
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/104 +0 -1
index 2e35ea8..726d467 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 trap "exit \$status" 0 1 2 3 15
tests/qemu-iotests/105 +0 -1
index 9bae49e..3db4ce3 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/107 +0 -1
index 9862030..d7222dc 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/108 +0 -1
index ce44749..2355d98 100755
@@ -26,7 +26,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/109 +0 -1
index 0b668da..f980b0c 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/110 +0 -1
index a687f95..9de7369 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/111 +0 -1
index 6011c94..a1c152d 100755
@@ -26,7 +26,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/112 +0 -1
index 34ba06a..28eb9aa 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/113 +0 -1
index a2cd96b..19b68b2 100755
@@ -26,7 +26,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/114 +0 -1
index d02e7ff..f110d4f 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/115 +0 -1
index a6be187..665c2ea 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/116 +0 -1
index 713ed48..df0172f 100755
@@ -28,7 +28,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/117 +0 -1
index 969750d..9385b3f 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/119 +0 -1
index cc6ec07..4f34fb4 100755
@@ -26,7 +26,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/120 +0 -1
index d899a3f..4f88a67 100755
@@ -26,7 +26,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/121 +0 -1
index 0912c3f..1307b4e 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/122 +0 -1
index 350ca9c..45b359c 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/123 +0 -1
index ad60803..b18e3fc 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/128 +0 -1
index 3d8107d..0976a18 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 devname="eiodev$$"
tests/qemu-iotests/130 +0 -1
index 9209992..ecc8a5b 100755
@@ -27,7 +27,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/131 +0 -1
index 4873f40..94a9ae7 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/133 +0 -1
index 8587102..9d35a6a 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/134 +0 -1
index 1c3820b..af618b8 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/135 +0 -1
index 16bf736..ce60831 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/137 +0 -1
index 9a6597c..e5e30de 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/138 +0 -1
index a5c3464..21650d8 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/140 +0 -1
index 05e4506..49f9df4 100755
@@ -29,7 +29,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/141 +0 -1
index f7c28b4..b2617e5 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/142 +0 -1
index 3828c23..29c0606 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/143 +0 -1
index 6207368..ec4ef22 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/145 +0 -1
index 7d8febb..1eca0e8 100755
@@ -25,7 +25,6 @@ seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
tests/qemu-iotests/150 +0 -1
index 97d2a35..0a7a44e 100755
@@ -25,7 +25,6 @@ seq="$(basename $0)"
 echo "QA output created by $seq"
 
 here="$PWD"
-tmp=/tmp/$$
 status=1	# failure is the default!
 
 _cleanup()
Signature · 1 line
1.9.1
#0 lore raw

cover qemu-iotests: don't use /tmp

During review of my other qemu-iotests fixes, Max Reitz noticed a couple of additional places where qemu-iotests hardcode /tmp. This is both a security issue and cumbersome when running multiple instances of qemu-iotests (e.g. different users on a shared development machine like tuxmaker). Fix them up.

Checked (/var)/tmp usage using "sudo chown 000 /tmp /var/tmp". "tac" and "qemu -snapshot" fail in that case. I'll presume they create the temporary files in a secure manner.

There is one place left that may use /var/tmp in theory; will address that in a separate patch.

This series mostly removes dead code and addresses a potential security issue, all of that in the test suite rather than in production code. It should be applicable even during hard freeze.

Sascha Silbe (4):
qemu-iotests: drop unused _within_tolerance() filter
qemu-iotests: common.rc: drop unused _do()
qemu-iotests: tests: do not set unused tmp variable
qemu-iotests: place valgrind log file in scratch dir

 tests/qemu-iotests/001           |   1 -
 tests/qemu-iotests/002           |   1 -
 tests/qemu-iotests/003           |   1 -
 tests/qemu-iotests/004           |   1 -
 tests/qemu-iotests/005           |   1 -
 tests/qemu-iotests/007           |   1 -
 tests/qemu-iotests/008           |   1 -
 tests/qemu-iotests/009           |   1 -
 tests/qemu-iotests/010           |   1 -
 tests/qemu-iotests/011           |   1 -
 tests/qemu-iotests/012           |   1 -
 tests/qemu-iotests/013           |   1 -
 tests/qemu-iotests/014           |   1 -
 tests/qemu-iotests/015           |   1 -
 tests/qemu-iotests/017           |   1 -
 tests/qemu-iotests/018           |   1 -
 tests/qemu-iotests/019           |   1 -
 tests/qemu-iotests/020           |   1 -
 tests/qemu-iotests/021           |   1 -
 tests/qemu-iotests/022           |   1 -
 tests/qemu-iotests/023           |   1 -
 tests/qemu-iotests/024           |   1 -
 tests/qemu-iotests/025           |   1 -
 tests/qemu-iotests/026           |   1 -
 tests/qemu-iotests/027           |   1 -
 tests/qemu-iotests/028           |   1 -
 tests/qemu-iotests/029           |   1 -
 tests/qemu-iotests/031           |   1 -
 tests/qemu-iotests/032           |   1 -
 tests/qemu-iotests/033           |   1 -
 tests/qemu-iotests/034           |   1 -
 tests/qemu-iotests/035           |   1 -
 tests/qemu-iotests/036           |   1 -
 tests/qemu-iotests/037           |   1 -
 tests/qemu-iotests/038           |   1 -
 tests/qemu-iotests/039           |   1 -
 tests/qemu-iotests/042           |   1 -
 tests/qemu-iotests/043           |   1 -
 tests/qemu-iotests/046           |   1 -
 tests/qemu-iotests/047           |   1 -
 tests/qemu-iotests/049           |   1 -
 tests/qemu-iotests/050           |   1 -
 tests/qemu-iotests/051           |   1 -
 tests/qemu-iotests/052           |   1 -
 tests/qemu-iotests/053           |   1 -
 tests/qemu-iotests/054           |   1 -
 tests/qemu-iotests/058           |   1 -
 tests/qemu-iotests/059           |   1 -
 tests/qemu-iotests/060           |   1 -
 tests/qemu-iotests/061           |   1 -
 tests/qemu-iotests/062           |   1 -
 tests/qemu-iotests/063           |   1 -
 tests/qemu-iotests/064           |   1 -
 tests/qemu-iotests/066           |   1 -
 tests/qemu-iotests/067           |   1 -
 tests/qemu-iotests/068           |   1 -
 tests/qemu-iotests/069           |   1 -
 tests/qemu-iotests/070           |   1 -
 tests/qemu-iotests/071           |   1 -
 tests/qemu-iotests/072           |   1 -
 tests/qemu-iotests/073           |   1 -
 tests/qemu-iotests/075           |   1 -
 tests/qemu-iotests/076           |   1 -
 tests/qemu-iotests/077           |   1 -
 tests/qemu-iotests/078           |   1 -
 tests/qemu-iotests/079           |   1 -
 tests/qemu-iotests/080           |   1 -
 tests/qemu-iotests/081           |   1 -
 tests/qemu-iotests/082           |   1 -
 tests/qemu-iotests/083           |   1 -
 tests/qemu-iotests/084           |   1 -
 tests/qemu-iotests/086           |   1 -
 tests/qemu-iotests/087           |   1 -
 tests/qemu-iotests/088           |   1 -
 tests/qemu-iotests/089           |   1 -
 tests/qemu-iotests/090           |   1 -
 tests/qemu-iotests/092           |   1 -
 tests/qemu-iotests/094           |   1 -
 tests/qemu-iotests/097           |   1 -
 tests/qemu-iotests/098           |   1 -
 tests/qemu-iotests/099           |   1 -
 tests/qemu-iotests/100           |   1 -
 tests/qemu-iotests/101           |   1 -
 tests/qemu-iotests/102           |   1 -
 tests/qemu-iotests/103           |   1 -
 tests/qemu-iotests/104           |   1 -
 tests/qemu-iotests/105           |   1 -
 tests/qemu-iotests/107           |   1 -
 tests/qemu-iotests/108           |   1 -
 tests/qemu-iotests/109           |   1 -
 tests/qemu-iotests/110           |   1 -
 tests/qemu-iotests/111           |   1 -
 tests/qemu-iotests/112           |   1 -
 tests/qemu-iotests/113           |   1 -
 tests/qemu-iotests/114           |   1 -
 tests/qemu-iotests/115           |   1 -
 tests/qemu-iotests/116           |   1 -
 tests/qemu-iotests/117           |   1 -
 tests/qemu-iotests/119           |   1 -
 tests/qemu-iotests/120           |   1 -
 tests/qemu-iotests/121           |   1 -
 tests/qemu-iotests/122           |   1 -
 tests/qemu-iotests/123           |   1 -
 tests/qemu-iotests/128           |   1 -
 tests/qemu-iotests/130           |   1 -
 tests/qemu-iotests/131           |   1 -
 tests/qemu-iotests/133           |   1 -
 tests/qemu-iotests/134           |   1 -
 tests/qemu-iotests/135           |   1 -
 tests/qemu-iotests/137           |   1 -
 tests/qemu-iotests/138           |   1 -
 tests/qemu-iotests/140           |   1 -
 tests/qemu-iotests/141           |   1 -
 tests/qemu-iotests/142           |   1 -
 tests/qemu-iotests/143           |   1 -
 tests/qemu-iotests/145           |   1 -
 tests/qemu-iotests/150           |   1 -
 tests/qemu-iotests/common.config |   2 +-
 tests/qemu-iotests/common.filter | 101 ---------------------------------------
 tests/qemu-iotests/common.rc     |  46 ------------------
 120 files changed, 1 insertion(+), 265 deletions(-)
Signature · 1 line
1.9.1
Reviewed-by on v1 1/4
#2 lore raw

Re: [Qemu-devel] [PATCH 1/4] qemu-iotests: drop unused _within_tolerance() filter

In reply to Sascha Silbe
Quoted 11 lines · Sascha Silbe

_within_tolerance() isn't used anymore and possibly creates temporary files at predictable, world-writable locations. Get rid of it.

If it's needed again in the future it can be revived easily and fixed up to use TEST_DIR and / or safely created temporary files.

---
 tests/qemu-iotests/common.filter | 101 ---------------------------------------
 1 file changed, 101 deletions(-)
Reviewed-by on v1 2/4
#4 lore raw

Re: [Qemu-devel] [PATCH 2/4] qemu-iotests: common.rc: drop unused _do()

In reply to Sascha Silbe
Quoted 8 lines · Sascha Silbe

_do() was never used and possibly creates temporary files at predictable, world-writable locations. Get rid of it.

---
 tests/qemu-iotests/common.rc | 46 --------------------------------------------
 1 file changed, 46 deletions(-)
Reviewed-by on v1 3/4
#6 lore raw

Re: [Qemu-devel] [PATCH 3/4] qemu-iotests: tests: do not set unused tmp variable

In reply to Sascha Silbe
Quoted 117 lines · Sascha Silbe

The previous commit removed the last usage of ${tmp} inside the tests themselves; the only remaining users are sourced by check. So we can now drop this variable from the tests.

---
 tests/qemu-iotests/001 | 1 -
 tests/qemu-iotests/002 | 1 -
 tests/qemu-iotests/003 | 1 -
 tests/qemu-iotests/004 | 1 -
 tests/qemu-iotests/005 | 1 -
 tests/qemu-iotests/007 | 1 -
 tests/qemu-iotests/008 | 1 -
 tests/qemu-iotests/009 | 1 -
 tests/qemu-iotests/010 | 1 -
 tests/qemu-iotests/011 | 1 -
 tests/qemu-iotests/012 | 1 -
 tests/qemu-iotests/013 | 1 -
 tests/qemu-iotests/014 | 1 -
 tests/qemu-iotests/015 | 1 -
 tests/qemu-iotests/017 | 1 -
 tests/qemu-iotests/018 | 1 -
 tests/qemu-iotests/019 | 1 -
 tests/qemu-iotests/020 | 1 -
 tests/qemu-iotests/021 | 1 -
 tests/qemu-iotests/022 | 1 -
 tests/qemu-iotests/023 | 1 -
 tests/qemu-iotests/024 | 1 -
 tests/qemu-iotests/025 | 1 -
 tests/qemu-iotests/026 | 1 -
 tests/qemu-iotests/027 | 1 -
 tests/qemu-iotests/028 | 1 -
 tests/qemu-iotests/029 | 1 -
 tests/qemu-iotests/031 | 1 -
 tests/qemu-iotests/032 | 1 -
 tests/qemu-iotests/033 | 1 -
 tests/qemu-iotests/034 | 1 -
 tests/qemu-iotests/035 | 1 -
 tests/qemu-iotests/036 | 1 -
 tests/qemu-iotests/037 | 1 -
 tests/qemu-iotests/038 | 1 -
 tests/qemu-iotests/039 | 1 -
 tests/qemu-iotests/042 | 1 -
 tests/qemu-iotests/043 | 1 -
 tests/qemu-iotests/046 | 1 -
 tests/qemu-iotests/047 | 1 -
 tests/qemu-iotests/049 | 1 -
 tests/qemu-iotests/050 | 1 -
 tests/qemu-iotests/051 | 1 -
 tests/qemu-iotests/052 | 1 -
 tests/qemu-iotests/053 | 1 -
 tests/qemu-iotests/054 | 1 -
 tests/qemu-iotests/058 | 1 -
 tests/qemu-iotests/059 | 1 -
 tests/qemu-iotests/060 | 1 -
 tests/qemu-iotests/061 | 1 -
 tests/qemu-iotests/062 | 1 -
 tests/qemu-iotests/063 | 1 -
 tests/qemu-iotests/064 | 1 -
 tests/qemu-iotests/066 | 1 -
 tests/qemu-iotests/067 | 1 -
 tests/qemu-iotests/068 | 1 -
 tests/qemu-iotests/069 | 1 -
 tests/qemu-iotests/070 | 1 -
 tests/qemu-iotests/071 | 1 -
 tests/qemu-iotests/072 | 1 -
 tests/qemu-iotests/073 | 1 -
 tests/qemu-iotests/075 | 1 -
 tests/qemu-iotests/076 | 1 -
 tests/qemu-iotests/077 | 1 -
 tests/qemu-iotests/078 | 1 -
 tests/qemu-iotests/079 | 1 -
 tests/qemu-iotests/080 | 1 -
 tests/qemu-iotests/081 | 1 -
 tests/qemu-iotests/082 | 1 -
 tests/qemu-iotests/083 | 1 -
 tests/qemu-iotests/084 | 1 -
 tests/qemu-iotests/086 | 1 -
 tests/qemu-iotests/087 | 1 -
 tests/qemu-iotests/088 | 1 -
 tests/qemu-iotests/089 | 1 -
 tests/qemu-iotests/090 | 1 -
 tests/qemu-iotests/092 | 1 -
 tests/qemu-iotests/094 | 1 -
 tests/qemu-iotests/097 | 1 -
 tests/qemu-iotests/098 | 1 -
 tests/qemu-iotests/099 | 1 -
 tests/qemu-iotests/100 | 1 -
 tests/qemu-iotests/101 | 1 -
 tests/qemu-iotests/102 | 1 -
 tests/qemu-iotests/103 | 1 -
 tests/qemu-iotests/104 | 1 -
 tests/qemu-iotests/105 | 1 -
 tests/qemu-iotests/107 | 1 -
 tests/qemu-iotests/108 | 1 -
 tests/qemu-iotests/109 | 1 -
 tests/qemu-iotests/110 | 1 -
 tests/qemu-iotests/111 | 1 -
 tests/qemu-iotests/112 | 1 -
 tests/qemu-iotests/113 | 1 -
 tests/qemu-iotests/114 | 1 -
 tests/qemu-iotests/115 | 1 -
 tests/qemu-iotests/116 | 1 -
 tests/qemu-iotests/117 | 1 -
 tests/qemu-iotests/119 | 1 -
 tests/qemu-iotests/120 | 1 -
 tests/qemu-iotests/121 | 1 -
 tests/qemu-iotests/122 | 1 -
 tests/qemu-iotests/123 | 1 -
 tests/qemu-iotests/128 | 1 -
 tests/qemu-iotests/130 | 1 -
 tests/qemu-iotests/131 | 1 -
 tests/qemu-iotests/133 | 1 -
 tests/qemu-iotests/134 | 1 -
 tests/qemu-iotests/135 | 1 -
 tests/qemu-iotests/137 | 1 -
Quoted 8 lines
 tests/qemu-iotests/138 | 1 -
 tests/qemu-iotests/140 | 1 -
 tests/qemu-iotests/141 | 1 -
 tests/qemu-iotests/142 | 1 -
 tests/qemu-iotests/143 | 1 -
 tests/qemu-iotests/145 | 1 -
 tests/qemu-iotests/150 | 1 -
 117 files changed, 117 deletions(-)
Reviewed-by on v1 4/4
#8 lore raw

Re: [Qemu-devel] [PATCH 4/4] qemu-iotests: place valgrind log file in scratch dir

In reply to Sascha Silbe
Quoted 9 lines · Sascha Silbe

Do not place the valgrind log file at a predictable path in a world-writable location. Use the common scratch directory (${TEST_DIR}) instead.

---
 tests/qemu-iotests/common.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#9 lore raw
In reply to Sascha Silbe
Quoted 18 lines · Sascha Silbe

During review of my other qemu-iotests fixes, Max Reitz noticed a couple of additional places where qemu-iotests hardcode /tmp. This is both a security issue and cumbersome when running multiple instances of qemu-iotests (e.g. different users on a shared development machine like tuxmaker). Fix them up.

Checked (/var)/tmp usage using "sudo chown 000 /tmp /var/tmp". "tac" and "qemu -snapshot" fail in that case. I'll presume they create the temporary files in a secure manner.

There is one place left that may use /var/tmp in theory; will address that in a separate patch.

This series mostly removes dead code and addresses a potential security issue, all of that in the test suite rather than in production code. It should be applicable even during hard freeze.

Quoted 5 lines

Sascha Silbe (4):
qemu-iotests: drop unused _within_tolerance() filter
qemu-iotests: common.rc: drop unused _do()
qemu-iotests: tests: do not set unused tmp variable
qemu-iotests: place valgrind log file in scratch dir

Thanks Sascha, I applied the series to my block tree:

https://github.com/XanClic/qemu/commits/block

Max

#10 lore raw

Dear Max,

Max Reitz <[email protected]> writes:

[...]

Quoted 1 line

Thanks Sascha, I applied the series to my block tree:

Thanks! I've just sent out the last patch from my local queue (fixing =/var/tmp= usage). Barring further discoveries during testing, I'm done for 2.6 now.

Sascha

Signature · 3 lines
Softwareentwicklung Sascha Silbe, Niederhofenstraße 5/1, 71229 Leonberg
https://se-silbe.de/
USt-IdNr. DE281696641