All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] docker: Add test-block
@ 2017-05-05  3:23 Fam Zheng
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 1/5] docker: Run tests with current user Fam Zheng
                   ` (5 more replies)
  0 siblings, 6 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  3:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Alex Bennée

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.

Fam Zheng (5):
  docker: Run tests with current user
  docker: Add bzip2 and hostname to fedora image
  docker: Use unconfined security profile
  docker: Add libaio to fedora image
  docker: Add test-block

 tests/docker/Makefile.include          |  3 ++-
 tests/docker/dockerfiles/fedora.docker |  4 ++--
 tests/docker/test-block                | 21 +++++++++++++++++++++
 3 files changed, 25 insertions(+), 3 deletions(-)
 create mode 100755 tests/docker/test-block

-- 
2.9.3

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

* [Qemu-devel] [PATCH 1/5] docker: Run tests with current user
  2017-05-05  3:23 [Qemu-devel] [PATCH 0/5] docker: Add test-block Fam Zheng
@ 2017-05-05  3:23 ` Fam Zheng
  2017-05-05  8:25   ` Alex Bennée
  2017-05-06 16:25   ` Philippe Mathieu-Daudé
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 2/5] docker: Add bzip2 and hostname to fedora image Fam Zheng
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  3:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Alex Bennée

We've used --add-current-user to create a user in the image, use it to
run tests, because root has too much priviledge, and can surprise test
cases.

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

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 03eda37..0ed8c3d 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -126,7 +126,7 @@ docker-run: docker-qemu-src
 			"  COPYING $(EXECUTABLE) to $(IMAGE)"))
 	$(call quiet-command,						\
 		$(SRC_PATH)/tests/docker/docker.py run 			\
-			-t 						\
+			$(if $(NOUSER),,-u $(shell id -u)) -t 		\
 			$(if $V,,--rm) 					\
 			$(if $(DEBUG),-i,--net=none) 			\
 			-e TARGET_LIST=$(TARGET_LIST) 			\
-- 
2.9.3

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

* [Qemu-devel] [PATCH 2/5] docker: Add bzip2 and hostname to fedora image
  2017-05-05  3:23 [Qemu-devel] [PATCH 0/5] docker: Add test-block Fam Zheng
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 1/5] docker: Run tests with current user Fam Zheng
@ 2017-05-05  3:23 ` Fam Zheng
  2017-05-05  8:25   ` Alex Bennée
  2017-05-06 16:34   ` Philippe Mathieu-Daudé
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile Fam Zheng
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  3:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Alex Bennée

It is used by qemu-iotests.

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

diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index c4f80ad..39f6b58 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -1,6 +1,6 @@
 FROM fedora:latest
 ENV PACKAGES \
-    ccache git tar PyYAML sparse flex bison python2 \
+    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 \
     mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config \
-- 
2.9.3

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

* [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile
  2017-05-05  3:23 [Qemu-devel] [PATCH 0/5] docker: Add test-block Fam Zheng
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 1/5] docker: Run tests with current user Fam Zheng
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 2/5] docker: Add bzip2 and hostname to fedora image Fam Zheng
@ 2017-05-05  3:23 ` Fam Zheng
  2017-05-05  8:27   ` Alex Bennée
  2017-05-06 16:33   ` Philippe Mathieu-Daudé
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 4/5] docker: Add libaio to fedora image Fam Zheng
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  3:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Alex Bennée

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 0ed8c3d..09d157c 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -127,6 +127,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,--net=none) 			\
 			-e TARGET_LIST=$(TARGET_LIST) 			\
-- 
2.9.3

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

