docker: Add test-block
v4 cover docker: Add test-block
Based-on: [email protected]
([PATCH v6 00/12] tests: Add VM based build tests (for non-x86_64 and/or non-Linux))
A few tweaks to the docker images and running commands allow us to run qemu-iotests in the fedora container. This will be added to the patchew test cases later.
v4: Don't use 'set -e'. [Eric]
Add Kashyap's rev-by to unchanged patches.
v3: Add nbd, luks and limit to quick group.
v2: Add nettle-devel because a few iotest cases blindly assumes the support is there.
Fam Zheng (6):
docker: Fix return code of build_qemu()
docker: Add test_fail and prep_fail
docker: Use unconfined security profile
docker: Add nettle-devel to fedora image
docker: Add test-block
docker: Drop 'set -e' from run script
tests/docker/Makefile.include | 1 + tests/docker/common.rc | 15 +++++++++++++-- tests/docker/dockerfiles/fedora.docker | 1 + tests/docker/run | 8 +++----- tests/docker/test-block | 22 ++++++++++++++++++++++ 5 files changed, 40 insertions(+), 7 deletions(-) create mode 100755 tests/docker/test-block
Signature · 1 line
2.13.5
PATCH v4 1/6 docker: Fix return code of build_qemu()
Without "set -e", the "&&" makes sure that the return code reflects the result status, and that make only runs if configure succeeds.
--- tests/docker/common.rc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tests/docker/common.rc +1 -2
@@ -33,6 +33,5 @@ build_qemu() $@" echo "Configure options:" echo $config_opts - $QEMU_SRC/configure $config_opts - make $MAKEFLAGS + $QEMU_SRC/configure $config_opts && make $MAKEFLAGS }
Signature · 1 line
2.13.5
PATCH v4 2/6 docker: Add test_fail and prep_fail
In reply to Fam ZhengThey both print a message and exit, but with different status code so distinguish real test errors from env preparation failures.
--- tests/docker/common.rc | 12 ++++++++++++ 1 file changed, 12 insertions(+)
tests/docker/common.rc +12 -0
@@ -35,3 +35,15 @@ build_qemu() echo $config_opts $QEMU_SRC/configure $config_opts && make $MAKEFLAGS } + +test_fail() +{ + echo "$@" + exit 1 +} + +prep_fail() +{ + echo "$@" + exit 2 +}
Signature · 1 line
2.13.5
PATCH v4 3/6 docker: Use unconfined security profile
In reply to Fam ZhengSome by default blocked syscalls are required to run tests for example userfaultfd.
--- tests/docker/Makefile.include | 1 + 1 file changed, 1 insertion(+)
tests/docker/Makefile.include +1 -0
@@ -134,6 +134,7 @@ docker-run: docker-qemu-src $(call quiet-command, \ $(SRC_PATH)/tests/docker/docker.py run \ $(if $(NOUSER),,-u $(shell id -u)) -t \ + --security-opt seccomp=unconfined \ $(if $V,,--rm) \ $(if $(DEBUG),-i,) \ $(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \
Signature · 1 line
2.13.5
PATCH v4 4/6 docker: Add nettle-devel to fedora image
In reply to Fam ZhengThe LUKS cases in qemu-iotests requires this.
--- tests/docker/dockerfiles/fedora.docker | 1 + 1 file changed, 1 insertion(+)
tests/docker/dockerfiles/fedora.docker +1 -0
@@ -3,6 +3,7 @@ ENV PACKAGES \ ccache git tar PyYAML sparse flex bison python2 bzip2 hostname \ glib2-devel pixman-devel zlib-devel SDL-devel libfdt-devel \ gcc gcc-c++ clang make perl which bc findutils libaio-devel \ + nettle-devel \ mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config \ mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1 \ mingw32-libjpeg-turbo mingw32-libpng mingw32-curl mingw32-libssh2 \
Signature · 1 line
2.13.5
PATCH v4 5/6 docker: Add test-block
In reply to Fam Zheng--- tests/docker/test-block | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tests/docker/test-block
tests/docker/test-block new file +22 -0
@@ -0,0 +1,22 @@ +#!/bin/bash +# +# Run block test cases +# +# Copyright 2017 Red Hat Inc. +# +# Authors: +# Fam Zheng <[email protected]> +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or (at your option) any later version. See the COPYING file in +# the top-level directory. + +. ./common.rc + +cd "$BUILD_DIR" + +build_qemu --target-list=x86_64-softmmu +cd tests/qemu-iotests +for t in raw qcow2 nbd luks; do + ./check -g quick -$t || test_fail "Test failed: iotests $t" +done
Signature · 1 line
2.13.5
PATCH v4 6/6 docker: Drop 'set -e' from run script
In reply to Fam Zheng--- tests/docker/run | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
tests/docker/run +3 -5
@@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash # # Docker test runner #
@@ -11,8 +11,6 @@ # or (at your option) any later version. See the COPYING file in # the top-level directory. -set -e - if test -n "$V"; then set -x fi
@@ -20,7 +18,7 @@ fi BASE="$(dirname $(readlink -e $0))" # Prepare the environment -. /etc/profile || true +. /etc/profile export PATH=/usr/lib/ccache:$PATH if test -n "$J"; then
@@ -32,7 +30,7 @@ export TEST_DIR=/tmp/qemu-test mkdir -p $TEST_DIR/{src,build,install} # Extract the source tarballs -tar -C $TEST_DIR/src -xf $BASE/qemu.tar +tar -C $TEST_DIR/src -xf $BASE/qemu.tar || prep_fail "Failed to untar source" if test -n "$SHOW_ENV"; then if test -f /packages.txt; then
Signature · 1 line
2.13.5
Quoted 24 lines · Fam Zheng
Based-on: [email protected]
([PATCH v6 00/12] tests: Add VM based build tests (for non-x86_64 and/or non-Linux))A few tweaks to the docker images and running commands allow us to run qemu-iotests in the fedora container. This will be added to the patchew test cases later.
v4: Don't use 'set -e'. [Eric]
Add Kashyap's rev-by to unchanged patches.v3: Add nbd, luks and limit to quick group.
v2: Add nettle-devel because a few iotest cases blindly assumes the support is there.
Fam Zheng (6):
docker: Fix return code ofbuild_qemu()
docker: Addtest_failandprep_fail
docker: Use unconfined security profile
docker: Add nettle-devel to fedora image
docker: Add test-block
docker: Drop 'set -e' from run script
Quoted 12 lines
tests/docker/Makefile.include | 1 + tests/docker/common.rc | 15 +++++++++++++-- tests/docker/dockerfiles/fedora.docker | 1 + tests/docker/run | 8 +++----- tests/docker/test-block | 22 ++++++++++++++++++++++ 5 files changed, 40 insertions(+), 7 deletions(-) create mode 100755 tests/docker/test-blockSignature · 1 line
2.13.5