All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/3] docker: Add test-block
@ 2017-09-01 15:21 Fam Zheng
  2017-09-01 15:21 ` [Qemu-devel] [PATCH v3 1/3] docker: Use unconfined security profile Fam Zheng
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Fam Zheng @ 2017-09-01 15:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: berrange, kchamart, Fam Zheng, Alex Bennée,
	Philippe Mathieu-Daudé,
	eblake

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.

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 (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                | 22 ++++++++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100755 tests/docker/test-block

-- 
2.13.5

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH v3 1/3] docker: Use unconfined security profile
  2017-09-01 15:21 [Qemu-devel] [PATCH v3 0/3] docker: Add test-block Fam Zheng
@ 2017-09-01 15:21 ` Fam Zheng
  2017-09-01 15:21 ` [Qemu-devel] [PATCH v3 2/3] docker: Add nettle-devel to fedora image Fam Zheng
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2017-09-01 15:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: berrange, kchamart, Fam Zheng, Alex Bennée,
	Philippe Mathieu-Daudé,
	eblake

Some by default blocked syscalls are required to run tests for example
userfaultfd.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/docker/Makefile.include | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index aaab1a4208..8ded838b20 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -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) \
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH v3 2/3] docker: Add nettle-devel to fedora image
  2017-09-01 15:21 [Qemu-devel] [PATCH v3 0/3] docker: Add test-block Fam Zheng
  2017-09-01 15:21 ` [Qemu-devel] [PATCH v3 1/3] docker: Use unconfined security profile Fam Zheng
@ 2017-09-01 15:21 ` Fam Zheng
  2017-09-01 15:22 ` [Qemu-devel] [PATCH v3 3/3] docker: Add test-block Fam Zheng
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2017-09-01 15:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: berrange, kchamart, Fam Zheng, Alex Bennée,
	Philippe Mathieu-Daudé,
	eblake

The LUKS cases in qemu-iotests requires this.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/docker/dockerfiles/fedora.docker | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 4eaa8ed2a5..27e8201c54 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -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 \
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH v3 3/3] docker: Add test-block
  2017-09-01 15:21 [Qemu-devel] [PATCH v3 0/3] docker: Add test-block Fam Zheng
  2017-09-01 15:21 ` [Qemu-devel] [PATCH v3 1/3] docker: Use unconfined security profile Fam Zheng
  2017-09-01 15:21 ` [Qemu-devel] [PATCH v3 2/3] docker: Add nettle-devel to fedora image Fam Zheng
@ 2017-09-01 15:22 ` Fam Zheng
  2017-09-01 18:35   ` Eric Blake
  2017-09-01 15:41 ` [Qemu-devel] [PATCH v3 0/3] " Kashyap Chamarthy
  2017-09-01 20:18 ` Eric Blake
  4 siblings, 1 reply; 8+ messages in thread
From: Fam Zheng @ 2017-09-01 15:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: berrange, kchamart, Fam Zheng, Alex Bennée,
	Philippe Mathieu-Daudé,
	eblake

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/docker/test-block | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 tests/docker/test-block

diff --git a/tests/docker/test-block b/tests/docker/test-block
new file mode 100755
index 0000000000..efc77b4b91
--- /dev/null
+++ b/tests/docker/test-block
@@ -0,0 +1,22 @@
+#!/bin/bash -e
+#
+# Run block test cases
+#
+# Copyright (c) 2017 Red Hat Inc.
+#
+# Authors:
+#  Fam Zheng <famz@redhat.com>
+#
+# 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
+done
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/3] docker: Add test-block
  2017-09-01 15:21 [Qemu-devel] [PATCH v3 0/3] docker: Add test-block Fam Zheng
                   ` (2 preceding siblings ...)
  2017-09-01 15:22 ` [Qemu-devel] [PATCH v3 3/3] docker: Add test-block Fam Zheng
@ 2017-09-01 15:41 ` Kashyap Chamarthy
  2017-09-01 20:18 ` Eric Blake
  4 siblings, 0 replies; 8+ messages in thread
From: Kashyap Chamarthy @ 2017-09-01 15:41 UTC (permalink / raw)
  To: Fam Zheng
  Cc: qemu-devel, berrange, Alex Bennée,
	Philippe Mathieu-Daudé,
	eblake

On Fri, Sep 01, 2017 at 11:21:57PM +0800, Fam Zheng wrote:
> 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.
> 
> 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 (3):
>   docker: Use unconfined security profile
>   docker: Add nettle-devel to fedora image
>   docker: Add test-block

All three of the patches look good to me.  FWIW:

Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>


>  tests/docker/Makefile.include          |  1 +
>  tests/docker/dockerfiles/fedora.docker |  1 +
>  tests/docker/test-block                | 22 ++++++++++++++++++++++
>  3 files changed, 24 insertions(+)
>  create mode 100755 tests/docker/test-block
> 
> -- 
> 2.13.5
> 