* [Qemu-devel] [PATCH 4/5] docker: Add libaio to fedora image
  2017-05-05  3:23 [Qemu-devel] [PATCH 0/5] docker: Add test-block Fam Zheng
                   ` (2 preceding siblings ...)
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile Fam Zheng
@ 2017-05-05  3:23 ` Fam Zheng
  2017-05-05  8:27   ` Alex Bennée
  2017-05-06 16:26   ` Philippe Mathieu-Daudé
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 5/5] docker: Add test-block Fam Zheng
  2017-05-05  7:44 ` [Qemu-devel] [PATCH 0/5] " Paolo Bonzini
  5 siblings, 2 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  3:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Alex Bennée

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

diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 39f6b58..4eaa8ed 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -2,7 +2,7 @@ FROM fedora:latest
 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 \
+    gcc gcc-c++ clang make perl which bc findutils libaio-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.9.3

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

* [Qemu-devel] [PATCH 5/5] docker: Add test-block
  2017-05-05  3:23 [Qemu-devel] [PATCH 0/5] docker: Add test-block Fam Zheng
                   ` (3 preceding siblings ...)
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 4/5] docker: Add libaio to fedora image Fam Zheng
@ 2017-05-05  3:23 ` Fam Zheng
  2017-05-05  8:28   ` Alex Bennée
                     ` (2 more replies)
  2017-05-05  7:44 ` [Qemu-devel] [PATCH 0/5] " Paolo Bonzini
  5 siblings, 3 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  3:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Alex Bennée

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/docker/test-block | 21 +++++++++++++++++++++
 1 file changed, 21 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 0000000..20ef705
--- /dev/null
+++ b/tests/docker/test-block
@@ -0,0 +1,21 @@
+#!/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
+./check -raw
+./check -qcow2
-- 
2.9.3

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

* Re: [Qemu-devel] [PATCH 0/5] docker: Add test-block
  2017-05-05  3:23 [Qemu-devel] [PATCH 0/5] docker: Add test-block Fam Zheng
                   ` (4 preceding siblings ...)
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 5/5] docker: Add test-block Fam Zheng
@ 2017-05-05  7:44 ` Paolo Bonzini
  2017-05-05  8:05   ` Fam Zheng
  2017-05-08 15:55   ` Daniel P. Berrange
  5 siblings, 2 replies; 25+ messages in thread
From: Paolo Bonzini @ 2017-05-05  7:44 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Alex Bennée



On 05/05/2017 05:23, 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.
> 
> Fam Zheng (5):
>   docker: Run tests with current user
>   docker: Add bzip2 and hostname to fedora image
>   docker: Use unconfined security profile
>   docker: Add libaio to fedora image
>   docker: Add test-block
> 
>  tests/docker/Makefile.include          |  3 ++-
>  tests/docker/dockerfiles/fedora.docker |  4 ++--
>  tests/docker/test-block                | 21 +++++++++++++++++++++
>  3 files changed, 25 insertions(+), 3 deletions(-)
>  create mode 100755 tests/docker/test-block
> 

Patches 1-4:

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

For patch 5, I think we should revive the "quick" qemu-iotests group
(maybe we can have support for skipping groups, and have a "slow" group
with the very few tests that take >30 seconds?) and add the quick tests
to "make check".

Paolo

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

* Re: [Qemu-devel] [PATCH 0/5] docker: Add test-block
  2017-05-05  7:44 ` [Qemu-devel] [PATCH 0/5] " Paolo Bonzini
@ 2017-05-05  8:05   ` Fam Zheng
  2017-05-05  8:07     ` Paolo Bonzini
  2017-05-08 15:55   ` Daniel P. Berrange
  1 sibling, 1 reply; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  8:05 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Alex Bennée

On Fri, 05/05 09:44, Paolo Bonzini wrote:
> 
> 
> On 05/05/2017 05:23, 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.
> > 
> > Fam Zheng (5):
> >   docker: Run tests with current user
> >   docker: Add bzip2 and hostname to fedora image
> >   docker: Use unconfined security profile
> >   docker: Add libaio to fedora image
> >   docker: Add test-block
> > 
> >  tests/docker/Makefile.include          |  3 ++-
> >  tests/docker/dockerfiles/fedora.docker |  4 ++--
> >  tests/docker/test-block                | 21 +++++++++++++++++++++
> >  3 files changed, 25 insertions(+), 3 deletions(-)
> >  create mode 100755 tests/docker/test-block
> > 
> 
> Patches 1-4:
> 
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> For patch 5, I think we should revive the "quick" qemu-iotests group
> (maybe we can have support for skipping groups, and have a "slow" group
> with the very few tests that take >30 seconds?) and add the quick tests
> to "make check".

Sounds like a good idea, but for a separate series, IMO.

The idea of the new test-block is to include all qemu-iotests tests.  I only
added raw and qcow2 because vmdk etc. fails case 181. I could use "-x" but
that's a bit ugly - they can wait for the fix.

Fam

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

* Re: [Qemu-devel] [PATCH 0/5] docker: Add test-block
  2017-05-05  8:05   ` Fam Zheng
@ 2017-05-05  8:07     ` Paolo Bonzini
  2017-05-05  8:52       ` Fam Zheng
  0 siblings, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2017-05-05  8:07 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, Alex Bennée



On 05/05/2017 10:05, Fam Zheng wrote:
>> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
>>
>> For patch 5, I think we should revive the "quick" qemu-iotests group
>> (maybe we can have support for skipping groups, and have a "slow" group
>> with the very few tests that take >30 seconds?) and add the quick tests
>> to "make check".
> Sounds like a good idea, but for a separate series, IMO.
> 
> The idea of the new test-block is to include all qemu-iotests tests.  I only
> added raw and qcow2 because vmdk etc. fails case 181. I could use "-x" but
> that's a bit ugly - they can wait for the fix.

I think that would still be a bit too slow for patchew?

Paolo

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

* Re: [Qemu-devel] [PATCH 1/5] docker: Run tests with current user
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 1/5] docker: Run tests with current user Fam Zheng
@ 2017-05-05  8:25   ` Alex Bennée
  2017-05-06 16:25   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 25+ messages in thread
From: Alex Bennée @ 2017-05-05  8:25 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel


Fam Zheng <famz@redhat.com> writes:

> We've used --add-current-user to create a user in the image, use it to
> run tests, because root has too much priviledge, and can surprise test
> cases.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  tests/docker/Makefile.include | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 03eda37..0ed8c3d 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -126,7 +126,7 @@ docker-run: docker-qemu-src
>  			"  COPYING $(EXECUTABLE) to $(IMAGE)"))
>  	$(call quiet-command,						\
>  		$(SRC_PATH)/tests/docker/docker.py run 			\
> -			-t 						\
> +			$(if $(NOUSER),,-u $(shell id -u)) -t 		\
>  			$(if $V,,--rm) 					\
>  			$(if $(DEBUG),-i,--net=none) 			\
>  			-e TARGET_LIST=$(TARGET_LIST) 			\


--
Alex Bennée

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

* Re: [Qemu-devel] [PATCH 2/5] docker: Add bzip2 and hostname to fedora image
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 2/5] docker: Add bzip2 and hostname to fedora image Fam Zheng
@ 2017-05-05  8:25   ` Alex Bennée
  2017-05-06 16:34   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 25+ messages in thread
From: Alex Bennée @ 2017-05-05  8:25 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel


Fam Zheng <famz@redhat.com> writes:

> It is used by qemu-iotests.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  tests/docker/dockerfiles/fedora.docker | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
> index c4f80ad..39f6b58 100644
> --- a/tests/docker/dockerfiles/fedora.docker
> +++ b/tests/docker/dockerfiles/fedora.docker
> @@ -1,6 +1,6 @@
>  FROM fedora:latest
>  ENV PACKAGES \
> -    ccache git tar PyYAML sparse flex bison python2 \
> +    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 \
>      mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config \


--
Alex Bennée

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

* Re: [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile Fam Zheng
@ 2017-05-05  8:27   ` Alex Bennée
  2017-05-05  9:12     ` Fam Zheng
  2017-05-06 16:33   ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 25+ messages in thread
From: Alex Bennée @ 2017-05-05  8:27 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel


Fam Zheng <famz@redhat.com> writes:

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

Is there any way the tests could DoS the host? I guess you could achieve
the same running the iotests directly from make but it does seem we
should confine the docker guest as much as possible.

>
> 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 0ed8c3d..09d157c 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -127,6 +127,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,--net=none) 			\
>  			-e TARGET_LIST=$(TARGET_LIST) 			\


--
Alex Bennée

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

* Re: [Qemu-devel] [PATCH 4/5] docker: Add libaio to fedora image
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 4/5] docker: Add libaio to fedora image Fam Zheng
@ 2017-05-05  8:27   ` Alex Bennée
  2017-05-06 16:26   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 25+ messages in thread
