aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-09-12 16:44:56 +0200
committerKevin Wolf <kwolf@redhat.com>2017-10-06 16:28:58 +0200
commitcce293a29459e1fd5f74e55d87dc9c25991da578 (patch)
tree678b0609f67a54094bea588e7358e0ad4c8e5980 /tests/qemu-iotests/common
parent3817ce03bf3373065c25e389ecb7f23a511ebcdc (diff)
qemu-iotests: disintegrate more parts of common.config
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> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/common')
-rw-r--r--tests/qemu-iotests/common24
1 files changed, 24 insertions, 0 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"