* [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests
@ 2017-09-12 14:44 Paolo Bonzini
2017-09-12 14:44 ` [Qemu-devel] [PATCH 01/10] qemu-iotests: remove dead code Paolo Bonzini
` (12 more replies)
0 siblings, 13 replies; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
The purpose of this series is to separate the "check" sources from
the tests. After these patches, common.config is reduced to simple
shell initialization, and common.rc is only included by the tests.
Along the way, a lot of dead code is removed too.
In v2, the following patches:
qemu-iotests: do not do useless search for QEMU_*_PROG
qemu-iotests: do not search for binaries in the current directory
qemu-iotests: include common.env and common.config early
have been replaced by "qemu-iotests: cleanup and fix search for programs",
which also preserves the behavior of searching for programs as symlinks
in the current directory.
Paolo
Paolo Bonzini (10):
qemu-iotests: remove dead code
qemu-iotests: get rid of AWK_PROG
qemu-iotests: move "check" code out of common.rc
qemu-iotests: cleanup and fix search for programs
qemu-iotests: limit non-_PROG-suffixed variables to common.rc
qemu-iotests: do not include common.rc in "check"
qemu-iotests: disintegrate more parts of common.config
qemu-iotests: fix uninitialized variable
qemu-iotests: get rid of $iam
qemu-iotests: merge "check" and "common"
tests/qemu-iotests/039.out | 10 +-
tests/qemu-iotests/061.out | 4 +-
tests/qemu-iotests/137.out | 2 +-
tests/qemu-iotests/check | 575 ++++++++++++++++++++++++++++++++++-----
tests/qemu-iotests/common | 459 -------------------------------
tests/qemu-iotests/common.config | 206 +-------------
tests/qemu-iotests/common.qemu | 1 +
tests/qemu-iotests/common.rc | 205 +++++++-------
8 files changed, 621 insertions(+), 841 deletions(-)
delete mode 100644 tests/qemu-iotests/common
--
2.13.5
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 01/10] qemu-iotests: remove dead code
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 20:34 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG Paolo Bonzini
` (11 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
This includes shell function, shell variables and command line options
(randomize.awk does not exist).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/check | 28 -----------------
tests/qemu-iotests/common | 23 --------------
tests/qemu-iotests/common.config | 26 ---------------
tests/qemu-iotests/common.rc | 68 ----------------------------------------
4 files changed, 145 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index d504b6e455..4a6ed67b42 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -65,7 +65,6 @@ then
export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
fi
-# if ./qemu exists, it should be prioritized and will be chosen by common.config
if [[ -z "$QEMU_PROG" && ! -x './qemu' ]]
then
arch=$(uname -m 2> /dev/null)
@@ -140,12 +139,6 @@ _timestamp()
_wrapup()
{
- # for hangcheck ...
- # remove files that were used by hangcheck
- #
- [ -f "${TEST_DIR}"/check.pid ] && rm -rf "${TEST_DIR}"/check.pid
- [ -f "${TEST_DIR}"/check.sts ] && rm -rf "${TEST_DIR}"/check.sts
-
if $showme
then
:
@@ -201,24 +194,6 @@ END { if (NR > 0) {
trap "_wrapup; exit \$status" 0 1 2 3 15
-# for hangcheck ...
-# Save pid of check in a well known place, so that hangcheck can be sure it
-# has the right pid (getting the pid from ps output is not reliable enough).
-#
-rm -rf "${TEST_DIR}"/check.pid
-echo $$ > "${TEST_DIR}"/check.pid
-
-# for hangcheck ...
-# Save the status of check in a well known place, so that hangcheck can be
-# sure to know where check is up to (getting test number from ps output is
-# not reliable enough since the trace stuff has been introduced).
-#
-rm -rf "${TEST_DIR}"/check.sts
-echo "preamble" > "${TEST_DIR}"/check.sts
-
-# don't leave old full output behind on a clean run
-rm -f check.full
-
[ -f $TIMESTAMP_FILE ] || touch $TIMESTAMP_FILE
FULL_IMGFMT_DETAILS=`_full_imgfmt_details`
@@ -276,9 +251,6 @@ do
fi
rm -f core $seq.notrun
- # for hangcheck ...
- echo "$seq" > "${TEST_DIR}"/check.sts
-
start=`_wallclock`
$timestamp && printf %s " [$(date "+%T")]"
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index d34c11c056..867918895b 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -19,17 +19,6 @@
# common procedures for QA scripts
#
-_setenvironment()
-{
- MSGVERB="text:action"
- export MSGVERB
-}
-
-rm -f "$OUTPUT_DIR/$iam.out"
-_setenvironment
-
-check=${check-true}
-
diff="diff -u"
verbose=false
debug=false
@@ -40,7 +29,6 @@ showme=false
sortme=false
expunge=true
have_test_arg=false
-randomize=false
cachemode=false
rm -f $tmp.list $tmp.tmp $tmp.sed
@@ -170,7 +158,6 @@ other options
-n show me, do not run tests
-o options -o options to pass to qemu-img create/convert
-T output timestamps
- -r randomize test order
-c mode cache mode
testlist options
@@ -327,11 +314,6 @@ testlist options
cachemode=true
xpand=false
;;
- -r) # randomize test order
- randomize=true
- xpand=false
- ;;
-
-T) # turn on timestamp output
timestamp=true
xpand=false
@@ -445,11 +427,6 @@ fi
list=`sort $tmp.list`
rm -f $tmp.list $tmp.tmp $tmp.sed
-if $randomize
-then
- list=`echo $list | awk -f randomize.awk`
-fi
-
[ "$QEMU" = "" ] && _fatal "qemu not found"
[ "$QEMU_IMG" = "" ] && _fatal "qemu-img not found"
[ "$QEMU_IO" = "" ] && _fatal "qemu-io not found"
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index e0883a0c65..b599c72211 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -15,33 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-#
-# setup and check for config parameters, and in particular
-#
-# EMAIL - email of the script runner.
-# TEST_DIR - scratch test directory
-#
-# - These can be added to $HOST_CONFIG_DIR (witch default to ./config)
-# below or a separate local configuration file can be used (using
-# the HOST_OPTIONS variable).
-# - This script is shared by the stress test system and the auto-qa
-# system (includes both regression test and benchmark components).
-# - this script shouldn't make any assertions about filesystem
-# validity or mountedness.
-#
-
# all tests should use a common language setting to prevent golden
# output mismatches.
export LANG=C
PATH=".:$PATH"
-HOST=`hostname -s 2> /dev/null`
HOSTOS=`uname -s`
-EMAIL=root@localhost # where auto-qa will send its status messages
-export HOST_OPTIONS=${HOST_OPTIONS:=local.config}
-export CHECK_OPTIONS=${CHECK_OPTIONS:="-g auto"}
export PWD=`pwd`
export _QEMU_HANDLE=0
@@ -78,11 +59,6 @@ _fatal()
export AWK_PROG="`set_prog_path awk`"
[ "$AWK_PROG" = "" ] && _fatal "awk not found"
-export SED_PROG="`set_prog_path sed`"
-[ "$SED_PROG" = "" ] && _fatal "sed not found"
-
-export PS_ALL_FLAGS="-ef"
-
if [ -z "$QEMU_PROG" ]; then
export QEMU_PROG="`set_prog_path qemu`"
fi
@@ -198,8 +174,6 @@ fi
export QEMU_DEFAULT_MACHINE="$default_machine"
-[ -f /etc/qemu-iotest.config ] && . /etc/qemu-iotest.config
-
if [ -z "$TEST_DIR" ]; then
TEST_DIR=`pwd`/scratch
fi
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 8d486dbeb4..5938d5145f 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -293,51 +293,6 @@ _img_info()
done
}
-_get_pids_by_name()
-{
- if [ $# -ne 1 ]
- then
- echo "Usage: _get_pids_by_name process-name" 1>&2
- exit 1
- fi
-
- # Algorithm ... all ps(1) variants have a time of the form MM:SS or
- # HH:MM:SS before the psargs field, use this as the search anchor.
- #
- # Matches with $1 (process-name) occur if the first psarg is $1
- # or ends in /$1 ... the matching uses sed's regular expressions,
- # so passing a regex into $1 will work.
-
- ps $PS_ALL_FLAGS \
- | sed -n \
- -e 's/$/ /' \
- -e 's/[ ][ ]*/ /g' \
- -e 's/^ //' \
- -e 's/^[^ ]* //' \
- -e "/[0-9]:[0-9][0-9] *[^ ]*\/$1 /s/ .*//p" \
- -e "/[0-9]:[0-9][0-9] *$1 /s/ .*//p"
-}
-
-# fqdn for localhost
-#
-_get_fqdn()
-{
- host=`hostname`
- $NSLOOKUP_PROG $host | $AWK_PROG '{ if ($1 == "Name:") print $2 }'
-}
-
-# check if run as root
-#
-_need_to_be_root()
-{
- id=`id | $SED_PROG -e 's/(.*//' -e 's/.*=//'`
- if [ "$id" -ne 0 ]
- then
- echo "Arrgh ... you need to be root (not uid=$id) to run this test"
- exit 1
- fi
-}
-
# bail out, setting up .notrun file
#
_notrun()
@@ -491,28 +446,5 @@ _full_platform_details()
echo "$os/$platform $host $kernel"
}
-_link_out_file()
-{
- if [ -z "$1" ]; then
- echo Error must pass \$seq.
- exit
- fi
- rm -f $1
- if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
- ln -s $1.irix $1
- elif [ "`uname`" == "Linux" ]; then
- ln -s $1.linux $1
- else
- echo Error test $seq does not run on the operating system: `uname`
- exit
- fi
-}
-
-_die()
-{
- echo $@
- exit 1
-}
-
# make sure this script returns success
true
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
2017-09-12 14:44 ` [Qemu-devel] [PATCH 01/10] qemu-iotests: remove dead code Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 16:30 ` Philippe Mathieu-Daudé
2017-09-12 20:45 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 03/10] qemu-iotests: move "check" code out of common.rc Paolo Bonzini
` (10 subsequent siblings)
12 siblings, 2 replies; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/check | 4 ++--
tests/qemu-iotests/common | 2 +-
tests/qemu-iotests/common.config | 3 ---
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 4a6ed67b42..5c0d0c51dc 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -128,7 +128,7 @@ tmp="${TEST_DIR}"/$$
_wallclock()
{
- date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }'
+ date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }'
}
_timestamp()
@@ -147,7 +147,7 @@ _wrapup()
if [ -f $TIMESTAMP_FILE -a -f $tmp.time ]
then
cat $TIMESTAMP_FILE $tmp.time \
- | $AWK_PROG '
+ | awk '
{ t[$1] = $2 }
END { if (NR > 0) {
for (i in t) print i " " t[i]
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index 867918895b..130f647a4d 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -366,7 +366,7 @@ testlist options
if $xpand
then
have_test_arg=true
- $AWK_PROG </dev/null '
+ awk </dev/null '
BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
| while read id
do
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index b599c72211..0f571d46eb 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -56,9 +56,6 @@ _fatal()
exit 1
}
-export AWK_PROG="`set_prog_path awk`"
-[ "$AWK_PROG" = "" ] && _fatal "awk not found"
-
if [ -z "$QEMU_PROG" ]; then
export QEMU_PROG="`set_prog_path qemu`"
fi
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 03/10] qemu-iotests: move "check" code out of common.rc
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
2017-09-12 14:44 ` [Qemu-devel] [PATCH 01/10] qemu-iotests: remove dead code Paolo Bonzini
2017-09-12 14:44 ` [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 21:03 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs Paolo Bonzini
` (9 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
Some functions in common.rc are never used by the tests. Move
them out of that file and into common, which is already included
only by "check".
Code that actually *is* common to "check" and tests can be placed in
common.config.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/common | 25 ++++++++++++++++++++++++-
tests/qemu-iotests/common.config | 12 ++++++++++++
tests/qemu-iotests/common.rc | 40 ----------------------------------------
3 files changed, 36 insertions(+), 41 deletions(-)
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index 130f647a4d..2e98e64d5c 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -19,6 +19,24 @@
# common procedures for QA scripts
#
+_full_imgfmt_details()
+{
+ if [ -n "$IMGOPTS" ]; then
+ echo "$IMGFMT ($IMGOPTS)"
+ else
+ echo "$IMGFMT"
+ fi
+}
+
+_full_platform_details()
+{
+ os=`uname -s`
+ host=`hostname -s`
+ kernel=`uname -r`
+ platform=`uname -m`
+ echo "$os/$platform $host $kernel"
+}
+
diff="diff -u"
verbose=false
debug=false
@@ -404,7 +422,12 @@ if [ "$IMGOPTSSYNTAX" != "true" ]; then
fi
# Set default options for qemu-img create -o if they were not specified
-_set_default_imgopts
+if [ "$IMGFMT" == "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=" > /dev/null); then
+ IMGOPTS=$(_optstr_add "$IMGOPTS" "compat=1.1")
+fi
+if [ "$IMGFMT" == "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=" > /dev/null); then
+ IMGOPTS=$(_optstr_add "$IMGOPTS" "iter-time=10")
+fi
if [ -s $tmp.list ]
then
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index 0f571d46eb..91da65f3dc 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -27,6 +27,9 @@ export PWD=`pwd`
export _QEMU_HANDLE=0
+# make sure we have a standard umask
+umask 022
+
# $1 = prog to look for, $2* = default pathnames if not found in $PATH
set_prog_path()
{
@@ -49,6 +52,15 @@ set_prog_path()
return 1
}
+_optstr_add()
+{
+ if [ -n "$1" ]; then
+ echo "$1,$2"
+ else
+ echo "$2"
+ fi
+}
+
_fatal()
{
echo "$*"
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 5938d5145f..6f6e03366f 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -50,9 +50,6 @@ then
fi
fi
-# make sure we have a standard umask
-umask 022
-
if [ "$IMGOPTSSYNTAX" = "true" ]; then
DRIVER="driver=$IMGFMT"
if [ "$IMGFMT" = "luks" ]; then
@@ -94,25 +91,6 @@ else
fi
ORIG_TEST_IMG="$TEST_IMG"
-_optstr_add()
-{
- if [ -n "$1" ]; then
- echo "$1,$2"
- else
- echo "$2"
- fi
-}
-
-_set_default_imgopts()
-{
- if [ "$IMGFMT" == "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=" > /dev/null); then
- IMGOPTS=$(_optstr_add "$IMGOPTS" "compat=1.1")
- fi
- if [ "$IMGFMT" == "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=" > /dev/null); then
- IMGOPTS=$(_optstr_add "$IMGOPTS" "iter-time=10")
- fi
-}
-
_use_sample_img()
{
SAMPLE_IMG_FILE="${1%\.bz2}"
@@ -428,23 +406,5 @@ _require_command()
[ -x "$c" ] || _notrun "$1 utility required, skipped this test"
}
-_full_imgfmt_details()
-{
- if [ -n "$IMGOPTS" ]; then
- echo "$IMGFMT ($IMGOPTS)"
- else
- echo "$IMGFMT"
- fi
-}
-
-_full_platform_details()
-{
- os=`uname -s`
- host=`hostname -s`
- kernel=`uname -r`
- platform=`uname -m`
- echo "$os/$platform $host $kernel"
-}
-
# make sure this script returns success
true
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (2 preceding siblings ...)
2017-09-12 14:44 ` [Qemu-devel] [PATCH 03/10] qemu-iotests: move "check" code out of common.rc Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 21:11 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc Paolo Bonzini
` (8 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
Instead of ./check failing when a binary is missing, we try each test
case now and each one fails with tons of test case diffs. Also, all the
variables were initialized by "check" prior to "common" being sourced,
and then (uselessly) checked for emptiness again in "check".
Centralize the search for programs in "common" (which will soon be
one with "check"), including the "realpath" invocation which can be done
just once in "check" rather than in the tests.
For qnio_server, move the detection to "common", simplifying
set_prog_path to stop handling the unused second argument, and
embedding the "realpath" pass.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/check | 41 ---------------------
tests/qemu-iotests/common | 77 +++++++++++++++++++++++++++++++++++++---
tests/qemu-iotests/common.config | 61 +------------------------------
3 files changed, 73 insertions(+), 106 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 5c0d0c51dc..b7c54390d3 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -60,47 +60,6 @@ fi
build_root="$build_iotests/../.."
-if [ -x "$build_iotests/socket_scm_helper" ]
-then
- export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
-fi
-
-if [[ -z "$QEMU_PROG" && ! -x './qemu' ]]
-then
- arch=$(uname -m 2> /dev/null)
-
- if [[ -n $arch && -x "$build_root/$arch-softmmu/qemu-system-$arch" ]]
- then
- export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
- else
- pushd "$build_root" > /dev/null
- for binary in *-softmmu/qemu-system-*
- do
- if [ -x "$binary" ]
- then
- export QEMU_PROG="$build_root/$binary"
- break
- fi
- done
- popd > /dev/null
- fi
-fi
-
-if [[ -z $QEMU_IMG_PROG && -x "$build_root/qemu-img" && ! -x './qemu-img' ]]
-then
- export QEMU_IMG_PROG="$build_root/qemu-img"
-fi
-
-if [[ -z $QEMU_IO_PROG && -x "$build_root/qemu-io" && ! -x './qemu-io' ]]
-then
- export QEMU_IO_PROG="$build_root/qemu-io"
-fi
-
-if [[ -z $QEMU_NBD_PROG && -x "$build_root/qemu-nbd" && ! -x './qemu-nbd' ]]
-then
- export QEMU_NBD_PROG="$build_root/qemu-nbd"
-fi
-
# we need common.env
if ! . "$build_iotests/common.env"
then
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index 2e98e64d5c..abacc24114 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -37,6 +37,17 @@ _full_platform_details()
echo "$os/$platform $host $kernel"
}
+# $1 = prog to look for
+set_prog_path()
+{
+ p=`command -v $1 2> /dev/null`
+ if [ -n "$p" -a -x "$p" ]; then
+ realpath -- "$(type -p "$p")"
+ else
+ return 1
+ fi
+}
+
diff="diff -u"
verbose=false
debug=false
@@ -450,10 +461,66 @@ fi
list=`sort $tmp.list`
rm -f $tmp.list $tmp.tmp $tmp.sed
-[ "$QEMU" = "" ] && _fatal "qemu not found"
-[ "$QEMU_IMG" = "" ] && _fatal "qemu-img not found"
-[ "$QEMU_IO" = "" ] && _fatal "qemu-io not found"
+if [ -z "$QEMU_PROG" ]
+then
+ if [ -x "$build_iotests/qemu" ]; then
+ export QEMU_PROG="$build_iotests/qemu"
+ elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then
+ export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
+ else
+ pushd "$build_root" > /dev/null
+ for binary in *-softmmu/qemu-system-*
+ do
+ if [ -x "$binary" ]
+ then
+ export QEMU_PROG="$build_root/$binary"
+ break
+ fi
+ done
+ popd > /dev/null
+ [ "$QEMU_PROG" = "" ] && _init_error "qemu not found"
+ fi
+fi
+export QEMU_PROG=$(realpath -- "$(type -p "$QEMU_PROG")")
+
+if [ -z "$QEMU_IMG_PROG" ]; then
+ if [ -x "$build_iotests/qemu-img" ]; then
+ export QEMU_IMG_PROG="$build_iotests/qemu-img"
+ elif [ -x "$build_root/qemu-img" ]; then
+ export QEMU_IMG_PROG="$build_root/qemu-img"
+ else
+ _init_error "qemu-img not found"
+ fi
+fi
+export QEMU_IMG_PROG=$(realpath -- "$(type -p "$QEMU_IMG_PROG")")
+
+if [ -z "$QEMU_IO_PROG" ]; then
+ if [ -x "$build_iotests/qemu-io" ]; then
+ export QEMU_IO_PROG="$build_iotests/qemu-io"
+ elif [ -x "$build_root/qemu-io" ]; then
+ export QEMU_IO_PROG="$build_root/qemu-io"
+ else
+ _init_error "qemu-io not found"
+ fi
+fi
+export QEMU_IO_PROG=$(realpath -- "$(type -p "$QEMU_IO_PROG")")
-if [ "$IMGPROTO" = "nbd" ] ; then
- [ "$QEMU_NBD" = "" ] && _fatal "qemu-nbd not found"
+if [ -z $QEMU_NBD_PROG ]; then
+ if [ -x "$build_iotests/qemu-nbd" ]; then
+ export QEMU_NBD_PROG="$build_iotests/qemu-nbd"
+ elif [ -x "$build_root/qemu-nbd" ]; then
+ export QEMU_NBD_PROG="$build_root/qemu-nbd"
+ else
+ _init_error "qemu-nbd not found"
+ fi
+fi
+export QEMU_NBD_PROG=$(realpath -- "$(type -p "$QEMU_NBD_PROG")")
+
+if [ -z "$QEMU_VXHS_PROG" ]; then
+ export QEMU_VXHS_PROG="`set_prog_path qnio_server`"
+fi
+
+if [ -x "$build_iotests/socket_scm_helper" ]
+then
+ export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
fi
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index 91da65f3dc..c97c63983f 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -22,6 +22,7 @@ export LANG=C
PATH=".:$PATH"
HOSTOS=`uname -s`
+arch=`uname -m`
export PWD=`pwd`
@@ -30,28 +31,6 @@ export _QEMU_HANDLE=0
# make sure we have a standard umask
umask 022
-# $1 = prog to look for, $2* = default pathnames if not found in $PATH
-set_prog_path()
-{
- p=`command -v $1 2> /dev/null`
- if [ -n "$p" -a -x "$p" ]; then
- echo $p
- return 0
- fi
- p=$1
-
- shift
- for f; do
- if [ -x $f ]; then
- echo $f
- return 0
- fi
- done
-
- echo ""
- return 1
-}
-
_optstr_add()
{
if [ -n "$1" ]; then
@@ -61,44 +40,6 @@ _optstr_add()
fi
}
-_fatal()
-{
- echo "$*"
- status=1
- exit 1
-}
-
-if [ -z "$QEMU_PROG" ]; then
- export QEMU_PROG="`set_prog_path qemu`"
-fi
-
-if [ -z "$QEMU_IMG_PROG" ]; then
- export QEMU_IMG_PROG="`set_prog_path qemu-img`"
-fi
-
-if [ -z "$QEMU_IO_PROG" ]; then
- export QEMU_IO_PROG="`set_prog_path qemu-io`"
-fi
-
-if [ -z "$QEMU_NBD_PROG" ]; then
- export QEMU_NBD_PROG="`set_prog_path qemu-nbd`"
-fi
-
-if [ -z "$QEMU_VXHS_PROG" ]; then
- export QEMU_VXHS_PROG="`set_prog_path qnio_server`"
-fi
-
-export QEMU_PROG=$(realpath -- "$(type -p "$QEMU_PROG")")
-export QEMU_IMG_PROG=$(realpath -- "$(type -p "$QEMU_IMG_PROG")")
-export QEMU_IO_PROG=$(realpath -- "$(type -p "$QEMU_IO_PROG")")
-export QEMU_NBD_PROG=$(realpath -- "$(type -p "$QEMU_NBD_PROG")")
-
-# This program is not built as part of qemu but (possibly) provided by the
-# system, so it may not be present at all
-if [ -n "$QEMU_VXHS_PROG" ]; then
- export QEMU_VXHS_PROG=$(realpath -- "$(type -p "$QEMU_VXHS_PROG")")
-fi
-
_qemu_wrapper()
{
(
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (3 preceding siblings ...)
2017-09-12 14:44 ` [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 21:15 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 06/10] qemu-iotests: do not include common.rc in "check" Paolo Bonzini
` (7 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
These are never used by "check", with one exception that does not need
$QEMU_OPTIONS. Keep them in common.rc, which will be soon included only
by the tests.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/039.out | 10 +++---
tests/qemu-iotests/061.out | 4 +--
tests/qemu-iotests/137.out | 2 +-
tests/qemu-iotests/common.config | 69 ++--------------------------------------
tests/qemu-iotests/common.rc | 65 +++++++++++++++++++++++++++++++++++++
5 files changed, 75 insertions(+), 75 deletions(-)
diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
index c6e0ac2da3..724d7b2508 100644
--- a/tests/qemu-iotests/039.out
+++ b/tests/qemu-iotests/039.out
@@ -11,7 +11,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -50,7 +50,7 @@ read 512/512 bytes at offset 0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -68,7 +68,7 @@ incompatible_features 0x0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -91,7 +91,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -105,7 +105,7 @@ Data may be corrupted, or further writes to the image may corrupt it.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
index a431b7f305..942485de99 100644
--- a/tests/qemu-iotests/061.out
+++ b/tests/qemu-iotests/061.out
@@ -57,7 +57,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -219,7 +219,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out
index c0e753483b..05efd74d17 100644
--- a/tests/qemu-iotests/137.out
+++ b/tests/qemu-iotests/137.out
@@ -31,7 +31,7 @@ Cache clean interval too big
Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index c97c63983f..c7f0a7a7e0 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -40,71 +40,6 @@ _optstr_add()
fi
}
-_qemu_wrapper()
-{
- (
- if [ -n "${QEMU_NEED_PID}" ]; then
- echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"
- fi
- exec "$QEMU_PROG" $QEMU_OPTIONS "$@"
- )
-}
-
-_qemu_img_wrapper()
-{
- (exec "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@")
-}
-
-_qemu_io_wrapper()
-{
- local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
- local QEMU_IO_ARGS="$QEMU_IO_OPTIONS"
- if [ "$IMGOPTSSYNTAX" = "true" ]; then
- QEMU_IO_ARGS="--image-opts $QEMU_IO_ARGS"
- if [ -n "$IMGKEYSECRET" ]; then
- QEMU_IO_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IO_ARGS"
- fi
- fi
- local RETVAL
- (
- if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
- else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
- fi
- )
- RETVAL=$?
- if [ "${VALGRIND_QEMU}" == "y" ]; then
- if [ $RETVAL == 99 ]; then
- cat "${VALGRIND_LOGFILE}"
- fi
- rm -f "${VALGRIND_LOGFILE}"
- fi
- (exit $RETVAL)
-}
-
-_qemu_nbd_wrapper()
-{
- (
- echo $BASHPID > "${QEMU_TEST_DIR}/qemu-nbd.pid"
- exec "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS "$@"
- )
-}
-
-_qemu_vxhs_wrapper()
-{
- (
- echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid"
- exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
- )
-}
-
-export QEMU=_qemu_wrapper
-export QEMU_IMG=_qemu_img_wrapper
-export QEMU_IO=_qemu_io_wrapper
-export QEMU_NBD=_qemu_nbd_wrapper
-export QEMU_VXHS=_qemu_vxhs_wrapper
-
QEMU_IMG_EXTRA_ARGS=
if [ "$IMGOPTSSYNTAX" = "true" ]; then
QEMU_IMG_EXTRA_ARGS="--image-opts $QEMU_IMG_EXTRA_ARGS"
@@ -115,8 +50,8 @@ fi
export QEMU_IMG_EXTRA_ARGS
-default_machine=$($QEMU -machine help | sed -n '/(default)/ s/ .*//p')
-default_alias_machine=$($QEMU -machine help | \
+default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
+default_alias_machine=$($QEMU_PROG -machine help | \
sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
if [[ "$default_alias_machine" ]]; then
default_machine="$default_alias_machine"
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 6f6e03366f..e7f74b4dbd 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -50,6 +50,71 @@ then
fi
fi
+_qemu_wrapper()
+{
+ (
+ if [ -n "${QEMU_NEED_PID}" ]; then
+ echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"
+ fi
+ exec "$QEMU_PROG" $QEMU_OPTIONS "$@"
+ )
+}
+
+_qemu_img_wrapper()
+{
+ (exec "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@")
+}
+
+_qemu_io_wrapper()
+{
+ local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
+ local QEMU_IO_ARGS="$QEMU_IO_OPTIONS"
+ if [ "$IMGOPTSSYNTAX" = "true" ]; then
+ QEMU_IO_ARGS="--image-opts $QEMU_IO_ARGS"
+ if [ -n "$IMGKEYSECRET" ]; then
+ QEMU_IO_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IO_ARGS"
+ fi
+ fi
+ local RETVAL
+ (
+ if [ "${VALGRIND_QEMU}" == "y" ]; then
+ exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
+ else
+ exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
+ fi
+ )
+ RETVAL=$?
+ if [ "${VALGRIND_QEMU}" == "y" ]; then
+ if [ $RETVAL == 99 ]; then
+ cat "${VALGRIND_LOGFILE}"
+ fi
+ rm -f "${VALGRIND_LOGFILE}"
+ fi
+ (exit $RETVAL)
+}
+
+_qemu_nbd_wrapper()
+{
+ (
+ echo $BASHPID > "${QEMU_TEST_DIR}/qemu-nbd.pid"
+ exec "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS "$@"
+ )
+}
+
+_qemu_vxhs_wrapper()
+{
+ (
+ echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid"
+ exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
+ )
+}
+
+export QEMU=_qemu_wrapper
+export QEMU_IMG=_qemu_img_wrapper
+export QEMU_IO=_qemu_io_wrapper
+export QEMU_NBD=_qemu_nbd_wrapper
+export QEMU_VXHS=_qemu_vxhs_wrapper
+
if [ "$IMGOPTSSYNTAX" = "true" ]; then
DRIVER="driver=$IMGFMT"
if [ "$IMGFMT" = "luks" ]; then
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 06/10] qemu-iotests: do not include common.rc in "check"
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (4 preceding siblings ...)
2017-09-12 14:44 ` [Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 21:16 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 07/10] qemu-iotests: disintegrate more parts of common.config Paolo Bonzini
` (6 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
It only provides functions used by the test programs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/check | 6 ------
tests/qemu-iotests/common.rc | 13 +++++--------
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index b7c54390d3..4cb5b05908 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -72,12 +72,6 @@ then
_init_error "failed to source common.config"
fi
-# we need common.rc
-if ! . "$source_iotests/common.rc"
-then
- _init_error "failed to source common.rc"
-fi
-
# we need common
. "$source_iotests/common"
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index e7f74b4dbd..20f6821a69 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -40,14 +40,11 @@ poke_file()
printf "$3" | dd "of=$1" bs=1 "seek=$2" conv=notrunc &>/dev/null
}
-# we need common.config
-if [ "$iam" != "check" ]
-then
- if ! . ./common.config
- then
- echo "$iam: failed to source common.config"
- exit 1
- fi
+
+if ! . ./common.config
+ then
+ echo "$iam: failed to source common.config"
+ exit 1
fi
_qemu_wrapper()
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 07/10] qemu-iotests: disintegrate more parts of common.config
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (5 preceding siblings ...)
2017-09-12 14:44 ` [Qemu-devel] [PATCH 06/10] qemu-iotests: do not include common.rc in "check" Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 21:25 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 08/10] qemu-iotests: fix uninitialized variable Paolo Bonzini
` (5 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
Split "check" parts from tests part.
For the directory setup, the actual computation of directories goes
in "check", while the sanity checks go in the tests.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/common | 24 ++++++++++++++++++++
tests/qemu-iotests/common.config | 49 ----------------------------------------
tests/qemu-iotests/common.qemu | 1 +
tests/qemu-iotests/common.rc | 25 ++++++++++++++++++++
4 files changed, 50 insertions(+), 49 deletions(-)
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index abacc24114..ee313af92f 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -48,6 +48,14 @@ set_prog_path()
fi
}
+if [ -z "$TEST_DIR" ]; then
+ TEST_DIR=`pwd`/scratch
+fi
+
+if [ ! -e "$TEST_DIR" ]; then
+ mkdir "$TEST_DIR"
+fi
+
diff="diff -u"
verbose=false
debug=false
@@ -440,6 +448,13 @@ if [ "$IMGFMT" == "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=" > /dev/null
IMGOPTS=$(_optstr_add "$IMGOPTS" "iter-time=10")
fi
+if [ -z "$SAMPLE_IMG_DIR" ]; then
+ SAMPLE_IMG_DIR="$source_iotests/sample_images"
+fi
+
+export TEST_DIR
+export SAMPLE_IMG_DIR
+
if [ -s $tmp.list ]
then
# found some valid test numbers ... this is good
@@ -524,3 +539,12 @@ if [ -x "$build_iotests/socket_scm_helper" ]
then
export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
fi
+
+default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
+default_alias_machine=$($QEMU_PROG -machine help | \
+ sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
+if [[ "$default_alias_machine" ]]; then
+ default_machine="$default_alias_machine"
+fi
+
+export QEMU_DEFAULT_MACHINE="$default_machine"
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index c7f0a7a7e0..cdcda54546 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -26,8 +26,6 @@ arch=`uname -m`
export PWD=`pwd`
-export _QEMU_HANDLE=0
-
# make sure we have a standard umask
umask 022
@@ -40,52 +38,5 @@ _optstr_add()
fi
}
-QEMU_IMG_EXTRA_ARGS=
-if [ "$IMGOPTSSYNTAX" = "true" ]; then
- QEMU_IMG_EXTRA_ARGS="--image-opts $QEMU_IMG_EXTRA_ARGS"
- if [ -n "$IMGKEYSECRET" ]; then
- QEMU_IMG_EXTRA_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IMG_EXTRA_ARGS"
- fi
-fi
-export QEMU_IMG_EXTRA_ARGS
-
-
-default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
-default_alias_machine=$($QEMU_PROG -machine help | \
- sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
-if [[ "$default_alias_machine" ]]; then
- default_machine="$default_alias_machine"
-fi
-
-export QEMU_DEFAULT_MACHINE="$default_machine"
-
-if [ -z "$TEST_DIR" ]; then
- TEST_DIR=`pwd`/scratch
-fi
-
-QEMU_TEST_DIR="${TEST_DIR}"
-
-if [ ! -e "$TEST_DIR" ]; then
- mkdir "$TEST_DIR"
-fi
-
-if [ ! -d "$TEST_DIR" ]; then
- echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
- exit 1
-fi
-
-export TEST_DIR
-
-if [ -z "$SAMPLE_IMG_DIR" ]; then
- SAMPLE_IMG_DIR="$source_iotests/sample_images"
-fi
-
-if [ ! -d "$SAMPLE_IMG_DIR" ]; then
- echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a directory"
- exit 1
-fi
-
-export SAMPLE_IMG_DIR
-
# make sure this script returns success
true
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
index 7645f1dc72..9f9aecc9df 100644
--- a/tests/qemu-iotests/common.qemu
+++ b/tests/qemu-iotests/common.qemu
@@ -31,6 +31,7 @@ QEMU_FIFO_IN="${QEMU_TEST_DIR}/qmp-in-$$"
QEMU_FIFO_OUT="${QEMU_TEST_DIR}/qmp-out-$$"
QEMU_HANDLE=0
+export _QEMU_HANDLE=0
# If bash version is >= 4.1, these will be overwritten and dynamic
# file descriptor values assigned.
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 20f6821a69..f4dc0104e6 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -114,6 +114,10 @@ export QEMU_VXHS=_qemu_vxhs_wrapper
if [ "$IMGOPTSSYNTAX" = "true" ]; then
DRIVER="driver=$IMGFMT"
+ QEMU_IMG_EXTRA_ARGS="--image-opts $QEMU_IMG_EXTRA_ARGS"
+ if [ -n "$IMGKEYSECRET" ]; then
+ QEMU_IMG_EXTRA_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IMG_EXTRA_ARGS"
+ fi
if [ "$IMGFMT" = "luks" ]; then
DRIVER="$DRIVER,key-secret=keysec0"
fi
@@ -133,6 +137,7 @@ if [ "$IMGOPTSSYNTAX" = "true" ]; then
TEST_IMG="$DRIVER,file.driver=$IMGPROTO,file.filename=$TEST_DIR/t.$IMGFMT"
fi
else
+ QEMU_IMG_EXTRA_ARGS=
if [ "$IMGPROTO" = "file" ]; then
TEST_IMG=$TEST_DIR/t.$IMGFMT
elif [ "$IMGPROTO" = "nbd" ]; then
@@ -153,6 +158,26 @@ else
fi
ORIG_TEST_IMG="$TEST_IMG"
+if [ -z "$TEST_DIR" ]; then
+ TEST_DIR=`pwd`/scratch
+fi
+
+QEMU_TEST_DIR="${TEST_DIR}"
+
+if [ ! -e "$TEST_DIR" ]; then
+ mkdir "$TEST_DIR"
+fi
+
+if [ ! -d "$TEST_DIR" ]; then
+ echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
+ exit 1
+fi
+
+if [ ! -d "$SAMPLE_IMG_DIR" ]; then
+ echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a directory"
+ exit 1
+fi
+
_use_sample_img()
{
SAMPLE_IMG_FILE="${1%\.bz2}"
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 08/10] qemu-iotests: fix uninitialized variable
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (6 preceding siblings ...)
2017-09-12 14:44 ` [Qemu-devel] [PATCH 07/10] qemu-iotests: disintegrate more parts of common.config Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 21:30 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 09/10] qemu-iotests: get rid of $iam Paolo Bonzini
` (4 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
The variable is used in "common" but defined only after the file
is sourced.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/check | 2 --
tests/qemu-iotests/common | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 4cb5b05908..7aec176ac4 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -77,8 +77,6 @@ fi
TIMESTAMP_FILE=check.time-$IMGPROTO-$IMGFMT
-tmp="${TEST_DIR}"/$$
-
_wallclock()
{
date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }'
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index ee313af92f..365d3c4349 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -67,6 +67,8 @@ sortme=false
expunge=true
have_test_arg=false
cachemode=false
+
+tmp="${TEST_DIR}"/$$
rm -f $tmp.list $tmp.tmp $tmp.sed
export IMGFMT=raw
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 09/10] qemu-iotests: get rid of $iam
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (7 preceding siblings ...)
2017-09-12 14:44 ` [Qemu-devel] [PATCH 08/10] qemu-iotests: fix uninitialized variable Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 21:31 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 10/10] qemu-iotests: merge "check" and "common" Paolo Bonzini
` (3 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
The variable is almost unused, and one of the two uses is actually
uninitialized.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/check | 5 +----
tests/qemu-iotests/common.rc | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 7aec176ac4..5dfd4bd51d 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -30,12 +30,9 @@ interrupt=true
# by default don't output timestamps
timestamp=${TIMESTAMP:=false}
-# generic initialization
-iam=check
-
_init_error()
{
- echo "$iam: $1" >&2
+ echo "check: $1" >&2
exit 1
}
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index f4dc0104e6..0e8a33c696 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -43,7 +43,7 @@ poke_file()
if ! . ./common.config
then
- echo "$iam: failed to source common.config"
+ echo "$0: failed to source common.config"
exit 1
fi
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [Qemu-devel] [PATCH 10/10] qemu-iotests: merge "check" and "common"
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (8 preceding siblings ...)
2017-09-12 14:44 ` [Qemu-devel] [PATCH 09/10] qemu-iotests: get rid of $iam Paolo Bonzini
@ 2017-09-12 14:44 ` Paolo Bonzini
2017-09-12 21:34 ` Eric Blake
2017-09-13 6:47 ` [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Thomas Huth
` (2 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
"check" is full of qemu-iotests--specific details. Separating it
from "common" does not make much sense anymore.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/check | 533 +++++++++++++++++++++++++++++++++++++++++++-
tests/qemu-iotests/common | 552 ----------------------------------------------
2 files changed, 531 insertions(+), 554 deletions(-)
delete mode 100644 tests/qemu-iotests/common
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 5dfd4bd51d..2a2f7c604f 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -69,8 +69,537 @@ then
_init_error "failed to source common.config"
fi
-# we need common
-. "$source_iotests/common"
+_full_imgfmt_details()
+{
+ if [ -n "$IMGOPTS" ]; then
+ echo "$IMGFMT ($IMGOPTS)"
+ else
+ echo "$IMGFMT"
+ fi
+}
+
+_full_platform_details()
+{
+ os=`uname -s`
+ host=`hostname -s`
+ kernel=`uname -r`
+ platform=`uname -m`
+ echo "$os/$platform $host $kernel"
+}
+
+# $1 = prog to look for
+set_prog_path()
+{
+ p=`command -v $1 2> /dev/null`
+ if [ -n "$p" -a -x "$p" ]; then
+ realpath -- "$(type -p "$p")"
+ else
+ return 1
+ fi
+}
+
+if [ -z "$TEST_DIR" ]; then
+ TEST_DIR=`pwd`/scratch
+fi
+
+if [ ! -e "$TEST_DIR" ]; then
+ mkdir "$TEST_DIR"
+fi
+
+diff="diff -u"
+verbose=false
+debug=false
+group=false
+xgroup=false
+imgopts=false
+showme=false
+sortme=false
+expunge=true
+have_test_arg=false
+cachemode=false
+
+tmp="${TEST_DIR}"/$$
+rm -f $tmp.list $tmp.tmp $tmp.sed
+
+export IMGFMT=raw
+export IMGFMT_GENERIC=true
+export IMGPROTO=file
+export IMGOPTS=""
+export CACHEMODE="writeback"
+export QEMU_IO_OPTIONS=""
+export QEMU_IO_OPTIONS_NO_FMT=""
+export CACHEMODE_IS_DEFAULT=true
+export QEMU_OPTIONS="-nodefaults -machine accel=qtest"
+export VALGRIND_QEMU=
+export IMGKEYSECRET=
+export IMGOPTSSYNTAX=false
+
+for r
+do
+
+ if $group
+ then
+ # arg after -g
+ group_list=`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
+s/ .*//p
+}'`
+ if [ -z "$group_list" ]
+ then
+ echo "Group \"$r\" is empty or not defined?"
+ exit 1
+ fi
+ [ ! -s $tmp.list ] && touch $tmp.list
+ for t in $group_list
+ do
+ if grep -s "^$t\$" $tmp.list >/dev/null
+ then
+ :
+ else
+ echo "$t" >>$tmp.list
+ fi
+ done
+ group=false
+ continue
+
+ elif $xgroup
+ then
+ # arg after -x
+ # Populate $tmp.list with all tests
+ awk '/^[0-9]{3,}/ {print $1}' "${source_iotests}/group" > $tmp.list 2>/dev/null
+ group_list=`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
+s/ .*//p
+}'`
+ if [ -z "$group_list" ]
+ then
+ echo "Group \"$r\" is empty or not defined?"
+ exit 1
+ fi
+ numsed=0
+ rm -f $tmp.sed
+ for t in $group_list
+ do
+ if [ $numsed -gt 100 ]
+ then
+ sed -f $tmp.sed <$tmp.list >$tmp.tmp
+ mv $tmp.tmp $tmp.list
+ numsed=0
+ rm -f $tmp.sed
+ fi
+ echo "/^$t\$/d" >>$tmp.sed
+ numsed=`expr $numsed + 1`
+ done
+ sed -f $tmp.sed <$tmp.list >$tmp.tmp
+ mv $tmp.tmp $tmp.list
+ xgroup=false
+ continue
+
+ elif $imgopts
+ then
+ IMGOPTS="$r"
+ imgopts=false
+ continue
+ elif $cachemode
+ then
+ CACHEMODE="$r"
+ CACHEMODE_IS_DEFAULT=false
+ cachemode=false
+ continue
+ fi
+
+ xpand=true
+ case "$r"
+ in
+
+ -\? | -h | --help) # usage
+ echo "Usage: $0 [options] [testlist]"'
+
+common options
+ -v verbose
+ -d debug
+
+image format options
+ -raw test raw (default)
+ -bochs test bochs
+ -cloop test cloop
+ -parallels test parallels
+ -qcow test qcow
+ -qcow2 test qcow2
+ -qed test qed
+ -vdi test vdi
+ -vpc test vpc
+ -vhdx test vhdx
+ -vmdk test vmdk
+ -luks test luks
+
+image protocol options
+ -file test file (default)
+ -rbd test rbd
+ -sheepdog test sheepdog
+ -nbd test nbd
+ -ssh test ssh
+ -nfs test nfs
+ -vxhs test vxhs
+
+other options
+ -xdiff graphical mode diff
+ -nocache use O_DIRECT on backing file
+ -misalign misalign memory allocations
+ -n show me, do not run tests
+ -o options -o options to pass to qemu-img create/convert
+ -T output timestamps
+ -c mode cache mode
+
+testlist options
+ -g group[,group...] include tests from these groups
+ -x group[,group...] exclude tests from these groups
+ NNN include test NNN
+ NNN-NNN include test range (eg. 012-021)
+'
+ exit 0
+ ;;
+
+ -raw)
+ IMGFMT=raw
+ xpand=false
+ ;;
+
+ -bochs)
+ IMGFMT=bochs
+ IMGFMT_GENERIC=false
+ xpand=false
+ ;;
+
+ -cloop)
+ IMGFMT=cloop
+ IMGFMT_GENERIC=false
+ xpand=false
+ ;;
+
+ -parallels)
+ IMGFMT=parallels
+ IMGFMT_GENERIC=false
+ xpand=false
+ ;;
+
+ -qcow)
+ IMGFMT=qcow
+ xpand=false
+ ;;
+
+ -qcow2)
+ IMGFMT=qcow2
+ xpand=false
+ ;;
+
+ -luks)
+ IMGOPTSSYNTAX=true
+ IMGFMT=luks
+ IMGKEYSECRET=123456
+ xpand=false
+ ;;
+
+ -qed)
+ IMGFMT=qed
+ xpand=false
+ ;;
+
+ -vdi)
+ IMGFMT=vdi
+ xpand=false
+ ;;
+
+ -vmdk)
+ IMGFMT=vmdk
+ xpand=false
+ ;;
+
+ -vpc)
+ IMGFMT=vpc
+ xpand=false
+ ;;
+
+ -vhdx)
+ IMGFMT=vhdx
+ xpand=false
+ ;;
+
+ -file)
+ IMGPROTO=file
+ xpand=false
+ ;;
+
+ -rbd)
+ IMGPROTO=rbd
+ xpand=false
+ ;;
+
+ -sheepdog)
+ IMGPROTO=sheepdog
+ xpand=false
+ ;;
+
+ -nbd)
+ IMGPROTO=nbd
+ xpand=false
+ ;;
+
+ -vxhs)
+ IMGPROTO=vxhs
+ xpand=false
+ ;;
+
+ -ssh)
+ IMGPROTO=ssh
+ xpand=false
+ ;;
+
+ -nfs)
+ IMGPROTO=nfs
+ xpand=false
+ ;;
+
+ -nocache)
+ CACHEMODE="none"
+ CACHEMODE_IS_DEFAULT=false
+ xpand=false
+ ;;
+
+ -misalign)
+ QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --misalign"
+ xpand=false
+ ;;
+
+ -valgrind)
+ VALGRIND_QEMU='y'
+ xpand=false
+ ;;
+
+ -g) # -g group ... pick from group file
+ group=true
+ xpand=false
+ ;;
+
+ -xdiff) # graphical diff mode
+ xpand=false
+
+ if [ ! -z "$DISPLAY" ]
+ then
+ command -v xdiff >/dev/null 2>&1 && diff=xdiff
+ command -v gdiff >/dev/null 2>&1 && diff=gdiff
+ command -v tkdiff >/dev/null 2>&1 && diff=tkdiff
+ command -v xxdiff >/dev/null 2>&1 && diff=xxdiff
+ fi
+ ;;
+
+ -n) # show me, don't do it
+ showme=true
+ xpand=false
+ ;;
+ -o)
+ imgopts=true
+ xpand=false
+ ;;
+ -c)
+ cachemode=true
+ xpand=false
+ ;;
+ -T) # turn on timestamp output
+ timestamp=true
+ xpand=false
+ ;;
+
+ -v)
+ verbose=true
+ xpand=false
+ ;;
+ -d)
+ debug=true
+ xpand=false
+ ;;
+ -x) # -x group ... exclude from group file
+ xgroup=true
+ xpand=false
+ ;;
+ '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
+ echo "No tests?"
+ status=1
+ exit $status
+ ;;
+
+ [0-9]*-[0-9]*)
+ eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`
+ ;;
+
+ [0-9]*-)
+ eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`
+ end=`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\[0-9]//g' -e 's/ *$//' -e 's/.* //'`
+ if [ -z "$end" ]
+ then
+ echo "No tests in range \"$r\"?"
+ status=1
+ exit $status
+ fi
+ ;;
+
+ *)
+ start=$r
+ end=$r
+ ;;
+
+ esac
+
+ # get rid of leading 0s as can be interpreted as octal
+ start=`echo $start | sed 's/^0*//'`
+ end=`echo $end | sed 's/^0*//'`
+
+ if $xpand
+ then
+ have_test_arg=true
+ awk </dev/null '
+BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
+ | while read id
+ do
+ if grep -s "^$id " "$source_iotests/group" >/dev/null
+ then
+ # in group file ... OK
+ echo $id >>$tmp.list
+ else
+ if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null
+ then
+ # expunged ... will be reported, but not run, later
+ echo $id >>$tmp.list
+ else
+ # oops
+ if [ "$start" == "$end" -a "$id" == "$end" ]
+ then
+ echo "$id - unknown test"
+ exit 1
+ else
+ echo "$id - unknown test, ignored"
+ fi
+ fi
+ fi
+ done || exit 1
+ fi
+
+done
+
+# Set qemu-io cache mode with $CACHEMODE we have
+QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --cache $CACHEMODE"
+
+QEMU_IO_OPTIONS_NO_FMT="$QEMU_IO_OPTIONS"
+if [ "$IMGOPTSSYNTAX" != "true" ]; then
+ QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS -f $IMGFMT"
+fi
+
+# Set default options for qemu-img create -o if they were not specified
+if [ "$IMGFMT" == "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=" > /dev/null); then
+ IMGOPTS=$(_optstr_add "$IMGOPTS" "compat=1.1")
+fi
+if [ "$IMGFMT" == "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=" > /dev/null); then
+ IMGOPTS=$(_optstr_add "$IMGOPTS" "iter-time=10")
+fi
+
+if [ -z "$SAMPLE_IMG_DIR" ]; then
+ SAMPLE_IMG_DIR="$source_iotests/sample_images"
+fi
+
+export TEST_DIR
+export SAMPLE_IMG_DIR
+
+if [ -s $tmp.list ]
+then
+ # found some valid test numbers ... this is good
+ :
+else
+ if $have_test_arg
+ then
+ # had test numbers, but none in group file ... do nothing
+ touch $tmp.list
+ else
+ # no test numbers, do everything from group file
+ sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <"$source_iotests/group" >$tmp.list
+ fi
+fi
+
+# should be sort -n, but this did not work for Linux when this
+# was ported from IRIX
+#
+list=`sort $tmp.list`
+rm -f $tmp.list $tmp.tmp $tmp.sed
+
+if [ -z "$QEMU_PROG" ]
+then
+ if [ -x "$build_iotests/qemu" ]; then
+ export QEMU_PROG="$build_iotests/qemu"
+ elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then
+ export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
+ else
+ pushd "$build_root" > /dev/null
+ for binary in *-softmmu/qemu-system-*
+ do
+ if [ -x "$binary" ]
+ then
+ export QEMU_PROG="$build_root/$binary"
+ break
+ fi
+ done
+ popd > /dev/null
+ [ "$QEMU_PROG" = "" ] && _init_error "qemu not found"
+ fi
+fi
+export QEMU_PROG=$(realpath -- "$(type -p "$QEMU_PROG")")
+
+if [ -z "$QEMU_IMG_PROG" ]; then
+ if [ -x "$build_iotests/qemu-img" ]; then
+ export QEMU_IMG_PROG="$build_iotests/qemu-img"
+ elif [ -x "$build_root/qemu-img" ]; then
+ export QEMU_IMG_PROG="$build_root/qemu-img"
+ else
+ _init_error "qemu-img not found"
+ fi
+fi
+export QEMU_IMG_PROG=$(realpath -- "$(type -p "$QEMU_IMG_PROG")")
+
+if [ -z "$QEMU_IO_PROG" ]; then
+ if [ -x "$build_iotests/qemu-io" ]; then
+ export QEMU_IO_PROG="$build_iotests/qemu-io"
+ elif [ -x "$build_root/qemu-io" ]; then
+ export QEMU_IO_PROG="$build_root/qemu-io"
+ else
+ _init_error "qemu-io not found"
+ fi
+fi
+export QEMU_IO_PROG=$(realpath -- "$(type -p "$QEMU_IO_PROG")")
+
+if [ -z $QEMU_NBD_PROG ]; then
+ if [ -x "$build_iotests/qemu-nbd" ]; then
+ export QEMU_NBD_PROG="$build_iotests/qemu-nbd"
+ elif [ -x "$build_root/qemu-nbd" ]; then
+ export QEMU_NBD_PROG="$build_root/qemu-nbd"
+ else
+ _init_error "qemu-nbd not found"
+ fi
+fi
+export QEMU_NBD_PROG=$(realpath -- "$(type -p "$QEMU_NBD_PROG")")
+
+if [ -z "$QEMU_VXHS_PROG" ]; then
+ export QEMU_VXHS_PROG="`set_prog_path qnio_server`"
+fi
+
+if [ -x "$build_iotests/socket_scm_helper" ]
+then
+ export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
+fi
+
+default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
+default_alias_machine=$($QEMU_PROG -machine help | \
+ sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
+if [[ "$default_alias_machine" ]]; then
+ default_machine="$default_alias_machine"
+fi
+
+export QEMU_DEFAULT_MACHINE="$default_machine"
TIMESTAMP_FILE=check.time-$IMGPROTO-$IMGFMT
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
deleted file mode 100644
index 365d3c4349..0000000000
--- a/tests/qemu-iotests/common
+++ /dev/null
@@ -1,552 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2009 Red Hat, Inc.
-# Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#
-# common procedures for QA scripts
-#
-
-_full_imgfmt_details()
-{
- if [ -n "$IMGOPTS" ]; then
- echo "$IMGFMT ($IMGOPTS)"
- else
- echo "$IMGFMT"
- fi
-}
-
-_full_platform_details()
-{
- os=`uname -s`
- host=`hostname -s`
- kernel=`uname -r`
- platform=`uname -m`
- echo "$os/$platform $host $kernel"
-}
-
-# $1 = prog to look for
-set_prog_path()
-{
- p=`command -v $1 2> /dev/null`
- if [ -n "$p" -a -x "$p" ]; then
- realpath -- "$(type -p "$p")"
- else
- return 1
- fi
-}
-
-if [ -z "$TEST_DIR" ]; then
- TEST_DIR=`pwd`/scratch
-fi
-
-if [ ! -e "$TEST_DIR" ]; then
- mkdir "$TEST_DIR"
-fi
-
-diff="diff -u"
-verbose=false
-debug=false
-group=false
-xgroup=false
-imgopts=false
-showme=false
-sortme=false
-expunge=true
-have_test_arg=false
-cachemode=false
-
-tmp="${TEST_DIR}"/$$
-rm -f $tmp.list $tmp.tmp $tmp.sed
-
-export IMGFMT=raw
-export IMGFMT_GENERIC=true
-export IMGPROTO=file
-export IMGOPTS=""
-export CACHEMODE="writeback"
-export QEMU_IO_OPTIONS=""
-export QEMU_IO_OPTIONS_NO_FMT=""
-export CACHEMODE_IS_DEFAULT=true
-export QEMU_OPTIONS="-nodefaults -machine accel=qtest"
-export VALGRIND_QEMU=
-export IMGKEYSECRET=
-export IMGOPTSSYNTAX=false
-
-for r
-do
-
- if $group
- then
- # arg after -g
- group_list=`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
-s/ .*//p
-}'`
- if [ -z "$group_list" ]
- then
- echo "Group \"$r\" is empty or not defined?"
- exit 1
- fi
- [ ! -s $tmp.list ] && touch $tmp.list
- for t in $group_list
- do
- if grep -s "^$t\$" $tmp.list >/dev/null
- then
- :
- else
- echo "$t" >>$tmp.list
- fi
- done
- group=false
- continue
-
- elif $xgroup
- then
- # arg after -x
- # Populate $tmp.list with all tests
- awk '/^[0-9]{3,}/ {print $1}' "${source_iotests}/group" > $tmp.list 2>/dev/null
- group_list=`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
-s/ .*//p
-}'`
- if [ -z "$group_list" ]
- then
- echo "Group \"$r\" is empty or not defined?"
- exit 1
- fi
- numsed=0
- rm -f $tmp.sed
- for t in $group_list
- do
- if [ $numsed -gt 100 ]
- then
- sed -f $tmp.sed <$tmp.list >$tmp.tmp
- mv $tmp.tmp $tmp.list
- numsed=0
- rm -f $tmp.sed
- fi
- echo "/^$t\$/d" >>$tmp.sed
- numsed=`expr $numsed + 1`
- done
- sed -f $tmp.sed <$tmp.list >$tmp.tmp
- mv $tmp.tmp $tmp.list
- xgroup=false
- continue
-
- elif $imgopts
- then
- IMGOPTS="$r"
- imgopts=false
- continue
- elif $cachemode
- then
- CACHEMODE="$r"
- CACHEMODE_IS_DEFAULT=false
- cachemode=false
- continue
- fi
-
- xpand=true
- case "$r"
- in
-
- -\? | -h | --help) # usage
- echo "Usage: $0 [options] [testlist]"'
-
-common options
- -v verbose
- -d debug
-
-image format options
- -raw test raw (default)
- -bochs test bochs
- -cloop test cloop
- -parallels test parallels
- -qcow test qcow
- -qcow2 test qcow2
- -qed test qed
- -vdi test vdi
- -vpc test vpc
- -vhdx test vhdx
- -vmdk test vmdk
- -luks test luks
-
-image protocol options
- -file test file (default)
- -rbd test rbd
- -sheepdog test sheepdog
- -nbd test nbd
- -ssh test ssh
- -nfs test nfs
- -vxhs test vxhs
-
-other options
- -xdiff graphical mode diff
- -nocache use O_DIRECT on backing file
- -misalign misalign memory allocations
- -n show me, do not run tests
- -o options -o options to pass to qemu-img create/convert
- -T output timestamps
- -c mode cache mode
-
-testlist options
- -g group[,group...] include tests from these groups
- -x group[,group...] exclude tests from these groups
- NNN include test NNN
- NNN-NNN include test range (eg. 012-021)
-'
- exit 0
- ;;
-
- -raw)
- IMGFMT=raw
- xpand=false
- ;;
-
- -bochs)
- IMGFMT=bochs
- IMGFMT_GENERIC=false
- xpand=false
- ;;
-
- -cloop)
- IMGFMT=cloop
- IMGFMT_GENERIC=false
- xpand=false
- ;;
-
- -parallels)
- IMGFMT=parallels
- IMGFMT_GENERIC=false
- xpand=false
- ;;
-
- -qcow)
- IMGFMT=qcow
- xpand=false
- ;;
-
- -qcow2)
- IMGFMT=qcow2
- xpand=false
- ;;
-
- -luks)
- IMGOPTSSYNTAX=true
- IMGFMT=luks
- IMGKEYSECRET=123456
- xpand=false
- ;;
-
- -qed)
- IMGFMT=qed
- xpand=false
- ;;
-
- -vdi)
- IMGFMT=vdi
- xpand=false
- ;;
-
- -vmdk)
- IMGFMT=vmdk
- xpand=false
- ;;
-
- -vpc)
- IMGFMT=vpc
- xpand=false
- ;;
-
- -vhdx)
- IMGFMT=vhdx
- xpand=false
- ;;
-
- -file)
- IMGPROTO=file
- xpand=false
- ;;
-
- -rbd)
- IMGPROTO=rbd
- xpand=false
- ;;
-
- -sheepdog)
- IMGPROTO=sheepdog
- xpand=false
- ;;
-
- -nbd)
- IMGPROTO=nbd
- xpand=false
- ;;
-
- -vxhs)
- IMGPROTO=vxhs
- xpand=false
- ;;
-
- -ssh)
- IMGPROTO=ssh
- xpand=false
- ;;
-
- -nfs)
- IMGPROTO=nfs
- xpand=false
- ;;
-
- -nocache)
- CACHEMODE="none"
- CACHEMODE_IS_DEFAULT=false
- xpand=false
- ;;
-
- -misalign)
- QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --misalign"
- xpand=false
- ;;
-
- -valgrind)
- VALGRIND_QEMU='y'
- xpand=false
- ;;
-
- -g) # -g group ... pick from group file
- group=true
- xpand=false
- ;;
-
- -xdiff) # graphical diff mode
- xpand=false
-
- if [ ! -z "$DISPLAY" ]
- then
- command -v xdiff >/dev/null 2>&1 && diff=xdiff
- command -v gdiff >/dev/null 2>&1 && diff=gdiff
- command -v tkdiff >/dev/null 2>&1 && diff=tkdiff
- command -v xxdiff >/dev/null 2>&1 && diff=xxdiff
- fi
- ;;
-
- -n) # show me, don't do it
- showme=true
- xpand=false
- ;;
- -o)
- imgopts=true
- xpand=false
- ;;
- -c)
- cachemode=true
- xpand=false
- ;;
- -T) # turn on timestamp output
- timestamp=true
- xpand=false
- ;;
-
- -v)
- verbose=true
- xpand=false
- ;;
- -d)
- debug=true
- xpand=false
- ;;
- -x) # -x group ... exclude from group file
- xgroup=true
- xpand=false
- ;;
- '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
- echo "No tests?"
- status=1
- exit $status
- ;;
-
- [0-9]*-[0-9]*)
- eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`
- ;;
-
- [0-9]*-)
- eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`
- end=`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\[0-9]//g' -e 's/ *$//' -e 's/.* //'`
- if [ -z "$end" ]
- then
- echo "No tests in range \"$r\"?"
- status=1
- exit $status
- fi
- ;;
-
- *)
- start=$r
- end=$r
- ;;
-
- esac
-
- # get rid of leading 0s as can be interpreted as octal
- start=`echo $start | sed 's/^0*//'`
- end=`echo $end | sed 's/^0*//'`
-
- if $xpand
- then
- have_test_arg=true
- awk </dev/null '
-BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
- | while read id
- do
- if grep -s "^$id " "$source_iotests/group" >/dev/null
- then
- # in group file ... OK
- echo $id >>$tmp.list
- else
- if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null
- then
- # expunged ... will be reported, but not run, later
- echo $id >>$tmp.list
- else
- # oops
- if [ "$start" == "$end" -a "$id" == "$end" ]
- then
- echo "$id - unknown test"
- exit 1
- else
- echo "$id - unknown test, ignored"
- fi
- fi
- fi
- done || exit 1
- fi
-
-done
-
-# Set qemu-io cache mode with $CACHEMODE we have
-QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --cache $CACHEMODE"
-
-QEMU_IO_OPTIONS_NO_FMT="$QEMU_IO_OPTIONS"
-if [ "$IMGOPTSSYNTAX" != "true" ]; then
- QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS -f $IMGFMT"
-fi
-
-# Set default options for qemu-img create -o if they were not specified
-if [ "$IMGFMT" == "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=" > /dev/null); then
- IMGOPTS=$(_optstr_add "$IMGOPTS" "compat=1.1")
-fi
-if [ "$IMGFMT" == "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=" > /dev/null); then
- IMGOPTS=$(_optstr_add "$IMGOPTS" "iter-time=10")
-fi
-
-if [ -z "$SAMPLE_IMG_DIR" ]; then
- SAMPLE_IMG_DIR="$source_iotests/sample_images"
-fi
-
-export TEST_DIR
-export SAMPLE_IMG_DIR
-
-if [ -s $tmp.list ]
-then
- # found some valid test numbers ... this is good
- :
-else
- if $have_test_arg
- then
- # had test numbers, but none in group file ... do nothing
- touch $tmp.list
- else
- # no test numbers, do everything from group file
- sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <"$source_iotests/group" >$tmp.list
- fi
-fi
-
-# should be sort -n, but this did not work for Linux when this
-# was ported from IRIX
-#
-list=`sort $tmp.list`
-rm -f $tmp.list $tmp.tmp $tmp.sed
-
-if [ -z "$QEMU_PROG" ]
-then
- if [ -x "$build_iotests/qemu" ]; then
- export QEMU_PROG="$build_iotests/qemu"
- elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then
- export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
- else
- pushd "$build_root" > /dev/null
- for binary in *-softmmu/qemu-system-*
- do
- if [ -x "$binary" ]
- then
- export QEMU_PROG="$build_root/$binary"
- break
- fi
- done
- popd > /dev/null
- [ "$QEMU_PROG" = "" ] && _init_error "qemu not found"
- fi
-fi
-export QEMU_PROG=$(realpath -- "$(type -p "$QEMU_PROG")")
-
-if [ -z "$QEMU_IMG_PROG" ]; then
- if [ -x "$build_iotests/qemu-img" ]; then
- export QEMU_IMG_PROG="$build_iotests/qemu-img"
- elif [ -x "$build_root/qemu-img" ]; then
- export QEMU_IMG_PROG="$build_root/qemu-img"
- else
- _init_error "qemu-img not found"
- fi
-fi
-export QEMU_IMG_PROG=$(realpath -- "$(type -p "$QEMU_IMG_PROG")")
-
-if [ -z "$QEMU_IO_PROG" ]; then
- if [ -x "$build_iotests/qemu-io" ]; then
- export QEMU_IO_PROG="$build_iotests/qemu-io"
- elif [ -x "$build_root/qemu-io" ]; then
- export QEMU_IO_PROG="$build_root/qemu-io"
- else
- _init_error "qemu-io not found"
- fi
-fi
-export QEMU_IO_PROG=$(realpath -- "$(type -p "$QEMU_IO_PROG")")
-
-if [ -z $QEMU_NBD_PROG ]; then
- if [ -x "$build_iotests/qemu-nbd" ]; then
- export QEMU_NBD_PROG="$build_iotests/qemu-nbd"
- elif [ -x "$build_root/qemu-nbd" ]; then
- export QEMU_NBD_PROG="$build_root/qemu-nbd"
- else
- _init_error "qemu-nbd not found"
- fi
-fi
-export QEMU_NBD_PROG=$(realpath -- "$(type -p "$QEMU_NBD_PROG")")
-
-if [ -z "$QEMU_VXHS_PROG" ]; then
- export QEMU_VXHS_PROG="`set_prog_path qnio_server`"
-fi
-
-if [ -x "$build_iotests/socket_scm_helper" ]
-then
- export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
-fi
-
-default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
-default_alias_machine=$($QEMU_PROG -machine help | \
- sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
-if [[ "$default_alias_machine" ]]; then
- default_machine="$default_alias_machine"
-fi
-
-export QEMU_DEFAULT_MACHINE="$default_machine"
--
2.13.5
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG
2017-09-12 14:44 ` [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG Paolo Bonzini
@ 2017-09-12 16:30 ` Philippe Mathieu-Daudé
2017-09-12 16:36 ` Paolo Bonzini
2017-09-12 20:45 ` Eric Blake
1 sibling, 1 reply; 31+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-12 16:30 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel, Eric Blake; +Cc: kwolf, qemu-block
Hi Paolo,
Hmm did you just resend your v1? Except the cover the patches don't have
"v2" and I remember reviewing this one (also Eric Blake replied with his
R-b).
On 09/12/2017 11:44 AM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/check | 4 ++--
> tests/qemu-iotests/common | 2 +-
> tests/qemu-iotests/common.config | 3 ---
> 3 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index 4a6ed67b42..5c0d0c51dc 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -128,7 +128,7 @@ tmp="${TEST_DIR}"/$$
>
> _wallclock()
> {
> - date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }'
> + date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }'
> }
>
> _timestamp()
> @@ -147,7 +147,7 @@ _wrapup()
> if [ -f $TIMESTAMP_FILE -a -f $tmp.time ]
> then
> cat $TIMESTAMP_FILE $tmp.time \
> - | $AWK_PROG '
> + | awk '
> { t[$1] = $2 }
> END { if (NR > 0) {
> for (i in t) print i " " t[i]
> diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
> index 867918895b..130f647a4d 100644
> --- a/tests/qemu-iotests/common
> +++ b/tests/qemu-iotests/common
> @@ -366,7 +366,7 @@ testlist options
> if $xpand
> then
> have_test_arg=true
> - $AWK_PROG </dev/null '
> + awk </dev/null '
> BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
> | while read id
> do
> diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
> index b599c72211..0f571d46eb 100644
> --- a/tests/qemu-iotests/common.config
> +++ b/tests/qemu-iotests/common.config
> @@ -56,9 +56,6 @@ _fatal()
> exit 1
> }
>
> -export AWK_PROG="`set_prog_path awk`"
> -[ "$AWK_PROG" = "" ] && _fatal "awk not found"
> -
> if [ -z "$QEMU_PROG" ]; then
> export QEMU_PROG="`set_prog_path qemu`"
> fi
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG
2017-09-12 16:30 ` Philippe Mathieu-Daudé
@ 2017-09-12 16:36 ` Paolo Bonzini
0 siblings, 0 replies; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 16:36 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel, Eric Blake; +Cc: kwolf, qemu-block
On 12/09/2017 18:30, Philippe Mathieu-Daudé wrote:
> Hi Paolo,
>
> Hmm did you just resend your v1? Except the cover the patches don't have
> "v2" and I remember reviewing this one (also Eric Blake replied with his
> R-b).
I didn't include the R-bs, sorry (most of the later patches had
non-trivial context changes, this one is the exception).
But it's definitely v2, because v1 had 12 patches. :)
Paolo
> On 09/12/2017 11:44 AM, Paolo Bonzini wrote:
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> tests/qemu-iotests/check | 4 ++--
>> tests/qemu-iotests/common | 2 +-
>> tests/qemu-iotests/common.config | 3 ---
>> 3 files changed, 3 insertions(+), 6 deletions(-)
>>
>> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
>> index 4a6ed67b42..5c0d0c51dc 100755
>> --- a/tests/qemu-iotests/check
>> +++ b/tests/qemu-iotests/check
>> @@ -128,7 +128,7 @@ tmp="${TEST_DIR}"/$$
>> _wallclock()
>> {
>> - date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }'
>> + date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }'
>> }
>> _timestamp()
>> @@ -147,7 +147,7 @@ _wrapup()
>> if [ -f $TIMESTAMP_FILE -a -f $tmp.time ]
>> then
>> cat $TIMESTAMP_FILE $tmp.time \
>> - | $AWK_PROG '
>> + | awk '
>> { t[$1] = $2 }
>> END { if (NR > 0) {
>> for (i in t) print i " " t[i]
>> diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
>> index 867918895b..130f647a4d 100644
>> --- a/tests/qemu-iotests/common
>> +++ b/tests/qemu-iotests/common
>> @@ -366,7 +366,7 @@ testlist options
>> if $xpand
>> then
>> have_test_arg=true
>> - $AWK_PROG </dev/null '
>> + awk </dev/null '
>> BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
>> | while read id
>> do
>> diff --git a/tests/qemu-iotests/common.config
>> b/tests/qemu-iotests/common.config
>> index b599c72211..0f571d46eb 100644
>> --- a/tests/qemu-iotests/common.config
>> +++ b/tests/qemu-iotests/common.config
>> @@ -56,9 +56,6 @@ _fatal()
>> exit 1
>> }
>> -export AWK_PROG="`set_prog_path awk`"
>> -[ "$AWK_PROG" = "" ] && _fatal "awk not found"
>> -
>> if [ -z "$QEMU_PROG" ]; then
>> export QEMU_PROG="`set_prog_path qemu`"
>> fi
>>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] qemu-iotests: remove dead code
2017-09-12 14:44 ` [Qemu-devel] [PATCH 01/10] qemu-iotests: remove dead code Paolo Bonzini
@ 2017-09-12 20:34 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 20:34 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 695 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> This includes shell function, shell variables and command line options
> (randomize.awk does not exist).
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/check | 28 -----------------
> tests/qemu-iotests/common | 23 --------------
> tests/qemu-iotests/common.config | 26 ---------------
> tests/qemu-iotests/common.rc | 68 ----------------------------------------
> 4 files changed, 145 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG
2017-09-12 14:44 ` [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG Paolo Bonzini
2017-09-12 16:30 ` Philippe Mathieu-Daudé
@ 2017-09-12 20:45 ` Eric Blake
1 sibling, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 20:45 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/check | 4 ++--
> tests/qemu-iotests/common | 2 +-
> tests/qemu-iotests/common.config | 3 ---
> 3 files changed, 3 insertions(+), 6 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] qemu-iotests: move "check" code out of common.rc
2017-09-12 14:44 ` [Qemu-devel] [PATCH 03/10] qemu-iotests: move "check" code out of common.rc Paolo Bonzini
@ 2017-09-12 21:03 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:03 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 801 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> Some functions in common.rc are never used by the tests. Move
> them out of that file and into common, which is already included
> only by "check".
>
> Code that actually *is* common to "check" and tests can be placed in
> common.config.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/common | 25 ++++++++++++++++++++++++-
> tests/qemu-iotests/common.config | 12 ++++++++++++
> tests/qemu-iotests/common.rc | 40 ----------------------------------------
> 3 files changed, 36 insertions(+), 41 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs
2017-09-12 14:44 ` [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs Paolo Bonzini
@ 2017-09-12 21:11 ` Eric Blake
2017-09-12 21:26 ` Paolo Bonzini
0 siblings, 1 reply; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:11 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 3067 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> Instead of ./check failing when a binary is missing, we try each test
> case now and each one fails with tons of test case diffs. Also, all the
> variables were initialized by "check" prior to "common" being sourced,
> and then (uselessly) checked for emptiness again in "check".
>
> Centralize the search for programs in "common" (which will soon be
> one with "check"), including the "realpath" invocation which can be done
> just once in "check" rather than in the tests.
>
> For qnio_server, move the detection to "common", simplifying
> set_prog_path to stop handling the unused second argument, and
> embedding the "realpath" pass.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/check | 41 ---------------------
> tests/qemu-iotests/common | 77 +++++++++++++++++++++++++++++++++++++---
> tests/qemu-iotests/common.config | 61 +------------------------------
> 3 files changed, 73 insertions(+), 106 deletions(-)
>
> +++ b/tests/qemu-iotests/common
> @@ -37,6 +37,17 @@ _full_platform_details()
> echo "$os/$platform $host $kernel"
> }
>
> +# $1 = prog to look for
> +set_prog_path()
> +{
> + p=`command -v $1 2> /dev/null`
Are we sure that $1 will always respond to -v sanely?
> + if [ -n "$p" -a -x "$p" ]; then
[ ... -a ... ] should never be used; there are cases where it is
inherently ambiguous (even if it happens to work here, because we know
our shell is bash and because $p is not likely to contain text that
throws off the parser). Please spell that either:
if [ -n "$p" ] && [ -x "$p" ]; then
if [[ -n $p && -x $p ]]; then
(that is, I don't mind if you rely on bash's [[]] in which case you can
use less typing, but if you stick to [], then you should use code that
can be pasted to other shells)
> +then
> + if [ -x "$build_iotests/qemu" ]; then
> + export QEMU_PROG="$build_iotests/qemu"
> + elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then
> + export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
> + else
> + pushd "$build_root" > /dev/null
Shouldn't you check for failure to change directories?
> +++ b/tests/qemu-iotests/common.config
> @@ -22,6 +22,7 @@ export LANG=C
> PATH=".:$PATH"
>
> HOSTOS=`uname -s`
> +arch=`uname -m`
As long as we're touching this, should we prefer $() instead of ``?
>
> export PWD=`pwd`
>
> @@ -30,28 +31,6 @@ export _QEMU_HANDLE=0
> # make sure we have a standard umask
> umask 022
>
> -# $1 = prog to look for, $2* = default pathnames if not found in $PATH
> -set_prog_path()
> -{
> - p=`command -v $1 2> /dev/null`
> - if [ -n "$p" -a -x "$p" ]; then
Urrgh - your use of [ -a ] was pre-existing, and you just moved it.
Still worth fixing, though (either here or in a separate cleanup patch).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc
2017-09-12 14:44 ` [Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc Paolo Bonzini
@ 2017-09-12 21:15 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:15 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> These are never used by "check", with one exception that does not need
> $QEMU_OPTIONS. Keep them in common.rc, which will be soon included only
> by the tests.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/039.out | 10 +++---
> tests/qemu-iotests/061.out | 4 +--
> tests/qemu-iotests/137.out | 2 +-
> tests/qemu-iotests/common.config | 69 ++--------------------------------------
> tests/qemu-iotests/common.rc | 65 +++++++++++++++++++++++++++++++++++++
> 5 files changed, 75 insertions(+), 75 deletions(-)
It may be worth tweaking scripts/git.orderfile to prioritize
tests/qemu-iotests/common* above the rest of tests/qemu-iotests (I have
that tweak locally, at any rate). But that's a separate issue.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 06/10] qemu-iotests: do not include common.rc in "check"
2017-09-12 14:44 ` [Qemu-devel] [PATCH 06/10] qemu-iotests: do not include common.rc in "check" Paolo Bonzini
@ 2017-09-12 21:16 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:16 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 502 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> It only provides functions used by the test programs.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/check | 6 ------
> tests/qemu-iotests/common.rc | 13 +++++--------
> 2 files changed, 5 insertions(+), 14 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 07/10] qemu-iotests: disintegrate more parts of common.config
2017-09-12 14:44 ` [Qemu-devel] [PATCH 07/10] qemu-iotests: disintegrate more parts of common.config Paolo Bonzini
@ 2017-09-12 21:25 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:25 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 1505 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> Split "check" parts from tests part.
>
> For the directory setup, the actual computation of directories goes
> in "check", while the sanity checks go in the tests.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/common | 24 ++++++++++++++++++++
> tests/qemu-iotests/common.config | 49 ----------------------------------------
> tests/qemu-iotests/common.qemu | 1 +
> tests/qemu-iotests/common.rc | 25 ++++++++++++++++++++
> 4 files changed, 50 insertions(+), 49 deletions(-)
>
> diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
> index abacc24114..ee313af92f 100644
> --- a/tests/qemu-iotests/common
> +++ b/tests/qemu-iotests/common
> @@ -48,6 +48,14 @@ set_prog_path()
> fi
> }
>
> +if [ -z "$TEST_DIR" ]; then
> + TEST_DIR=`pwd`/scratch
8-space indent looks odd compared to the rest of the file.
> @@ -153,6 +158,26 @@ else
> fi
> ORIG_TEST_IMG="$TEST_IMG"
>
> +if [ -z "$TEST_DIR" ]; then
> + TEST_DIR=`pwd`/scratch
We probably ought to clean things up to use $PWD instead of `pwd`
everywhere as a minor optimization (why fork, when bash already has the
right information for you?) - but that can be separate.
Split looks okay to me,
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs
2017-09-12 21:11 ` Eric Blake
@ 2017-09-12 21:26 ` Paolo Bonzini
2017-09-12 21:34 ` Eric Blake
0 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-12 21:26 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, kwolf, qemu-block
> > +then
> > + if [ -x "$build_iotests/qemu" ]; then
> > + export QEMU_PROG="$build_iotests/qemu"
> > + elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then
> > + export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
> > + else
> > + pushd "$build_root" > /dev/null
>
> Shouldn't you check for failure to change directories?
>
> > export PWD=`pwd`
> >
> > @@ -30,28 +31,6 @@ export _QEMU_HANDLE=0
> > # make sure we have a standard umask
> > umask 022
> >
> > -# $1 = prog to look for, $2* = default pathnames if not found in $PATH
> > -set_prog_path()
> > -{
> > - p=`command -v $1 2> /dev/null`
> > - if [ -n "$p" -a -x "$p" ]; then
>
> Urrgh - your use of [ -a ] was pre-existing, and you just moved it.
And same for pushd...
Paolo
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 08/10] qemu-iotests: fix uninitialized variable
2017-09-12 14:44 ` [Qemu-devel] [PATCH 08/10] qemu-iotests: fix uninitialized variable Paolo Bonzini
@ 2017-09-12 21:30 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:30 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> The variable is used in "common" but defined only after the file
> is sourced.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/check | 2 --
> tests/qemu-iotests/common | 2 ++
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
> +tmp="${TEST_DIR}"/$$
Pre-existing to your code motion, but would we be any safer if $tmp also
included a use of $RANDOM? (The $$ already protects us from collisions
with a parallel run, but it is easy to guess, so if $tmp is used to
create any file that an attacker can access, running the testsuite may
expose a machine to a symlink or other attack - but we probably have
lots of those things to audit for before we can recommend running the
testsuite in an untrusted environment).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 09/10] qemu-iotests: get rid of $iam
2017-09-12 14:44 ` [Qemu-devel] [PATCH 09/10] qemu-iotests: get rid of $iam Paolo Bonzini
@ 2017-09-12 21:31 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:31 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 518 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> The variable is almost unused, and one of the two uses is actually
> uninitialized.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/check | 5 +----
> tests/qemu-iotests/common.rc | 2 +-
> 2 files changed, 2 insertions(+), 5 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 10/10] qemu-iotests: merge "check" and "common"
2017-09-12 14:44 ` [Qemu-devel] [PATCH 10/10] qemu-iotests: merge "check" and "common" Paolo Bonzini
@ 2017-09-12 21:34 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:34 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 684 bytes --]
On 09/12/2017 09:44 AM, Paolo Bonzini wrote:
> "check" is full of qemu-iotests--specific details. Separating it
> from "common" does not make much sense anymore.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/qemu-iotests/check | 533 +++++++++++++++++++++++++++++++++++++++++++-
> tests/qemu-iotests/common | 552 ----------------------------------------------
> 2 files changed, 531 insertions(+), 554 deletions(-)
> delete mode 100644 tests/qemu-iotests/common
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs
2017-09-12 21:26 ` Paolo Bonzini
@ 2017-09-12 21:34 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-12 21:34 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, kwolf, qemu-block
[-- Attachment #1: Type: text/plain, Size: 1172 bytes --]
On 09/12/2017 04:26 PM, Paolo Bonzini wrote:
>
>
>>> +then
>>> + if [ -x "$build_iotests/qemu" ]; then
>>> + export QEMU_PROG="$build_iotests/qemu"
>>> + elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then
>>> + export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
>>> + else
>>> + pushd "$build_root" > /dev/null
>>
>> Shouldn't you check for failure to change directories?
>>
>>> export PWD=`pwd`
>>>
>>> @@ -30,28 +31,6 @@ export _QEMU_HANDLE=0
>>> # make sure we have a standard umask
>>> umask 022
>>>
>>> -# $1 = prog to look for, $2* = default pathnames if not found in $PATH
>>> -set_prog_path()
>>> -{
>>> - p=`command -v $1 2> /dev/null`
>>> - if [ -n "$p" -a -x "$p" ]; then
>>
>> Urrgh - your use of [ -a ] was pre-existing, and you just moved it.
>
> And same for pushd...
True - since this patch is just code motion, we can do the cleanups in a
different patch, so you can have:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (9 preceding siblings ...)
2017-09-12 14:44 ` [Qemu-devel] [PATCH 10/10] qemu-iotests: merge "check" and "common" Paolo Bonzini
@ 2017-09-13 6:47 ` Thomas Huth
2017-09-13 7:59 ` Fam Zheng
2017-10-02 12:32 ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2017-10-04 16:26 ` [Qemu-devel] " Kevin Wolf
12 siblings, 1 reply; 31+ messages in thread
From: Thomas Huth @ 2017-09-13 6:47 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: kwolf, qemu-block
On 12.09.2017 16:44, Paolo Bonzini wrote:
> The purpose of this series is to separate the "check" sources from
> the tests. After these patches, common.config is reduced to simple
> shell initialization, and common.rc is only included by the tests.
>
> Along the way, a lot of dead code is removed too.
>
> In v2, the following patches:
>
> qemu-iotests: do not do useless search for QEMU_*_PROG
> qemu-iotests: do not search for binaries in the current directory
> qemu-iotests: include common.env and common.config early
>
> have been replaced by "qemu-iotests: cleanup and fix search for programs",
> which also preserves the behavior of searching for programs as symlinks
> in the current directory.
>
> Paolo
>
> Paolo Bonzini (10):
> qemu-iotests: remove dead code
> qemu-iotests: get rid of AWK_PROG
> qemu-iotests: move "check" code out of common.rc
> qemu-iotests: cleanup and fix search for programs
> qemu-iotests: limit non-_PROG-suffixed variables to common.rc
> qemu-iotests: do not include common.rc in "check"
> qemu-iotests: disintegrate more parts of common.config
> qemu-iotests: fix uninitialized variable
> qemu-iotests: get rid of $iam
> qemu-iotests: merge "check" and "common"
>
> tests/qemu-iotests/039.out | 10 +-
> tests/qemu-iotests/061.out | 4 +-
> tests/qemu-iotests/137.out | 2 +-
> tests/qemu-iotests/check | 575 ++++++++++++++++++++++++++++++++++-----
> tests/qemu-iotests/common | 459 -------------------------------
> tests/qemu-iotests/common.config | 206 +-------------
> tests/qemu-iotests/common.qemu | 1 +
> tests/qemu-iotests/common.rc | 205 +++++++-------
Meta comment: Could we maybe also rename "tests/qemu-iotests" to
"tests/iotests" ? The "qemu" prefix sounds always very superfluous to me
here...
Thomas
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests
2017-09-13 6:47 ` [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Thomas Huth
@ 2017-09-13 7:59 ` Fam Zheng
2017-09-13 22:06 ` Paolo Bonzini
0 siblings, 1 reply; 31+ messages in thread
From: Fam Zheng @ 2017-09-13 7:59 UTC (permalink / raw)
To: Thomas Huth; +Cc: Paolo Bonzini, qemu-devel, kwolf, qemu-block
On Wed, 09/13 08:47, Thomas Huth wrote:
> Meta comment: Could we maybe also rename "tests/qemu-iotests" to
> "tests/iotests" ? The "qemu" prefix sounds always very superfluous to me
> here...
Sounds good, and saves typing for when this path is manually entered. But maybe
keep tests/qemu-iotests as a symlink to keep old scripts happy?
Fam
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests
2017-09-13 7:59 ` Fam Zheng
@ 2017-09-13 22:06 ` Paolo Bonzini
2017-09-13 22:14 ` Eric Blake
0 siblings, 1 reply; 31+ messages in thread
From: Paolo Bonzini @ 2017-09-13 22:06 UTC (permalink / raw)
To: Fam Zheng, Thomas Huth; +Cc: qemu-devel, kwolf, qemu-block
On 13/09/2017 09:59, Fam Zheng wrote:
> On Wed, 09/13 08:47, Thomas Huth wrote:
>> Meta comment: Could we maybe also rename "tests/qemu-iotests" to
>> "tests/iotests" ? The "qemu" prefix sounds always very superfluous to me
>> here...
>
> Sounds good, and saves typing for when this path is manually entered. But maybe
> keep tests/qemu-iotests as a symlink to keep old scripts happy?
The simplest way to keep old scripts happy would be too keep the prefix
:) even though it does sound unnecessary.
Paolo
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests
2017-09-13 22:06 ` Paolo Bonzini
@ 2017-09-13 22:14 ` Eric Blake
0 siblings, 0 replies; 31+ messages in thread
From: Eric Blake @ 2017-09-13 22:14 UTC (permalink / raw)
To: Paolo Bonzini, Fam Zheng, Thomas Huth; +Cc: kwolf, qemu-devel, qemu-block
[-- Attachment #1: Type: text/plain, Size: 862 bytes --]
On 09/13/2017 05:06 PM, Paolo Bonzini wrote:
> On 13/09/2017 09:59, Fam Zheng wrote:
>> On Wed, 09/13 08:47, Thomas Huth wrote:
>>> Meta comment: Could we maybe also rename "tests/qemu-iotests" to
>>> "tests/iotests" ? The "qemu" prefix sounds always very superfluous to me
>>> here...
>>
>> Sounds good, and saves typing for when this path is manually entered. But maybe
>> keep tests/qemu-iotests as a symlink to keep old scripts happy?
>
> The simplest way to keep old scripts happy would be too keep the prefix
> :) even though it does sound unnecessary.
Can't someone manually add the symlink to keep their own scripts working
both before and after the change, even if we don't commit the symlink
into git?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [Qemu-block] [PATCH v2 00/10] cleanup qemu-iotests
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (10 preceding siblings ...)
2017-09-13 6:47 ` [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Thomas Huth
@ 2017-10-02 12:32 ` Paolo Bonzini
2017-10-04 16:26 ` [Qemu-devel] " Kevin Wolf
12 siblings, 0 replies; 31+ messages in thread
From: Paolo Bonzini @ 2017-10-02 12:32 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, qemu-block
On 12/09/2017 16:44, Paolo Bonzini wrote:
> The purpose of this series is to separate the "check" sources from
> the tests. After these patches, common.config is reduced to simple
> shell initialization, and common.rc is only included by the tests.
>
> Along the way, a lot of dead code is removed too.
>
> In v2, the following patches:
>
> qemu-iotests: do not do useless search for QEMU_*_PROG
> qemu-iotests: do not search for binaries in the current directory
> qemu-iotests: include common.env and common.config early
>
> have been replaced by "qemu-iotests: cleanup and fix search for programs",
> which also preserves the behavior of searching for programs as symlinks
> in the current directory.
>
> Paolo
Kevin,
ping?
Paolo
> Paolo Bonzini (10):
> qemu-iotests: remove dead code
> qemu-iotests: get rid of AWK_PROG
> qemu-iotests: move "check" code out of common.rc
> qemu-iotests: cleanup and fix search for programs
> qemu-iotests: limit non-_PROG-suffixed variables to common.rc
> qemu-iotests: do not include common.rc in "check"
> qemu-iotests: disintegrate more parts of common.config
> qemu-iotests: fix uninitialized variable
> qemu-iotests: get rid of $iam
> qemu-iotests: merge "check" and "common"
>
> tests/qemu-iotests/039.out | 10 +-
> tests/qemu-iotests/061.out | 4 +-
> tests/qemu-iotests/137.out | 2 +-
> tests/qemu-iotests/check | 575 ++++++++++++++++++++++++++++++++++-----
> tests/qemu-iotests/common | 459 -------------------------------
> tests/qemu-iotests/common.config | 206 +-------------
> tests/qemu-iotests/common.qemu | 1 +
> tests/qemu-iotests/common.rc | 205 +++++++-------
> 8 files changed, 621 insertions(+), 841 deletions(-)
> delete mode 100644 tests/qemu-iotests/common
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
` (11 preceding siblings ...)
2017-10-02 12:32 ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
@ 2017-10-04 16:26 ` Kevin Wolf
12 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2017-10-04 16:26 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, qemu-block
Am 12.09.2017 um 16:44 hat Paolo Bonzini geschrieben:
> The purpose of this series is to separate the "check" sources from
> the tests. After these patches, common.config is reduced to simple
> shell initialization, and common.rc is only included by the tests.
>
> Along the way, a lot of dead code is removed too.
>
> In v2, the following patches:
>
> qemu-iotests: do not do useless search for QEMU_*_PROG
> qemu-iotests: do not search for binaries in the current directory
> qemu-iotests: include common.env and common.config early
>
> have been replaced by "qemu-iotests: cleanup and fix search for programs",
> which also preserves the behavior of searching for programs as symlinks
> in the current directory.
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2017-10-04 16:26 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-12 14:44 [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Paolo Bonzini
2017-09-12 14:44 ` [Qemu-devel] [PATCH 01/10] qemu-iotests: remove dead code Paolo Bonzini
2017-09-12 20:34 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 02/10] qemu-iotests: get rid of AWK_PROG Paolo Bonzini
2017-09-12 16:30 ` Philippe Mathieu-Daudé
2017-09-12 16:36 ` Paolo Bonzini
2017-09-12 20:45 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 03/10] qemu-iotests: move "check" code out of common.rc Paolo Bonzini
2017-09-12 21:03 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 04/10] qemu-iotests: cleanup and fix search for programs Paolo Bonzini
2017-09-12 21:11 ` Eric Blake
2017-09-12 21:26 ` Paolo Bonzini
2017-09-12 21:34 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc Paolo Bonzini
2017-09-12 21:15 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 06/10] qemu-iotests: do not include common.rc in "check" Paolo Bonzini
2017-09-12 21:16 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 07/10] qemu-iotests: disintegrate more parts of common.config Paolo Bonzini
2017-09-12 21:25 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 08/10] qemu-iotests: fix uninitialized variable Paolo Bonzini
2017-09-12 21:30 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 09/10] qemu-iotests: get rid of $iam Paolo Bonzini
2017-09-12 21:31 ` Eric Blake
2017-09-12 14:44 ` [Qemu-devel] [PATCH 10/10] qemu-iotests: merge "check" and "common" Paolo Bonzini
2017-09-12 21:34 ` Eric Blake
2017-09-13 6:47 ` [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests Thomas Huth
2017-09-13 7:59 ` Fam Zheng
2017-09-13 22:06 ` Paolo Bonzini
2017-09-13 22:14 ` Eric Blake
2017-10-02 12:32 ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2017-10-04 16:26 ` [Qemu-devel] " Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).