From: Alex Bennée @ 2017-05-05  8:27 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel


Fam Zheng <famz@redhat.com> writes:

> Signed-off-by: Fam Zheng <famz@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  tests/docker/dockerfiles/fedora.docker | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
> index 39f6b58..4eaa8ed 100644
> --- a/tests/docker/dockerfiles/fedora.docker
> +++ b/tests/docker/dockerfiles/fedora.docker
> @@ -2,7 +2,7 @@ FROM fedora:latest
>  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 \
> +    gcc gcc-c++ clang make perl which bc findutils libaio-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 \


--
Alex Bennée

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

* Re: [Qemu-devel] [PATCH 5/5] docker: Add test-block
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 5/5] docker: Add test-block Fam Zheng
@ 2017-05-05  8:28   ` Alex Bennée
  2017-05-05  8:55     ` Fam Zheng
  2017-05-08 15:11   ` Yash Mankad
  2017-05-08 15:52   ` Daniel P. Berrange
  2 siblings, 1 reply; 25+ messages in thread
From: Alex Bennée @ 2017-05-05  8:28 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel


Fam Zheng <famz@redhat.com> writes:

> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/docker/test-block | 21 +++++++++++++++++++++
>  1 file changed, 21 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 0000000..20ef705
> --- /dev/null
> +++ b/tests/docker/test-block
> @@ -0,0 +1,21 @@
> +#!/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

Shouldn't we allow for non-default targets like the other tests?

> +cd tests/qemu-iotests
> +./check -raw
> +./check -qcow2


--
Alex Bennée

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

* Re: [Qemu-devel] [PATCH 0/5] docker: Add test-block
  2017-05-05  8:07     ` Paolo Bonzini
@ 2017-05-05  8:52       ` Fam Zheng
  0 siblings, 0 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  8:52 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Alex Bennée, qemu-devel

On Fri, 05/05 10:07, Paolo Bonzini wrote:
> 
> 
> On 05/05/2017 10:05, Fam Zheng wrote:
> >> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> >>
> >> For patch 5, I think we should revive the "quick" qemu-iotests group
> >> (maybe we can have support for skipping groups, and have a "slow" group
> >> with the very few tests that take >30 seconds?) and add the quick tests
> >> to "make check".
> > Sounds like a good idea, but for a separate series, IMO.
> > 
> > The idea of the new test-block is to include all qemu-iotests tests.  I only
> > added raw and qcow2 because vmdk etc. fails case 181. I could use "-x" but
> > that's a bit ugly - they can wait for the fix.
> 
> I think that would still be a bit too slow for patchew?

We have ~1 hour between each series, this one is not slower than the current
docker build tests, so I think it's fine - we can make it run in parallel, like
in the case of the s390x build.

Fam

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

* Re: [Qemu-devel] [PATCH 5/5] docker: Add test-block
  2017-05-05  8:28   ` Alex Bennée
@ 2017-05-05  8:55     ` Fam Zheng
  0 siblings, 0 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  8:55 UTC (permalink / raw)
  To: Alex Bennée; +Cc: qemu-devel

On Fri, 05/05 09:28, Alex Bennée wrote:
> 
> Fam Zheng <famz@redhat.com> writes:
> 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  tests/docker/test-block | 21 +++++++++++++++++++++
> >  1 file changed, 21 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 0000000..20ef705
> > --- /dev/null
> > +++ b/tests/docker/test-block
> > @@ -0,0 +1,21 @@
> > +#!/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
> 
> Shouldn't we allow for non-default targets like the other tests?

Sure, I'll add it.

> 
> > +cd tests/qemu-iotests
> > +./check -raw
> > +./check -qcow2
> 
> 
> --
> Alex Bennée

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

