tests: Add check-block to "make check"
v4 cover tests: Add check-block to "make check"
qemu-iotests contains useful tests that have a nice coverage of block layer code. Adding check-block (which calls tests/qemu-iotests-quick.sh) to "make check" is good for developers' self-testing.
v4: 06: Use CONFIG_LINUX instead of custom "uname" in tests/Makefile. (Peter)
v2: Take care of other platforms, basically by keeping them unchanged, and only
add "make check-block" to "make check" on Linux. (Peter)
Fam Zheng (7):
.gitignore: Ignore generated "common.env"
qemu-iotests: Remove 091 from quick group
qemu-iotests: Replace "/bin/true" with "true"
qemu-iotests: Add "_supported_os Linux" to 058
qemu-iotests: Speed up make check-block tests/Makefile: Add check-block to make check on Linux
qemu-iotests: Add supported os parameter for python tests
.gitignore | 1 + tests/Makefile | 3 +++ tests/qemu-iotests-quick.sh | 2 +- tests/qemu-iotests/058 | 1 + tests/qemu-iotests/check | 1 + tests/qemu-iotests/common.config | 2 +- tests/qemu-iotests/common.filter | 2 +- tests/qemu-iotests/common.rc | 2 +- tests/qemu-iotests/group | 2 +- tests/qemu-iotests/iotests.py | 5 ++++- 10 files changed, 15 insertions(+), 6 deletions(-)
Signature · 1 line
1.9.3
PATCH v4 1/7 .gitignore: Ignore generated "common.env"
--- .gitignore | 1 + 1 file changed, 1 insertion(+)
.gitignore +1 -0
@@ -109,3 +109,4 @@ cscope.* tags TAGS *~ +/tests/qemu-iotests/common.env
Signature · 1 line
1.9.3
PATCH v4 2/7 qemu-iotests: Remove 091 from quick group
In reply to Fam ZhengFor the purpose of allowing running quick group on tmpfs.
--- tests/qemu-iotests/group | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/group +1 -1
@@ -97,7 +97,7 @@ 088 rw auto quick 089 rw auto quick 090 rw auto quick -091 rw auto quick +091 rw auto 092 rw auto quick 095 rw auto quick 097 rw auto backing
Signature · 1 line
1.9.3
PATCH v4 3/7 qemu-iotests: Replace "/bin/true" with "true"
In reply to Fam ZhengThe former is not portable because on Mac OSX it is /usr/bin/true.
--- tests/qemu-iotests/common.config | 2 +- tests/qemu-iotests/common.filter | 2 +- tests/qemu-iotests/common.rc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
tests/qemu-iotests/common.config +1 -1
@@ -155,4 +155,4 @@ _readlink() } # make sure this script returns success -/bin/true +true
tests/qemu-iotests/common.filter +1 -1
@@ -223,4 +223,4 @@ _filter_qemu_img_map() } # make sure this script returns success -/bin/true +true
tests/qemu-iotests/common.rc +1 -1
@@ -490,4 +490,4 @@ _die() } # make sure this script returns success -/bin/true +true
Signature · 1 line
1.9.3
PATCH v4 4/7 qemu-iotests: Add "_supported_os Linux" to 058
In reply to Fam ZhengOther cases have this, and this test is not portable as well, as we want to add "make check-block" to "make check", it shouldn't fail on Mac OS X.
--- tests/qemu-iotests/058 | 1 + 1 file changed, 1 insertion(+)
tests/qemu-iotests/058 +1 -0
@@ -87,6 +87,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file +_supported_os Linux _require_command QEMU_NBD # Use -f raw instead of -f $IMGFMT for the NBD connection
Signature · 1 line
1.9.3
PATCH v4 5/7 qemu-iotests: Speed up make check-block
In reply to Fam ZhengUsing /tmp, which is usually mounted as tmpfs, the quick group can be quicker.
On my laptop (Lenovo T430s with Fedora 20), this reduces the time from 50s to 30s.
--- tests/qemu-iotests-quick.sh | 2 +- tests/qemu-iotests/check | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
tests/qemu-iotests-quick.sh +1 -1
@@ -3,6 +3,6 @@ cd tests/qemu-iotests ret=0 -./check -T -qcow2 -g quick || ret=1 +TEST_DIR=${TEST_DIR:-/tmp/qemu-iotests-quick-$$} ./check -T -qcow2 -g quick || ret=1 exit $ret
tests/qemu-iotests/check +1 -0
@@ -238,6 +238,7 @@ QEMU_NBD -- $QEMU_NBD IMGFMT -- $FULL_IMGFMT_DETAILS IMGPROTO -- $FULL_IMGPROTO_DETAILS PLATFORM -- $FULL_HOST_DETAILS +TEST_DIR -- $TEST_DIR SOCKET_SCM_HELPER -- $SOCKET_SCM_HELPER EOF
Signature · 1 line
1.9.3
PATCH v4 6/7 tests/Makefile: Add check-block to make check on Linux
In reply to Fam Zheng"make check-block" does nothing on other platforms, but still takes some time to enumerate all the tests. So let's only add it for Linux for now.
--- tests/Makefile | 3 +++ 1 file changed, 3 insertions(+)
tests/Makefile +3 -0
@@ -467,6 +467,9 @@ check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS)) check-unit: $(patsubst %,check-%, $(check-unit-y)) check-block: $(patsubst %,check-%, $(check-block-y)) check: check-qapi-schema check-unit check-qtest +ifeq ($(CONFIG_LINUX),y) +check: check-block +endif check-clean: $(MAKE) -C tests/tcg clean rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
Signature · 1 line
1.9.3
Re: [Qemu-devel] [PATCH v4 6/7] tests/Makefile: Add check-block to make check on Linux
Quoted 7 lines · Fam Zheng
"make check-block" does nothing on other platforms, but still takes some time to enumerate all the tests. So let's only add it for Linux for now.
Signed-off-by Fam Zheng <[email protected]>--- tests/Makefile | 3 +++ 1 file changed, 3 insertions(+)
Dropped from the block pull request because it fails on ARM hosts, as mentioned by Peter Maydell in my block pull request email thread.
Stefan
PATCH v4 7/7 qemu-iotests: Add supported os parameter for python tests
In reply to Fam ZhengIf I understand correctly, qemu-iotests never meant to be portable. We only support Linux for all the shell cases, but didn't specify it for python tests. Now add this and default all the python tests as Linux only. If we cares enough later, we can override the parameter in individual cases.
--- tests/qemu-iotests/iotests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tests/qemu-iotests/iotests.py +4 -1
@@ -282,12 +282,15 @@ def notrun(reason): print '%s not run: %s' % (seq, reason) sys.exit(0) -def main(supported_fmts=[]): +def main(supported_fmts=[], supported_oses=['linux']): '''Run tests''' if supported_fmts and (imgfmt not in supported_fmts): notrun('not suitable for this image format: %s' % imgfmt) + if sys.platform not in supported_oses: + notrun('not suitable for this OS: %s' % sys.platform) + # We need to filter out the time taken from the output so that qemu-iotest # can reliably diff the results against master output. import StringIO
Signature · 1 line
1.9.3
Stefan Hajnoczi
AppliedQuoted 19 lines · Fam Zheng
qemu-iotests contains useful tests that have a nice coverage of block layer code. Adding check-block (which calls
tests/qemu-iotests-quick.sh) to "make check" is good for developers' self-testing.v4: 06: Use
CONFIG_LINUXinstead of custom "uname" in tests/Makefile. (Peter)v2: Take care of other platforms, basically by keeping them unchanged, and only
add "make check-block" to "make check" on Linux. (Peter)Fam Zheng (7):
.gitignore: Ignore generated "common.env"
qemu-iotests: Remove 091 from quick group
qemu-iotests: Replace "/bin/true" with "true"
qemu-iotests: Add "_supported_osLinux" to 058
qemu-iotests: Speed up make check-block tests/Makefile: Add check-block to make check on Linux
qemu-iotests: Add supported os parameter for python tests
Quoted 16 lines
.gitignore | 1 + tests/Makefile | 3 +++ tests/qemu-iotests-quick.sh | 2 +- tests/qemu-iotests/058 | 1 + tests/qemu-iotests/check | 1 + tests/qemu-iotests/common.config | 2 +- tests/qemu-iotests/common.filter | 2 +- tests/qemu-iotests/common.rc | 2 +- tests/qemu-iotests/group | 2 +- tests/qemu-iotests/iotests.py | 5 ++++- 10 files changed, 15 insertions(+), 6 deletions(-)Signature · 1 line
1.9.3
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan