Skip to contentSkip to conversation

docker: Add test-block

PATCH Superseded Fam Zheng 5 participants 14 messages Aug 31, 2017 – Sep 1, 2017

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

v2 cover docker: Add test-block

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.

v2: Add nettle-devel because a few iotest cases blindly assumes the support is there.

Fam Zheng (3):
docker: Use unconfined security profile
docker: Add nettle-devel to fedora image
docker: Add test-block

 tests/docker/Makefile.include          |  1 +
 tests/docker/dockerfiles/fedora.docker |  1 +
 tests/docker/test-block                | 21 +++++++++++++++++++++
 3 files changed, 23 insertions(+)
 create mode 100755 tests/docker/test-block
Signature · 1 line
2.13.5
author
#1 lore raw

PATCH v2 1/3 docker: Use unconfined security profile

Some 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
index aaab1a4208..8ded838b20 100644
@@ -145,6 +145,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
author
#2 lore raw

PATCH v2 2/3 docker: Add nettle-devel to fedora image

In reply to Fam Zheng

The 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
index 4eaa8ed2a5..27e8201c54 100644
@@ -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
author
#3 lore raw

PATCH v2 3/3 docker: Add test-block

In reply to Fam Zheng
---
 tests/docker/test-block | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 tests/docker/test-block
tests/docker/test-block new file +21 -0
new file mode 100755
index 0000000000..20ef70538f
@@ -0,0 +1,21 @@
+#!/bin/bash -e
+#
+# Run block test cases
+#
+# Copyright (c) 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
+./check -raw
+./check -qcow2
Signature · 1 line
2.13.5
#4 lore raw

tests/docker/test-block line 21

Quoted 13 lines · Fam Zheng
---
 tests/docker/test-block | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 tests/docker/test-block
tests/docker/test-block new file +6 -0
+cd "$BUILD_DIR"
+
+build_qemu --target-list=x86_64-softmmu
+cd tests/qemu-iotests
+./check -raw
+./check -qcow2

Should we also run ./check -nbd?

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#5 lore raw
Quoted 8 lines · Eric Blake
Quoted 5 lines · Fam Zheng
---
 tests/docker/test-block | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 tests/docker/test-block
Quoted 8 lines

tests/docker/test-block line 21

Quoted 6 lines
tests/docker/test-block new file +6 -0
+cd "$BUILD_DIR"
+
+build_qemu --target-list=x86_64-softmmu
+cd tests/qemu-iotests
+./check -raw
+./check -qcow2

Should we also run ./check -nbd?

FWIW, yes, if it's not too onerous. Not least because many of the NBD-using block layer features are important storage virtualization features for management layers.

Signature · 1 line
/kashyap
author
#6 lore raw
In reply to Eric Blake
Quoted 8 lines · Eric Blake
Quoted 5 lines · Fam Zheng
---
 tests/docker/test-block | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 tests/docker/test-block
Quoted 8 lines

tests/docker/test-block line 21

Quoted 6 lines
tests/docker/test-block new file +6 -0
+cd "$BUILD_DIR"
+
+build_qemu --target-list=x86_64-softmmu
+cd tests/qemu-iotests
+./check -raw
+./check -qcow2

Should we also run ./check -nbd?

Yes, I can add it, and -g quick to all formats, so that the whole test is not lagged too badly, and that writing "quick" tests is encouraged in some degree.

Fam

#7 lore raw
Quoted 18 lines · Fam Zheng
Quoted 8 lines · Eric Blake
Quoted 5 lines · Fam Zheng
---
 tests/docker/test-block | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 tests/docker/test-block
Quoted 8 lines

tests/docker/test-block line 21

Quoted 6 lines
tests/docker/test-block new file +6 -0
+cd "$BUILD_DIR"
+
+build_qemu --target-list=x86_64-softmmu
+cd tests/qemu-iotests
+./check -raw
+./check -qcow2

Should we also run ./check -nbd?

Quoted 2 lines

Yes, I can add it, and -g quick to all formats, so that the whole test is not lagged too badly, and that writing "quick" tests is encouraged in some degree.

If you also add a "daily" test, you could make the daily one run all tests, while the per-commit one just uses 'quick'.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#8 lore raw
In reply to Fam Zheng
Quoted 23 lines · Fam Zheng
---
 tests/docker/test-block | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 tests/docker/test-block
tests/docker/test-block new file +11 -0
new file mode 100755
index 0000000000..20ef70538f
@@ -0,0 +1,21 @@
+#!/bin/bash -e
+#
+# Run block test cases
+#
+# Copyright (c) 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

tests/docker/test-block line 21

Quoted 10 lines
tests/docker/test-block new file +10 -0
+# the top-level directory.
+
+. common.rc
+
+cd "$BUILD_DIR"
+
+build_qemu --target-list=x86_64-softmmu
+cd tests/qemu-iotests
+./check -raw
+./check -qcow2

Could you add 'check -luks' - it should be passing already with git master. Ideally it wants password-less sudo enabled, but will skip the appropriate test if that's not there.

'qcow' (v1) was also passing last time I checked, though it is waaaaaay slow to run compared to qcow2, so I'd understand if you were reluctant to turn that on due to speed

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#9 lore raw
Quoted 4 lines · Daniel P. Berrange

'qcow' (v1) was also passing last time I checked, though it is waaaaaay slow to run compared to qcow2, so I'd understand if you were reluctant to turn that on due to speed

Even './check -qcow -g quick' might be nicer than nothing, but that is also slooooooow

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#10 lore raw
Quoted 8 lines · Eric Blake
Quoted 4 lines · Daniel P. Berrange

'qcow' (v1) was also passing last time I checked, though it is waaaaaay slow to run compared to qcow2, so I'd understand if you were reluctant to turn that on due to speed

Even './check -qcow -g quick' might be nicer than nothing, but that is also slooooooow

What about having a daily job running it on /master? Better than running it once before each release :)

author
#11 lore raw
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Eric Blake
Quoted 4 lines · Daniel P. Berrange

'qcow' (v1) was also passing last time I checked, though it is waaaaaay slow to run compared to qcow2, so I'd understand if you were reluctant to turn that on due to speed

Quoted 6 lines
Quoted 2 lines

Even './check -qcow -g quick' might be nicer than nothing, but that is also slooooooow

What about having a daily job running it on /master? Better than running it once before each release :)

Can Shippable or Travis cover that?

Fam

author
#12 lore raw
In reply to Daniel P. Berrange
Quoted 3 lines · Daniel P. Berrange

Could you add 'check -luks' - it should be passing already with git master. Ideally it wants password-less sudo enabled, but will skip the appropriate test if that's not there.

I have this failure:

192 - output mismatch (see 192.out.bad)

192.out.bad 2017-09-01 16:21:34.908390978 +0800 renamed from home/fam/work/qemu/tests/qemu-iotests/192.out 2017-08-31 15:12:00.044744485 +0800 +1 -4
@@ -1,7 +1,4 @@
 QA output created by 192
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) nbd_server_start unix:TEST_DIR/nbd
-(qemu) nbd_server_add -w drive0
-(qemu) q
+QEMU_PROG: -drive format=luks,file=driver=luks,key-secret=keysec0,file.filename=TEST_DIR/t.luks,if=ide,id=drive0: Can't specify 'file' and 'filename' options at the same time
 *** done

Failures: 192
Failed 1 of 1 tests

Fam

#13 lore raw
Quoted 6 lines · Fam Zheng
Quoted 3 lines · Daniel P. Berrange

Could you add 'check -luks' - it should be passing already with git master. Ideally it wants password-less sudo enabled, but will skip the appropriate test if that's not there.

I have this failure:

urgh, someone broke it already :-( that's why we need to run tests automatically :-) I'll see about a fix

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|