* Re: [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile
  2017-05-05  8:27   ` Alex Bennée
@ 2017-05-05  9:12     ` Fam Zheng
  0 siblings, 0 replies; 25+ messages in thread
From: Fam Zheng @ 2017-05-05  9:12 UTC (permalink / raw)
  To: Alex Bennée; +Cc: qemu-devel

On Fri, 05/05 09:27, Alex Bennée wrote:
> 
> Fam Zheng <famz@redhat.com> writes:
> 
> > Some by default blocked syscalls are required to run tests for example
> > userfaultfd.
> 
> Is there any way the tests could DoS the host? I guess you could achieve
> the same running the iotests directly from make but it does seem we
> should confine the docker guest as much as possible.

I don't know the answer to the security question, but if a confined docker
environment is full of pitfalls and unpleasant to work with, it won't grow that
much.

Patchew runs this in a VM, so it's not a big problem to me.

> 
> >
> > 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 0ed8c3d..09d157c 100644
> > --- a/tests/docker/Makefile.include
> > +++ b/tests/docker/Makefile.include
> > @@ -127,6 +127,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,--net=none) 			\
> >  			-e TARGET_LIST=$(TARGET_LIST) 			\
> 
> 
> --
> Alex Bennée

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

* Re: [Qemu-devel] [PATCH 1/5] docker: Run tests with current user
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 1/5] docker: Run tests with current user Fam Zheng
  2017-05-05  8:25   ` Alex Bennée
@ 2017-05-06 16:25   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-05-06 16:25 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Alex Bennée

On 05/05/2017 12:23 AM, Fam Zheng wrote:
> We've used --add-current-user to create a user in the image, use it to
> run tests, because root has too much priviledge, and can surprise test
> cases.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  tests/docker/Makefile.include | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 03eda37..0ed8c3d 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -126,7 +126,7 @@ docker-run: docker-qemu-src
>  			"  COPYING $(EXECUTABLE) to $(IMAGE)"))
>  	$(call quiet-command,						\
>  		$(SRC_PATH)/tests/docker/docker.py run 			\
> -			-t 						\
> +			$(if $(NOUSER),,-u $(shell id -u)) -t 		\
>  			$(if $V,,--rm) 					\
>  			$(if $(DEBUG),-i,--net=none) 			\
>  			-e TARGET_LIST=$(TARGET_LIST) 			\
>

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

* Re: [Qemu-devel] [PATCH 4/5] docker: Add libaio to fedora image
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 4/5] docker: Add libaio to fedora image Fam Zheng
  2017-05-05  8:27   ` Alex Bennée
@ 2017-05-06 16:26   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-05-06 16:26 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Alex Bennée

On 05/05/2017 12:23 AM, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  tests/docker/dockerfiles/fedora.docker | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
> index 39f6b58..4eaa8ed 100644
> --- a/tests/docker/dockerfiles/fedora.docker
> +++ b/tests/docker/dockerfiles/fedora.docker
> @@ -2,7 +2,7 @@ FROM fedora:latest
>  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 \
> +    gcc gcc-c++ clang make perl which bc findutils libaio-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 \
>

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

