From 3811f63acdc0584e053d09f7070063ed0a9bafe6 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 8 Mar 2012 12:26:52 +0100 Subject: qemu-iotests: Mark some tests as quick This creates a new test group 'quick' for some test case that take at most a couple of seconds each, so that the group can be run during a quick 'make check' Signed-off-by: Kevin Wolf --- tests/qemu-iotests/group | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index fcf869d..b549f10 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -8,32 +8,32 @@ # test-group association ... one line per test # 001 rw auto -002 rw auto +002 rw auto quick 003 rw auto -004 rw auto +004 rw auto quick 005 img auto 006 img auto 007 snapshot auto 008 rw auto 009 rw auto 010 rw auto -011 rw auto -012 auto +011 rw auto quick +012 auto quick 013 rw auto 014 rw auto 015 rw snapshot auto -016 rw auto -017 rw backing auto +016 rw auto quick +017 rw backing auto quick 018 rw backing auto -019 rw backing auto -020 rw backing auto +019 rw backing auto quick +020 rw backing auto quick 021 io auto 022 rw snapshot auto 023 rw auto -024 rw backing auto -025 rw auto +024 rw backing auto quick +025 rw auto quick 026 rw blkdbg auto -027 rw auto +027 rw auto quick 028 rw backing auto -029 rw auto +029 rw auto quick 030 rw auto -- cgit v1.1 From 8959449bb9b16e3b19cf35823d3358eb7d461210 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 8 Mar 2012 12:29:00 +0100 Subject: make check: Add qemu-iotests subset Run the 'quick' group from qemu-iotests during 'make check'. Signed-off-by: Kevin Wolf --- tests/Makefile | 5 +++++ tests/qemu-iotests-quick.sh | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 tests/qemu-iotests-quick.sh (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 74b29dc..571ad42 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,9 @@ +export SRC_PATH + CHECKS = check-qdict check-qfloat check-qint check-qstring check-qlist CHECKS += check-qjson test-qmp-output-visitor test-qmp-input-visitor CHECKS += test-string-input-visitor test-string-output-visitor test-coroutine +CHECKS += $(SRC_PATH)/tests/qemu-iotests-quick.sh check-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o test-coroutine.o: $(GENERATED_HEADERS) @@ -42,6 +45,8 @@ test-qmp-input-visitor: test-qmp-input-visitor.o $(qobject-obj-y) $(qapi-obj-y) test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h test-qmp-marshal.c test-qmp-commands.h) $(qapi-obj-y) test-qmp-commands: test-qmp-commands.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o +$(SRC_PATH)/tests/qemu-iotests-quick.sh: qemu-img qemu-io + .PHONY: check check: $(CHECKS) $(call quiet-command, gtester $(CHECKS), " CHECK") diff --git a/tests/qemu-iotests-quick.sh b/tests/qemu-iotests-quick.sh new file mode 100755 index 0000000..cf90de0 --- /dev/null +++ b/tests/qemu-iotests-quick.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# We don't know which of the system emulator binaries there is (or if there is +# any at all), so the 'quick' group doesn't contain any tests that require +# running qemu proper. Assign a fake binary name so that qemu-iotests doesn't +# complain about the missing binary. +export QEMU_PROG="this_should_be_unused" + +export QEMU_IMG_PROG="$(pwd)/qemu-img" +export QEMU_IO_PROG="$(pwd)/qemu-io" + +cd $SRC_PATH/tests/qemu-iotests + +ret=0 +./check -T -nocache -qcow2 -g quick || ret=1 + +exit $ret -- cgit v1.1 From b8c6f29eb84cd3ccbbf23a5951224ae33f11116b Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 9 Mar 2012 13:37:40 +0100 Subject: Add 'make check-block' Runs the full qemu-iotests suite for various image formats. Signed-off-by: Kevin Wolf --- tests/Makefile | 7 ++++++- tests/check-block.sh | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 tests/check-block.sh (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 571ad42..c78ade1 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -47,6 +47,11 @@ test-qmp-commands: test-qmp-commands.o $(qobject-obj-y) $(qapi-obj-y) $(tools-ob $(SRC_PATH)/tests/qemu-iotests-quick.sh: qemu-img qemu-io -.PHONY: check + +.PHONY: check check-block + check: $(CHECKS) $(call quiet-command, gtester $(CHECKS), " CHECK") + +check-block: + $(call quiet-command, $(SHELL) $(SRC_PATH)/tests/check-block.sh , " CHECK") diff --git a/tests/check-block.sh b/tests/check-block.sh new file mode 100755 index 0000000..b9d9c6a --- /dev/null +++ b/tests/check-block.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +export QEMU_PROG="$(pwd)/x86_64-softmmu/qemu-system-x86_64" +export QEMU_IMG_PROG="$(pwd)/qemu-img" +export QEMU_IO_PROG="$(pwd)/qemu-io" + +if [ ! -x $QEMU_PROG ]; then + echo "'make check-block' requires qemu-system-x86_64" + exit 1 +fi + +cd $SRC_PATH/tests/qemu-iotests + +ret=0 +./check -T -nocache -raw || ret=1 +./check -T -nocache -qcow2 || ret=1 +./check -T -nocache -qed|| ret=1 +./check -T -nocache -vmdk|| ret=1 +./check -T -nocache -vpc || ret=1 + +exit $ret -- cgit v1.1