-- 
/kashyap

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v3 3/3] docker: Add test-block
  2017-09-01 15:22 ` [Qemu-devel] [PATCH v3 3/3] docker: Add test-block Fam Zheng
@ 2017-09-01 18:35   ` Eric Blake
  2017-09-05  2:30     ` Fam Zheng
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Blake @ 2017-09-01 18:35 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel
  Cc: berrange, kchamart, Alex Bennée, Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]

On 09/01/2017 10:22 AM, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/docker/test-block | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>  create mode 100755 tests/docker/test-block
> 
> diff --git a/tests/docker/test-block b/tests/docker/test-block
> new file mode 100755
> index 0000000000..efc77b4b91
> --- /dev/null
> +++ b/tests/docker/test-block
> @@ -0,0 +1,22 @@
> +#!/bin/bash -e

'set -e' is awful; it exists for backwards-compatibility with shell
scripts that pre-date functions, but is NOT intuitive and generally does
NOT do what you want when shell functions are added to the mix.  You're
better off doing manual error checking than relying on 'set -e' to check
for errors on your behalf.

> +#
> +# Run block test cases
> +#
> +# Copyright (c) 2017 Red Hat Inc.
> +#
> +# Authors:
> +#  Fam Zheng <famz@redhat.com>
> +#
> +# 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

Are we sure that '.' is early enough on $PATH that this will pick up the
right common.rc? Safer is '. ./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
> +done

That said, this script (and common.rc) is small enough to verify that
you probably aren't going to trip over those non-intuitive 'set -e'
behaviors, so the real reason to avoid it is if we want to be able to
copy-and-paste into other scripts that aren't using 'set -e' (on the
premise that avoiding implicit global state, like 'set -e', and being
explicit instead, is a good thing).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/3] docker: Add test-block
  2017-09-01 15:21 [Qemu-devel] [PATCH v3 0/3] docker: Add test-block Fam Zheng
                   ` (3 preceding siblings ...)
  2017-09-01 15:41 ` [Qemu-devel] [PATCH v3 0/3] " Kashyap Chamarthy
@ 2017-09-01 20:18 ` Eric Blake
  4 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2017-09-01 20:18 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel
  Cc: berrange, kchamart, Alex Bennée, Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

On 09/01/2017 10:21 AM, Fam Zheng wrote:
> 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.
> 
> 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 (3):
>   docker: Use unconfined security profile
>   docker: Add nettle-devel to fedora image
>   docker: Add test-block

Based-on: <20170901105434.3288-1-berrange@redhat.com>
([PATCH 0/2] Fix / skip recent iotests with LUKS driver)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v3 3/3] docker: Add test-block
  2017-09-01 18:35   ` Eric Blake
@ 2017-09-05  2:30     ` Fam Zheng
  0 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2017-09-05  2:30 UTC (permalink / raw)
  To: Eric Blake
  Cc: qemu-devel, Alex Bennée, Philippe Mathieu-Daudé, kchamart

On Fri, 09/01 13:35, Eric Blake wrote:
> On 09/01/2017 10:22 AM, Fam Zheng wrote:
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  tests/docker/test-block | 22 ++++++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> >  create mode 100755 tests/docker/test-block
> > 
> > diff --git a/tests/docker/test-block b/tests/docker/test-block
> > new file mode 100755
> > index 0000000000..efc77b4b91
> > --- /dev/null
> > +++ b/tests/docker/test-block
> > @@ -0,0 +1,22 @@
> > +#!/bin/bash -e
> 
> 'set -e' is awful; it exists for backwards-compatibility with shell
> scripts that pre-date functions, but is NOT intuitive and generally does
> NOT do what you want when shell functions are added to the mix.  You're
> better off doing manual error checking than relying on 'set -e' to check
> for errors on your behalf.
> 
> > +#
> > +# Run block test cases
> > +#
> > +# Copyright (c) 2017 Red Hat Inc.
> > +#
> > +# Authors:
> > +#  Fam Zheng <famz@redhat.com>
> > +#
> > +# 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
> 
> Are we sure that '.' is early enough on $PATH that this will pick up the
> right common.rc? Safer is '. ./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
> > +done
> 
> That said, this script (and common.rc) is small enough to verify that
> you probably aren't going to trip over those non-intuitive 'set -e'
> behaviors, so the real reason to avoid it is if we want to be able to
> copy-and-paste into other scripts that aren't using 'set -e' (on the
> premise that avoiding implicit global state, like 'set -e', and being
> explicit instead, is a good thing).

OK, I will revise this patch and drop set -e.

Fam

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-05  2:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 15:21 [Qemu-devel] [PATCH v3 0/3] docker: Add test-block Fam Zheng
2017-09-01 15:21 ` [Qemu-devel] [PATCH v3 1/3] docker: Use unconfined security profile Fam Zheng
2017-09-01 15:21 ` [Qemu-devel] [PATCH v3 2/3] docker: Add nettle-devel to fedora image Fam Zheng
2017-09-01 15:22 ` [Qemu-devel] [PATCH v3 3/3] docker: Add test-block Fam Zheng
2017-09-01 18:35   ` Eric Blake
2017-09-05  2:30     ` Fam Zheng
2017-09-01 15:41 ` [Qemu-devel] [PATCH v3 0/3] " Kashyap Chamarthy
2017-09-01 20:18 ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.