* Re: [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile Fam Zheng
  2017-05-05  8:27   ` Alex Bennée
@ 2017-05-06 16:33   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-05-06 16:33 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Alex Bennée, Paolo Bonzini

Hi Fam, Alex, Paolo,

On 05/05/2017 12:23 AM, Fam Zheng wrote:
> 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 0ed8c3d..09d157c 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -127,6 +127,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		\

I think this should be an option in the matrix, and eventually run tests 
using userfaultfd() apart.

                 $(if $(UNCONFINED),,--security-opt seccomp=unconfined)

I'm having the same problem with getcontext() using x32 ABI.

>  			$(if $V,,--rm) 					\
>  			$(if $(DEBUG),-i,--net=none) 			\
>  			-e TARGET_LIST=$(TARGET_LIST) 			\
>

Regards,

Phil.

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

* Re: [Qemu-devel] [PATCH 2/5] docker: Add bzip2 and hostname to fedora image
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 2/5] docker: Add bzip2 and hostname to fedora image Fam Zheng
  2017-05-05  8:25   ` Alex Bennée
@ 2017-05-06 16:34   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 25+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-05-06 16:34 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Alex Bennée

On 05/05/2017 12:23 AM, Fam Zheng wrote:
> It is used by qemu-iotests.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  tests/docker/dockerfiles/fedora.docker | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
> index c4f80ad..39f6b58 100644
> --- a/tests/docker/dockerfiles/fedora.docker
> +++ b/tests/docker/dockerfiles/fedora.docker
> @@ -1,6 +1,6 @@
>  FROM fedora:latest
>  ENV PACKAGES \
> -    ccache git tar PyYAML sparse flex bison python2 \
> +    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 \
>      mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config \
>

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

* Re: [Qemu-devel] [PATCH 5/5] docker: Add test-block
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 5/5] docker: Add test-block Fam Zheng
  2017-05-05  8:28   ` Alex Bennée
@ 2017-05-08 15:11   ` Yash Mankad
  2017-05-08 15:52   ` Daniel P. Berrange
  2 siblings, 0 replies; 25+ messages in thread
From: Yash Mankad @ 2017-05-08 15:11 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Alex Bennée, Max Reitz, John Snow


On 05/04/2017 11:23 PM, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>   tests/docker/test-block | 21 +++++++++++++++++++++
>   1 file changed, 21 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 0000000..20ef705
> --- /dev/null
> +++ b/tests/docker/test-block
> @@ -0,0 +1,21 @@
> +#!/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
> +./check -raw
> +./check -qcow2

Could you also consider running -nbd tests ?

Yash

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

* Re: [Qemu-devel] [PATCH 5/5] docker: Add test-block
  2017-05-05  3:23 ` [Qemu-devel] [PATCH 5/5] docker: Add test-block Fam Zheng
  2017-05-05  8:28   ` Alex Bennée
  2017-05-08 15:11   ` Yash Mankad
@ 2017-05-08 15:52   ` Daniel P. Berrange
  2 siblings, 0 replies; 25+ messages in thread
From: Daniel P. Berrange @ 2017-05-08 15:52 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, Alex Bennée

On Fri, May 05, 2017 at 11:23:40AM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/docker/test-block | 21 +++++++++++++++++++++
>  1 file changed, 21 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 0000000..20ef705
> --- /dev/null
> +++ b/tests/docker/test-block
> @@ -0,0 +1,21 @@
> +#!/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
> +./check -raw
> +./check -qcow2

qcow v1  should be passing all tests now too, so pleae include
that.

I also want to have LUKS support included, though that is pending
a couple of patches to fix some current failures

  https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg00277.html

If we add more tests though, this single 'test-block' job is going
to get pretty slow.  qcow v1 is massively slower to complete tests
than qcow v2, and luks is quite alot slower too - particularly if
you enable the cryptsetup interoperability test case (it takes about
5 minutes to run now)

Should we have separate jobs to parallelize this across different
I/O backends.

Regards,
Daniel
-- 
|: 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 :|

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

* Re: [Qemu-devel] [PATCH 0/5] docker: Add test-block
  2017-05-05  7:44 ` [Qemu-devel] [PATCH 0/5] " Paolo Bonzini
  2017-05-05  8:05   ` Fam Zheng
@ 2017-05-08 15:55   ` Daniel P. Berrange
  2017-05-08 16:06     ` Paolo Bonzini
  1 sibling, 1 reply; 25+ messages in thread
From: Daniel P. Berrange @ 2017-05-08 15:55 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Fam Zheng, qemu-devel, Alex Bennée

On Fri, May 05, 2017 at 09:44:04AM +0200, Paolo Bonzini wrote:
> 
> 
> On 05/05/2017 05:23, 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.
> > 
> > Fam Zheng (5):
> >   docker: Run tests with current user
> >   docker: Add bzip2 and hostname to fedora image
> >   docker: Use unconfined security profile
> >   docker: Add libaio to fedora image
> >   docker: Add test-block
> > 
> >  tests/docker/Makefile.include          |  3 ++-
> >  tests/docker/dockerfiles/fedora.docker |  4 ++--
> >  tests/docker/test-block                | 21 +++++++++++++++++++++
> >  3 files changed, 25 insertions(+), 3 deletions(-)
> >  create mode 100755 tests/docker/test-block
> > 
> 
> Patches 1-4:
> 
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> For patch 5, I think we should revive the "quick" qemu-iotests group
> (maybe we can have support for skipping groups, and have a "slow" group
> with the very few tests that take >30 seconds?) and add the quick tests
> to "make check".

'quick' not only depends on the test case, but also the backend.
Most of the so called 'quick' tests are very slow with qcow v1 (over
your 30 sec mark), and can also be fairly slow with LUKS too.

Regards,
Daniel
-- 
|: 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 :|

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

* Re: [Qemu-devel] [PATCH 0/5] docker: Add test-block
  2017-05-08 15:55   ` Daniel P. Berrange
@ 2017-05-08 16:06     ` Paolo Bonzini
  0 siblings, 0 replies; 25+ messages in thread
From: Paolo Bonzini @ 2017-05-08 16:06 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: Fam Zheng, qemu-devel, Alex Bennée



On 08/05/2017 17:55, Daniel P. Berrange wrote:
>>
>> For patch 5, I think we should revive the "quick" qemu-iotests group
>> (maybe we can have support for skipping groups, and have a "slow" group
>> with the very few tests that take >30 seconds?) and add the quick tests
>> to "make check".
> 'quick' not only depends on the test case, but also the backend.
> Most of the so called 'quick' tests are very slow with qcow v1 (over
> your 30 sec mark), and can also be fairly slow with LUKS too.

You could define two groups: "quick" for those that are pretty much
guaranteed to be fast with all backends, "slow" for those that are
guaranteed to be slow with all backends.

Then CI can use "!slow" when running with selected backends (raw, qcow2,
raw-over-NBD) and "quick" for other backends.

Paolo

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

end of thread, other threads:[~2017-05-08 16:06 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-05  3:23 [Qemu-devel] [PATCH 0/5] docker: Add test-block Fam Zheng
2017-05-05  3:23 ` [Qemu-devel] [PATCH 1/5] docker: Run tests with current user Fam Zheng
2017-05-05  8:25   ` Alex Bennée
2017-05-06 16:25   ` Philippe Mathieu-Daudé
2017-05-05  3:23 ` [Qemu-devel] [PATCH 2/5] docker: Add bzip2 and hostname to fedora image Fam Zheng
2017-05-05  8:25   ` Alex Bennée
2017-05-06 16:34   ` Philippe Mathieu-Daudé
2017-05-05  3:23 ` [Qemu-devel] [PATCH 3/5] docker: Use unconfined security profile Fam Zheng
2017-05-05  8:27   ` Alex Bennée
2017-05-05  9:12     ` Fam Zheng
2017-05-06 16:33   ` Philippe Mathieu-Daudé
2017-05-05  3:23 ` [Qemu-devel] [PATCH 4/5] docker: Add libaio to fedora image Fam Zheng
2017-05-05  8:27   ` Alex Bennée
2017-05-06 16:26   ` Philippe Mathieu-Daudé
2017-05-05  3:23 ` [Qemu-devel] [PATCH 5/5] docker: Add test-block Fam Zheng
2017-05-05  8:28   ` Alex Bennée
2017-05-05  8:55     ` Fam Zheng
2017-05-08 15:11   ` Yash Mankad
2017-05-08 15:52   ` Daniel P. Berrange
2017-05-05  7:44 ` [Qemu-devel] [PATCH 0/5] " Paolo Bonzini
2017-05-05  8:05   ` Fam Zheng
2017-05-05  8:07     ` Paolo Bonzini
2017-05-05  8:52       ` Fam Zheng
2017-05-08 15:55   ` Daniel P. Berrange
2017-05-08 16:06     ` Paolo Bonzini

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.