qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x
@ 2019-12-04 15:46 Thomas Huth
  2019-12-04 15:46 ` [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files Thomas Huth
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Thomas Huth @ 2019-12-04 15:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

Travis recently added build hosts for arm64, ppc64le and s390x, so
this is a welcome addition to our Travis testing matrix.

Unfortunately, the builds are running in quite restricted LXD containers
there, for example it is not possible to create huge files there (even
if they are just sparse), and certain system calls are blocked. So we
have to change some tests first to stop them failing in such environments.

v2:
 - Added "make check-tcg" and Alex' patch to disable cross-containers
 - Explicitely set "dist: xenial" for arm64 and ppc64le since some
   iotests are crashing on bionic on these hosts.
 - Dropped "libcap-dev" from the package list since it will be replaced
   by libcapng-dev soon.

Alex Bennée (1):
  configure: allow disable of cross compilation containers

Thomas Huth (6):
  iotests: Provide a function for checking the creation of huge files
  iotests: Skip test 060 if it is not possible to create large files
  iotests: Skip test 079 if it is not possible to create large files
  tests/hd-geo-test: Skip test when images can not be created
  tests/test-util-filemonitor: Skip test on non-x86 Travis containers
  travis.yml: Enable builds on arm64, ppc64le and s390x

 .travis.yml                   | 86 +++++++++++++++++++++++++++++++++++
 configure                     |  8 +++-
 tests/hd-geo-test.c           | 12 ++++-
 tests/qemu-iotests/005        |  5 +-
 tests/qemu-iotests/060        |  3 ++
 tests/qemu-iotests/079        |  3 ++
 tests/qemu-iotests/220        |  6 +--
 tests/qemu-iotests/common.rc  | 10 ++++
 tests/tcg/configure.sh        |  6 ++-
 tests/test-util-filemonitor.c | 11 +++++
 10 files changed, 138 insertions(+), 12 deletions(-)

-- 
2.18.1



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

* [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files
  2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
@ 2019-12-04 15:46 ` Thomas Huth
  2019-12-04 15:53   ` Philippe Mathieu-Daudé
  2019-12-05  1:06   ` Cleber Rosa
  2019-12-04 15:46 ` [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files Thomas Huth
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 19+ messages in thread
From: Thomas Huth @ 2019-12-04 15:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

Some tests create huge (but sparse) files, and to be able to run those
tests in certain limited environments (like CI containers), we have to
check for the possibility to create such files first. Thus let's introduce
a common function to check for large files, and replace the already
existing checks in the iotests 005 and 220 with this function.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qemu-iotests/005       |  5 +----
 tests/qemu-iotests/220       |  6 ++----
 tests/qemu-iotests/common.rc | 10 ++++++++++
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
index 58442762fe..b6d03ac37d 100755
--- a/tests/qemu-iotests/005
+++ b/tests/qemu-iotests/005
@@ -59,10 +59,7 @@ fi
 # Sanity check: For raw, we require a file system that permits the creation
 # of a HUGE (but very sparse) file. Check we can create it before continuing.
 if [ "$IMGFMT" = "raw" ]; then
-    if ! truncate --size=5T "$TEST_IMG"; then
-        _notrun "file system on $TEST_DIR does not support large enough files"
-    fi
-    rm "$TEST_IMG"
+    _require_large_file 5T
 fi
 
 echo
diff --git a/tests/qemu-iotests/220 b/tests/qemu-iotests/220
index 2d62c5dcac..15159270d3 100755
--- a/tests/qemu-iotests/220
+++ b/tests/qemu-iotests/220
@@ -42,10 +42,8 @@ echo "== Creating huge file =="
 
 # Sanity check: We require a file system that permits the creation
 # of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.
-if ! truncate --size=513T "$TEST_IMG"; then
-    _notrun "file system on $TEST_DIR does not support large enough files"
-fi
-rm "$TEST_IMG"
+_require_large_file 513T
+
 IMGOPTS='cluster_size=2M,refcount_bits=1' _make_test_img 513T
 
 echo "== Populating refcounts =="
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 0cc8acc9ed..6f0582c79a 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -643,5 +643,15 @@ _require_drivers()
     done
 }
 
+# Check that we have a file system that allows huge (but very sparse) files
+#
+_require_large_file()
+{
+    if ! truncate --size="$1" "$TEST_IMG"; then
+        _notrun "file system on $TEST_DIR does not support large enough files"
+    fi
+    rm "$TEST_IMG"
+}
+
 # make sure this script returns success
 true
-- 
2.18.1



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

* [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files
  2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
  2019-12-04 15:46 ` [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files Thomas Huth
@ 2019-12-04 15:46 ` Thomas Huth
  2019-12-04 15:53   ` Philippe Mathieu-Daudé
  2019-12-05 18:41   ` Cleber Rosa
  2019-12-04 15:46 ` [PATCH v2 3/7] iotests: Skip test 079 " Thomas Huth
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 19+ messages in thread
From: Thomas Huth @ 2019-12-04 15:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

Test 060 fails in the arm64, s390x and ppc64le LXD containers on Travis
(which we will hopefully enable in our CI soon). These containers
apparently do not allow large files to be created. The repair process
in test 060 creates a file of 64 GiB, so test first whether such large
files are possible and skip the test if that's not the case.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qemu-iotests/060 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index b91d8321bb..d96f17a484 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -49,6 +49,9 @@ _supported_fmt qcow2
 _supported_proto file
 _supported_os Linux
 
+# The repair process will create a large file - so check for availability first
+_require_large_file 64G
+
 rt_offset=65536  # 0x10000 (XXX: just an assumption)
 rb_offset=131072 # 0x20000 (XXX: just an assumption)
 l1_offset=196608 # 0x30000 (XXX: just an assumption)
-- 
2.18.1



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

* [PATCH v2 3/7] iotests: Skip test 079 if it is not possible to create large files
  2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
  2019-12-04 15:46 ` [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files Thomas Huth
  2019-12-04 15:46 ` [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files Thomas Huth
@ 2019-12-04 15:46 ` Thomas Huth
  2019-12-04 15:53   ` Philippe Mathieu-Daudé
  2019-12-06  5:59   ` Thomas Huth
  2019-12-04 15:46 ` [PATCH v2 4/7] tests/hd-geo-test: Skip test when images can not be created Thomas Huth
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 19+ messages in thread
From: Thomas Huth @ 2019-12-04 15:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

Test 079 fails in the arm64, s390x and ppc64le LXD containers on Travis
(which we will hopefully enable in our CI soon). These containers
apparently do not allow large files to be created. Test 079 tries to
create a 4G sparse file, which is apparently already too big for these
containers, so check first whether we can really create such files before
executing the test.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qemu-iotests/079 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/qemu-iotests/079 b/tests/qemu-iotests/079
index 81f0c21f53..78536d3bbf 100755
--- a/tests/qemu-iotests/079
+++ b/tests/qemu-iotests/079
@@ -39,6 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto file nfs
 
+# Some containers (e.g. non-x86 on Travis) do not allow large files
+_require_large_file 4G
+
 echo "=== Check option preallocation and cluster_size ==="
 echo
 cluster_sizes="16384 32768 65536 131072 262144 524288 1048576 2097152 4194304"
-- 
2.18.1



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

* [PATCH v2 4/7] tests/hd-geo-test: Skip test when images can not be created
  2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
                   ` (2 preceding siblings ...)
  2019-12-04 15:46 ` [PATCH v2 3/7] iotests: Skip test 079 " Thomas Huth
@ 2019-12-04 15:46 ` Thomas Huth
  2019-12-05 20:25   ` Cleber Rosa
  2019-12-04 15:46 ` [PATCH v2 5/7] tests/test-util-filemonitor: Skip test on non-x86 Travis containers Thomas Huth
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Thomas Huth @ 2019-12-04 15:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

In certain environments like restricted containers, we can not create
huge test images. To be able to use "make check" in such container
environments, too, let's skip the hd-geo-test instead of failing when
the test images could not be created.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/hd-geo-test.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
index 7e86c5416c..a249800544 100644
--- a/tests/hd-geo-test.c
+++ b/tests/hd-geo-test.c
@@ -34,8 +34,13 @@ static char *create_test_img(int secs)
     fd = mkstemp(template);
     g_assert(fd >= 0);
     ret = ftruncate(fd, (off_t)secs * 512);
-    g_assert(ret == 0);
     close(fd);
+
+    if (ret) {
+        free(template);
+        template = NULL;
+    }
+
     return template;
 }
 
@@ -934,6 +939,10 @@ int main(int argc, char **argv)
     for (i = 0; i < backend_last; i++) {
         if (img_secs[i] >= 0) {
             img_file_name[i] = create_test_img(img_secs[i]);
+            if (!img_file_name[i]) {
+                g_test_message("Could not create test images.");
+                goto test_add_done;
+            }
         } else {
             img_file_name[i] = NULL;
         }
@@ -965,6 +974,7 @@ int main(int argc, char **argv)
                        "skipping hd-geo/override/* tests");
     }
 
+test_add_done:
     ret = g_test_run();
 
     for (i = 0; i < backend_last; i++) {
-- 
2.18.1



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

* [PATCH v2 5/7] tests/test-util-filemonitor: Skip test on non-x86 Travis containers
  2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
                   ` (3 preceding siblings ...)
  2019-12-04 15:46 ` [PATCH v2 4/7] tests/hd-geo-test: Skip test when images can not be created Thomas Huth
@ 2019-12-04 15:46 ` Thomas Huth
  2019-12-05 20:37   ` Cleber Rosa
  2019-12-04 15:46 ` [PATCH v2 6/7] configure: allow disable of cross compilation containers Thomas Huth
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Thomas Huth @ 2019-12-04 15:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

test-util-filemonitor fails in restricted non-x86 Travis containers
since they apparently blacklisted some required system calls there.
Let's simply skip the test if we detect such an environment.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/test-util-filemonitor.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/test-util-filemonitor.c b/tests/test-util-filemonitor.c
index 301cd2db61..45009c69f4 100644
--- a/tests/test-util-filemonitor.c
+++ b/tests/test-util-filemonitor.c
@@ -406,10 +406,21 @@ test_file_monitor_events(void)
     char *pathdst = NULL;
     QFileMonitorTestData data;
     GHashTable *ids = g_hash_table_new(g_int64_hash, g_int64_equal);
+    char *travis_arch;
 
     qemu_mutex_init(&data.lock);
     data.records = NULL;
 
+    /*
+     * This test does not work on Travis LXD containers since some
+     * syscalls are blocked in that environment.
+     */
+    travis_arch = getenv("TRAVIS_ARCH");
+    if (travis_arch && !g_str_equal(travis_arch, "x86_64")) {
+        g_test_skip("Test does not work on non-x86 Travis containers.");
+        return;
+    }
+
     /*
      * The file monitor needs the main loop running in
      * order to receive events from inotify. We must
-- 
2.18.1



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

* [PATCH v2 6/7] configure: allow disable of cross compilation containers
  2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
                   ` (4 preceding siblings ...)
  2019-12-04 15:46 ` [PATCH v2 5/7] tests/test-util-filemonitor: Skip test on non-x86 Travis containers Thomas Huth
@ 2019-12-04 15:46 ` Thomas Huth
  2019-12-05 20:39   ` Cleber Rosa
  2019-12-04 15:46 ` [PATCH v2 7/7] travis.yml: Enable builds on arm64, ppc64le and s390x Thomas Huth
  2019-12-04 20:03 ` [PATCH v2 0/7] Enable Travis " Cleber Rosa
  7 siblings, 1 reply; 19+ messages in thread
From: Thomas Huth @ 2019-12-04 15:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

From: Alex Bennée <alex.bennee@linaro.org>

Our docker infrastructure isn't quite as multiarch as we would wish so
let's allow the user to disable it if they want. This will allow us to
use still run check-tcg on non-x86 CI setups.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure              | 8 +++++++-
 tests/tcg/configure.sh | 6 ++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 6099be1d84..fe6d0971f1 100755
--- a/configure
+++ b/configure
@@ -302,6 +302,7 @@ audio_win_int=""
 libs_qga=""
 debug_info="yes"
 stack_protector=""
+use_containers="yes"
 
 if test -e "$source_path/.git"
 then
@@ -1539,6 +1540,10 @@ for opt do
   ;;
   --disable-plugins) plugins="no"
   ;;
+  --enable-containers) use_containers="yes"
+  ;;
+  --disable-containers) use_containers="no"
+  ;;
   *)
       echo "ERROR: unknown option $opt"
       echo "Try '$0 --help' for more information"
@@ -1722,6 +1727,7 @@ Advanced options (experts only):
                            track the maximum stack usage of stacks created by qemu_alloc_stack
   --enable-plugins
                            enable plugins via shared library loading
+  --disable-containers     don't use containers for cross-building
 
 Optional features, enabled with --enable-FEATURE and
 disabled with --disable-FEATURE, default is enabled if available:
@@ -8039,7 +8045,7 @@ done
 (for i in $cross_cc_vars; do
   export $i
 done
-export target_list source_path
+export target_list source_path use_containers
 $source_path/tests/tcg/configure.sh)
 
 # temporary config to build submodules
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 6c4a471aea..210e68396f 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -36,8 +36,10 @@ TMPC="${TMPDIR1}/qemu-conf.c"
 TMPE="${TMPDIR1}/qemu-conf.exe"
 
 container="no"
-if has "docker" || has "podman"; then
-  container=$($python $source_path/tests/docker/docker.py probe)
+if test $use_containers = "yes"; then
+    if has "docker" || has "podman"; then
+        container=$($python $source_path/tests/docker/docker.py probe)
+    fi
 fi
 
 # cross compilers defaults, can be overridden with --cross-cc-ARCH
-- 
2.18.1



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

* [PATCH v2 7/7] travis.yml: Enable builds on arm64, ppc64le and s390x
  2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
                   ` (5 preceding siblings ...)
  2019-12-04 15:46 ` [PATCH v2 6/7] configure: allow disable of cross compilation containers Thomas Huth
@ 2019-12-04 15:46 ` Thomas Huth
  2019-12-04 22:09   ` David Gibson
  2019-12-04 20:03 ` [PATCH v2 0/7] Enable Travis " Cleber Rosa
  7 siblings, 1 reply; 19+ messages in thread
From: Thomas Huth @ 2019-12-04 15:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

Travis recently added the possibility to test on these architectures,
too, so let's enable them in our travis.yml file to extend our test
coverage.

Unfortunately, the libssh in this Ubuntu version (bionic) is in a pretty
unusable Frankenstein state and libspice-server-dev is not available here,
so we can not use the global list of packages to install, but have to
provide individual package lists instead.

Also, some of the iotests crash when using "dist: bionic" on arm64
and ppc64le, thus these two builders have to use "dist: xenial" until
the problem is understood / fixed.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .travis.yml | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 445b0646c1..0e6458b0af 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -354,6 +354,92 @@ matrix:
         - TEST_CMD="make -j3 check-tcg V=1"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
 
+    - arch: arm64
+      dist: xenial
+      addons:
+        apt_packages:
+          - libaio-dev
+          - libattr1-dev
+          - libbrlapi-dev
+          - libcap-ng-dev
+          - libgcrypt20-dev
+          - libgnutls28-dev
+          - libgtk-3-dev
+          - libiscsi-dev
+          - liblttng-ust-dev
+          - libncurses5-dev
+          - libnfs-dev
+          - libnss3-dev
+          - libpixman-1-dev
+          - libpng-dev
+          - librados-dev
+          - libsdl2-dev
+          - libseccomp-dev
+          - liburcu-dev
+          - libusb-1.0-0-dev
+          - libvdeplug-dev
+          - libvte-2.91-dev
+      env:
+        - TEST_CMD="make check check-tcg V=1"
+        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
+
+    - arch: ppc64le
+      dist: xenial
+      addons:
+        apt_packages:
+          - libaio-dev
+          - libattr1-dev
+          - libbrlapi-dev
+          - libcap-ng-dev
+          - libgcrypt20-dev
+          - libgnutls28-dev
+          - libgtk-3-dev
+          - libiscsi-dev
+          - liblttng-ust-dev
+          - libncurses5-dev
+          - libnfs-dev
+          - libnss3-dev
+          - libpixman-1-dev
+          - libpng-dev
+          - librados-dev
+          - libsdl2-dev
+          - libseccomp-dev
+          - liburcu-dev
+          - libusb-1.0-0-dev
+          - libvdeplug-dev
+          - libvte-2.91-dev
+      env:
+        - TEST_CMD="make check check-tcg V=1"
+        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},ppc64le-linux-user"
+
+    - arch: s390x
+      dist: bionic
+      addons:
+        apt_packages:
+          - libaio-dev
+          - libattr1-dev
+          - libbrlapi-dev
+          - libcap-ng-dev
+          - libgcrypt20-dev
+          - libgnutls28-dev
+          - libgtk-3-dev
+          - libiscsi-dev
+          - liblttng-ust-dev
+          - libncurses5-dev
+          - libnfs-dev
+          - libnss3-dev
+          - libpixman-1-dev
+          - libpng-dev
+          - librados-dev
+          - libsdl2-dev
+          - libseccomp-dev
+          - liburcu-dev
+          - libusb-1.0-0-dev
+          - libvdeplug-dev
+          - libvte-2.91-dev
+      env:
+        - TEST_CMD="make check check-tcg V=1"
+        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
 
     # Release builds
     # The make-release script expect a QEMU version, so our tag must start with a 'v'.
-- 
2.18.1



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

* Re: [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files
  2019-12-04 15:46 ` [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files Thomas Huth
@ 2019-12-04 15:53   ` Philippe Mathieu-Daudé
  2019-12-05  1:06   ` Cleber Rosa
  1 sibling, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-04 15:53 UTC (permalink / raw)
  To: Thomas Huth, Alex Bennée, qemu-devel
  Cc: qemu-block, Wainer dos Santos Moschetta, Eric Auger,
	Christian Ehrhardt, Cleber Rosa, David Gibson

On 12/4/19 4:46 PM, Thomas Huth wrote:
> Some tests create huge (but sparse) files, and to be able to run those
> tests in certain limited environments (like CI containers), we have to
> check for the possibility to create such files first. Thus let's introduce
> a common function to check for large files, and replace the already
> existing checks in the iotests 005 and 220 with this function.
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qemu-iotests/005       |  5 +----
>   tests/qemu-iotests/220       |  6 ++----
>   tests/qemu-iotests/common.rc | 10 ++++++++++
>   3 files changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
> index 58442762fe..b6d03ac37d 100755
> --- a/tests/qemu-iotests/005
> +++ b/tests/qemu-iotests/005
> @@ -59,10 +59,7 @@ fi
>   # Sanity check: For raw, we require a file system that permits the creation
>   # of a HUGE (but very sparse) file. Check we can create it before continuing.
>   if [ "$IMGFMT" = "raw" ]; then
> -    if ! truncate --size=5T "$TEST_IMG"; then
> -        _notrun "file system on $TEST_DIR does not support large enough files"
> -    fi
> -    rm "$TEST_IMG"
> +    _require_large_file 5T
>   fi
>   
>   echo
> diff --git a/tests/qemu-iotests/220 b/tests/qemu-iotests/220
> index 2d62c5dcac..15159270d3 100755
> --- a/tests/qemu-iotests/220
> +++ b/tests/qemu-iotests/220
> @@ -42,10 +42,8 @@ echo "== Creating huge file =="
>   
>   # Sanity check: We require a file system that permits the creation
>   # of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.
> -if ! truncate --size=513T "$TEST_IMG"; then
> -    _notrun "file system on $TEST_DIR does not support large enough files"
> -fi
> -rm "$TEST_IMG"
> +_require_large_file 513T
> +
>   IMGOPTS='cluster_size=2M,refcount_bits=1' _make_test_img 513T
>   
>   echo "== Populating refcounts =="
> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index 0cc8acc9ed..6f0582c79a 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -643,5 +643,15 @@ _require_drivers()
>       done
>   }
>   
> +# Check that we have a file system that allows huge (but very sparse) files
> +#
> +_require_large_file()
> +{
> +    if ! truncate --size="$1" "$TEST_IMG"; then
> +        _notrun "file system on $TEST_DIR does not support large enough files"
> +    fi
> +    rm "$TEST_IMG"
> +}

:)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> +
>   # make sure this script returns success
>   true
> 



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

* Re: [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files
  2019-12-04 15:46 ` [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files Thomas Huth
@ 2019-12-04 15:53   ` Philippe Mathieu-Daudé
  2019-12-05 18:41   ` Cleber Rosa
  1 sibling, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-04 15:53 UTC (permalink / raw)
  To: Thomas Huth, Alex Bennée, qemu-devel
  Cc: qemu-block, Wainer dos Santos Moschetta, Eric Auger,
	Christian Ehrhardt, Cleber Rosa, David Gibson

On 12/4/19 4:46 PM, Thomas Huth wrote:
> Test 060 fails in the arm64, s390x and ppc64le LXD containers on Travis
> (which we will hopefully enable in our CI soon). These containers
> apparently do not allow large files to be created. The repair process
> in test 060 creates a file of 64 GiB, so test first whether such large
> files are possible and skip the test if that's not the case.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qemu-iotests/060 | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
> index b91d8321bb..d96f17a484 100755
> --- a/tests/qemu-iotests/060
> +++ b/tests/qemu-iotests/060
> @@ -49,6 +49,9 @@ _supported_fmt qcow2
>   _supported_proto file
>   _supported_os Linux
>   
> +# The repair process will create a large file - so check for availability first
> +_require_large_file 64G
> +
>   rt_offset=65536  # 0x10000 (XXX: just an assumption)
>   rb_offset=131072 # 0x20000 (XXX: just an assumption)
>   l1_offset=196608 # 0x30000 (XXX: just an assumption)
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH v2 3/7] iotests: Skip test 079 if it is not possible to create large files
  2019-12-04 15:46 ` [PATCH v2 3/7] iotests: Skip test 079 " Thomas Huth
@ 2019-12-04 15:53   ` Philippe Mathieu-Daudé
  2019-12-06  5:59   ` Thomas Huth
  1 sibling, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-04 15:53 UTC (permalink / raw)
  To: Thomas Huth, Alex Bennée, qemu-devel
  Cc: qemu-block, Wainer dos Santos Moschetta, Eric Auger,
	Christian Ehrhardt, Cleber Rosa, David Gibson

On 12/4/19 4:46 PM, Thomas Huth wrote:
> Test 079 fails in the arm64, s390x and ppc64le LXD containers on Travis
> (which we will hopefully enable in our CI soon). These containers
> apparently do not allow large files to be created. Test 079 tries to
> create a 4G sparse file, which is apparently already too big for these
> containers, so check first whether we can really create such files before
> executing the test.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qemu-iotests/079 | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/tests/qemu-iotests/079 b/tests/qemu-iotests/079
> index 81f0c21f53..78536d3bbf 100755
> --- a/tests/qemu-iotests/079
> +++ b/tests/qemu-iotests/079
> @@ -39,6 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>   _supported_fmt qcow2
>   _supported_proto file nfs
>   
> +# Some containers (e.g. non-x86 on Travis) do not allow large files
> +_require_large_file 4G
> +
>   echo "=== Check option preallocation and cluster_size ==="
>   echo
>   cluster_sizes="16384 32768 65536 131072 262144 524288 1048576 2097152 4194304"
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x
  2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
                   ` (6 preceding siblings ...)
  2019-12-04 15:46 ` [PATCH v2 7/7] travis.yml: Enable builds on arm64, ppc64le and s390x Thomas Huth
@ 2019-12-04 20:03 ` Cleber Rosa
  7 siblings, 0 replies; 19+ messages in thread
From: Cleber Rosa @ 2019-12-04 20:03 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-block, Alex Bennée, qemu-devel, Christian Ehrhardt,
	Eric Auger, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	David Gibson

On Wed, Dec 04, 2019 at 04:46:11PM +0100, Thomas Huth wrote:
> Travis recently added build hosts for arm64, ppc64le and s390x, so
> this is a welcome addition to our Travis testing matrix.
> 
> Unfortunately, the builds are running in quite restricted LXD containers
> there, for example it is not possible to create huge files there (even
> if they are just sparse), and certain system calls are blocked. So we
> have to change some tests first to stop them failing in such environments.
>

Hi Thomas,

FIY, Avocado[1] has been running checks on those arches for a little
over two weeks and in my experience, there are still some reliability
issues (besides the other limitations you're already aware).

During the last week I've stopped seeing "machines" that wouldn't boot,
or severe networking limitations, but things are still not as smooth
as I'd like.

Anyway, I think we should insist on it, and give it a bit more time,
so I definitely agree with and appreciate this work.

[1] https://travis-ci.org/avocado-framework/avocado/builds

- Cleber.

> v2:
>  - Added "make check-tcg" and Alex' patch to disable cross-containers
>  - Explicitely set "dist: xenial" for arm64 and ppc64le since some
>    iotests are crashing on bionic on these hosts.
>  - Dropped "libcap-dev" from the package list since it will be replaced
>    by libcapng-dev soon.
> 
> Alex Bennée (1):
>   configure: allow disable of cross compilation containers
> 
> Thomas Huth (6):
>   iotests: Provide a function for checking the creation of huge files
>   iotests: Skip test 060 if it is not possible to create large files
>   iotests: Skip test 079 if it is not possible to create large files
>   tests/hd-geo-test: Skip test when images can not be created
>   tests/test-util-filemonitor: Skip test on non-x86 Travis containers
>   travis.yml: Enable builds on arm64, ppc64le and s390x
> 
>  .travis.yml                   | 86 +++++++++++++++++++++++++++++++++++
>  configure                     |  8 +++-
>  tests/hd-geo-test.c           | 12 ++++-
>  tests/qemu-iotests/005        |  5 +-
>  tests/qemu-iotests/060        |  3 ++
>  tests/qemu-iotests/079        |  3 ++
>  tests/qemu-iotests/220        |  6 +--
>  tests/qemu-iotests/common.rc  | 10 ++++
>  tests/tcg/configure.sh        |  6 ++-
>  tests/test-util-filemonitor.c | 11 +++++
>  10 files changed, 138 insertions(+), 12 deletions(-)
> 
> -- 
> 2.18.1
> 



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

* Re: [PATCH v2 7/7] travis.yml: Enable builds on arm64, ppc64le and s390x
  2019-12-04 15:46 ` [PATCH v2 7/7] travis.yml: Enable builds on arm64, ppc64le and s390x Thomas Huth
@ 2019-12-04 22:09   ` David Gibson
  0 siblings, 0 replies; 19+ messages in thread
From: David Gibson @ 2019-12-04 22:09 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-block, Alex Bennée, qemu-devel, Christian Ehrhardt,
	Eric Auger, Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé

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

On Wed, Dec 04, 2019 at 04:46:18PM +0100, Thomas Huth wrote:
> Travis recently added the possibility to test on these architectures,
> too, so let's enable them in our travis.yml file to extend our test
> coverage.
> 
> Unfortunately, the libssh in this Ubuntu version (bionic) is in a pretty
> unusable Frankenstein state and libspice-server-dev is not available here,
> so we can not use the global list of packages to install, but have to
> provide individual package lists instead.
> 
> Also, some of the iotests crash when using "dist: bionic" on arm64
> and ppc64le, thus these two builders have to use "dist: xenial" until
> the problem is understood / fixed.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  .travis.yml | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 86 insertions(+)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 445b0646c1..0e6458b0af 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -354,6 +354,92 @@ matrix:
>          - TEST_CMD="make -j3 check-tcg V=1"
>          - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
>  
> +    - arch: arm64
> +      dist: xenial
> +      addons:
> +        apt_packages:
> +          - libaio-dev
> +          - libattr1-dev
> +          - libbrlapi-dev
> +          - libcap-ng-dev
> +          - libgcrypt20-dev
> +          - libgnutls28-dev
> +          - libgtk-3-dev
> +          - libiscsi-dev
> +          - liblttng-ust-dev
> +          - libncurses5-dev
> +          - libnfs-dev
> +          - libnss3-dev
> +          - libpixman-1-dev
> +          - libpng-dev
> +          - librados-dev
> +          - libsdl2-dev
> +          - libseccomp-dev
> +          - liburcu-dev
> +          - libusb-1.0-0-dev
> +          - libvdeplug-dev
> +          - libvte-2.91-dev
> +      env:
> +        - TEST_CMD="make check check-tcg V=1"
> +        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
> +
> +    - arch: ppc64le
> +      dist: xenial
> +      addons:
> +        apt_packages:
> +          - libaio-dev
> +          - libattr1-dev
> +          - libbrlapi-dev
> +          - libcap-ng-dev
> +          - libgcrypt20-dev
> +          - libgnutls28-dev
> +          - libgtk-3-dev
> +          - libiscsi-dev
> +          - liblttng-ust-dev
> +          - libncurses5-dev
> +          - libnfs-dev
> +          - libnss3-dev
> +          - libpixman-1-dev
> +          - libpng-dev
> +          - librados-dev
> +          - libsdl2-dev
> +          - libseccomp-dev
> +          - liburcu-dev
> +          - libusb-1.0-0-dev
> +          - libvdeplug-dev
> +          - libvte-2.91-dev
> +      env:
> +        - TEST_CMD="make check check-tcg V=1"
> +        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},ppc64le-linux-user"
> +
> +    - arch: s390x
> +      dist: bionic
> +      addons:
> +        apt_packages:
> +          - libaio-dev
> +          - libattr1-dev
> +          - libbrlapi-dev
> +          - libcap-ng-dev
> +          - libgcrypt20-dev
> +          - libgnutls28-dev
> +          - libgtk-3-dev
> +          - libiscsi-dev
> +          - liblttng-ust-dev
> +          - libncurses5-dev
> +          - libnfs-dev
> +          - libnss3-dev
> +          - libpixman-1-dev
> +          - libpng-dev
> +          - librados-dev
> +          - libsdl2-dev
> +          - libseccomp-dev
> +          - liburcu-dev
> +          - libusb-1.0-0-dev
> +          - libvdeplug-dev
> +          - libvte-2.91-dev
> +      env:
> +        - TEST_CMD="make check check-tcg V=1"
> +        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
>  
>      # Release builds
>      # The make-release script expect a QEMU version, so our tag must start with a 'v'.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files
  2019-12-04 15:46 ` [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files Thomas Huth
  2019-12-04 15:53   ` Philippe Mathieu-Daudé
@ 2019-12-05  1:06   ` Cleber Rosa
  1 sibling, 0 replies; 19+ messages in thread
From: Cleber Rosa @ 2019-12-05  1:06 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-block, Alex Bennée, qemu-devel, Christian Ehrhardt,
	Eric Auger, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	David Gibson

On Wed, Dec 04, 2019 at 04:46:12PM +0100, Thomas Huth wrote:
> Some tests create huge (but sparse) files, and to be able to run those
> tests in certain limited environments (like CI containers), we have to
> check for the possibility to create such files first. Thus let's introduce
> a common function to check for large files, and replace the already
> existing checks in the iotests 005 and 220 with this function.
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/qemu-iotests/005       |  5 +----
>  tests/qemu-iotests/220       |  6 ++----
>  tests/qemu-iotests/common.rc | 10 ++++++++++
>  3 files changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
> index 58442762fe..b6d03ac37d 100755
> --- a/tests/qemu-iotests/005
> +++ b/tests/qemu-iotests/005
> @@ -59,10 +59,7 @@ fi
>  # Sanity check: For raw, we require a file system that permits the creation
>  # of a HUGE (but very sparse) file. Check we can create it before continuing.
>  if [ "$IMGFMT" = "raw" ]; then
> -    if ! truncate --size=5T "$TEST_IMG"; then
> -        _notrun "file system on $TEST_DIR does not support large enough files"
> -    fi
> -    rm "$TEST_IMG"
> +    _require_large_file 5T
>  fi
>  
>  echo
> diff --git a/tests/qemu-iotests/220 b/tests/qemu-iotests/220
> index 2d62c5dcac..15159270d3 100755
> --- a/tests/qemu-iotests/220
> +++ b/tests/qemu-iotests/220
> @@ -42,10 +42,8 @@ echo "== Creating huge file =="
>  
>  # Sanity check: We require a file system that permits the creation
>  # of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.
> -if ! truncate --size=513T "$TEST_IMG"; then
> -    _notrun "file system on $TEST_DIR does not support large enough files"
> -fi
> -rm "$TEST_IMG"
> +_require_large_file 513T
> +
>  IMGOPTS='cluster_size=2M,refcount_bits=1' _make_test_img 513T
>  
>  echo "== Populating refcounts =="
> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index 0cc8acc9ed..6f0582c79a 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -643,5 +643,15 @@ _require_drivers()
>      done
>  }
>  
> +# Check that we have a file system that allows huge (but very sparse) files
> +#
> +_require_large_file()
> +{
> +    if ! truncate --size="$1" "$TEST_IMG"; then
> +        _notrun "file system on $TEST_DIR does not support large enough files"
> +    fi
> +    rm "$TEST_IMG"
> +}
> +
>  # make sure this script returns success
>  true
> -- 
> 2.18.1
> 

This is a good refactor even without considering the CI environment
issues it will help to address.

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>



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

* Re: [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files
  2019-12-04 15:46 ` [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files Thomas Huth
  2019-12-04 15:53   ` Philippe Mathieu-Daudé
@ 2019-12-05 18:41   ` Cleber Rosa
  1 sibling, 0 replies; 19+ messages in thread
From: Cleber Rosa @ 2019-12-05 18:41 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-block, Alex Bennée, qemu-devel, Christian Ehrhardt,
	Eric Auger, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	David Gibson

On Wed, Dec 04, 2019 at 04:46:13PM +0100, Thomas Huth wrote:
> Test 060 fails in the arm64, s390x and ppc64le LXD containers on Travis
> (which we will hopefully enable in our CI soon). These containers
> apparently do not allow large files to be created. The repair process
> in test 060 creates a file of 64 GiB, so test first whether such large
> files are possible and skip the test if that's not the case.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/qemu-iotests/060 | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
> index b91d8321bb..d96f17a484 100755
> --- a/tests/qemu-iotests/060
> +++ b/tests/qemu-iotests/060
> @@ -49,6 +49,9 @@ _supported_fmt qcow2
>  _supported_proto file
>  _supported_os Linux
>  
> +# The repair process will create a large file - so check for availability first
> +_require_large_file 64G
> +
>  rt_offset=65536  # 0x10000 (XXX: just an assumption)
>  rb_offset=131072 # 0x20000 (XXX: just an assumption)
>  l1_offset=196608 # 0x30000 (XXX: just an assumption)
> -- 
> 2.18.1
> 

The behavior and failure is indeed pretty consistent accross those
architectures:

 - arm64: https://travis-ci.org/clebergnu/qemu/jobs/621238740#L4217
 - ppc64le: https://travis-ci.org/clebergnu/qemu/jobs/621238741#L4252
 - s390x: https://travis-ci.org/clebergnu/qemu/jobs/621238742#L4265

And with this, 060 gets skipped properly:

 - arm64: https://travis-ci.org/clebergnu/qemu/jobs/621248591#L4202
 - ppc64le: https://travis-ci.org/clebergnu/qemu/jobs/621248592#L4236
 - s390x: https://travis-ci.org/clebergnu/qemu/jobs/621248593#L4250

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>



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

* Re: [PATCH v2 4/7] tests/hd-geo-test: Skip test when images can not be created
  2019-12-04 15:46 ` [PATCH v2 4/7] tests/hd-geo-test: Skip test when images can not be created Thomas Huth
@ 2019-12-05 20:25   ` Cleber Rosa
  0 siblings, 0 replies; 19+ messages in thread
From: Cleber Rosa @ 2019-12-05 20:25 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-block, Alex Bennée, qemu-devel, Christian Ehrhardt,
	Eric Auger, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	David Gibson

On Wed, Dec 04, 2019 at 04:46:15PM +0100, Thomas Huth wrote:
> In certain environments like restricted containers, we can not create
> huge test images. To be able to use "make check" in such container
> environments, too, let's skip the hd-geo-test instead of failing when
> the test images could not be created.
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/hd-geo-test.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
> index 7e86c5416c..a249800544 100644
> --- a/tests/hd-geo-test.c
> +++ b/tests/hd-geo-test.c
> @@ -34,8 +34,13 @@ static char *create_test_img(int secs)
>      fd = mkstemp(template);
>      g_assert(fd >= 0);
>      ret = ftruncate(fd, (off_t)secs * 512);
> -    g_assert(ret == 0);
>      close(fd);
> +
> +    if (ret) {
> +        free(template);
> +        template = NULL;
> +    }
> +
>      return template;
>  }
>  
> @@ -934,6 +939,10 @@ int main(int argc, char **argv)
>      for (i = 0; i < backend_last; i++) {
>          if (img_secs[i] >= 0) {
>              img_file_name[i] = create_test_img(img_secs[i]);
> +            if (!img_file_name[i]) {
> +                g_test_message("Could not create test images.");
> +                goto test_add_done;
> +            }
>          } else {
>              img_file_name[i] = NULL;
>          }
> @@ -965,6 +974,7 @@ int main(int argc, char **argv)
>                         "skipping hd-geo/override/* tests");
>      }
>  
> +test_add_done:
>      ret = g_test_run();
>  
>      for (i = 0; i < backend_last; i++) {
> -- 
> 2.18.1
> 

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>



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

* Re: [PATCH v2 5/7] tests/test-util-filemonitor: Skip test on non-x86 Travis containers
  2019-12-04 15:46 ` [PATCH v2 5/7] tests/test-util-filemonitor: Skip test on non-x86 Travis containers Thomas Huth
@ 2019-12-05 20:37   ` Cleber Rosa
  0 siblings, 0 replies; 19+ messages in thread
From: Cleber Rosa @ 2019-12-05 20:37 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-block, Alex Bennée, qemu-devel, Christian Ehrhardt,
	Eric Auger, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	David Gibson

On Wed, Dec 04, 2019 at 04:46:16PM +0100, Thomas Huth wrote:
> test-util-filemonitor fails in restricted non-x86 Travis containers
> since they apparently blacklisted some required system calls there.
> Let's simply skip the test if we detect such an environment.
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/test-util-filemonitor.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/tests/test-util-filemonitor.c b/tests/test-util-filemonitor.c
> index 301cd2db61..45009c69f4 100644
> --- a/tests/test-util-filemonitor.c
> +++ b/tests/test-util-filemonitor.c
> @@ -406,10 +406,21 @@ test_file_monitor_events(void)
>      char *pathdst = NULL;
>      QFileMonitorTestData data;
>      GHashTable *ids = g_hash_table_new(g_int64_hash, g_int64_equal);
> +    char *travis_arch;
>  
>      qemu_mutex_init(&data.lock);
>      data.records = NULL;
>  
> +    /*
> +     * This test does not work on Travis LXD containers since some
> +     * syscalls are blocked in that environment.
> +     */
> +    travis_arch = getenv("TRAVIS_ARCH");
> +    if (travis_arch && !g_str_equal(travis_arch, "x86_64")) {
> +        g_test_skip("Test does not work on non-x86 Travis containers.");
> +        return;
> +    }
> +
>      /*
>       * The file monitor needs the main loop running in
>       * order to receive events from inotify. We must
> -- 
> 2.18.1
> 

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>



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

* Re: [PATCH v2 6/7] configure: allow disable of cross compilation containers
  2019-12-04 15:46 ` [PATCH v2 6/7] configure: allow disable of cross compilation containers Thomas Huth
@ 2019-12-05 20:39   ` Cleber Rosa
  0 siblings, 0 replies; 19+ messages in thread
From: Cleber Rosa @ 2019-12-05 20:39 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-block, Alex Bennée, qemu-devel, Christian Ehrhardt,
	Eric Auger, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	David Gibson

On Wed, Dec 04, 2019 at 04:46:17PM +0100, Thomas Huth wrote:
> From: Alex Bennée <alex.bennee@linaro.org>
> 
> Our docker infrastructure isn't quite as multiarch as we would wish so
> let's allow the user to disable it if they want. This will allow us to
> use still run check-tcg on non-x86 CI setups.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Stefan Weil <sw@weilnetz.de>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  configure              | 8 +++++++-
>  tests/tcg/configure.sh | 6 ++++--
>  2 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index 6099be1d84..fe6d0971f1 100755
> --- a/configure
> +++ b/configure
> @@ -302,6 +302,7 @@ audio_win_int=""
>  libs_qga=""
>  debug_info="yes"
>  stack_protector=""
> +use_containers="yes"
>  
>  if test -e "$source_path/.git"
>  then
> @@ -1539,6 +1540,10 @@ for opt do
>    ;;
>    --disable-plugins) plugins="no"
>    ;;
> +  --enable-containers) use_containers="yes"
> +  ;;
> +  --disable-containers) use_containers="no"
> +  ;;
>    *)
>        echo "ERROR: unknown option $opt"
>        echo "Try '$0 --help' for more information"
> @@ -1722,6 +1727,7 @@ Advanced options (experts only):
>                             track the maximum stack usage of stacks created by qemu_alloc_stack
>    --enable-plugins
>                             enable plugins via shared library loading
> +  --disable-containers     don't use containers for cross-building
>  
>  Optional features, enabled with --enable-FEATURE and
>  disabled with --disable-FEATURE, default is enabled if available:
> @@ -8039,7 +8045,7 @@ done
>  (for i in $cross_cc_vars; do
>    export $i
>  done
> -export target_list source_path
> +export target_list source_path use_containers
>  $source_path/tests/tcg/configure.sh)
>  
>  # temporary config to build submodules
> diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
> index 6c4a471aea..210e68396f 100755
> --- a/tests/tcg/configure.sh
> +++ b/tests/tcg/configure.sh
> @@ -36,8 +36,10 @@ TMPC="${TMPDIR1}/qemu-conf.c"
>  TMPE="${TMPDIR1}/qemu-conf.exe"
>  
>  container="no"
> -if has "docker" || has "podman"; then
> -  container=$($python $source_path/tests/docker/docker.py probe)
> +if test $use_containers = "yes"; then
> +    if has "docker" || has "podman"; then
> +        container=$($python $source_path/tests/docker/docker.py probe)
> +    fi
>  fi
>  
>  # cross compilers defaults, can be overridden with --cross-cc-ARCH
> -- 
> 2.18.1
> 

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>



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

* Re: [PATCH v2 3/7] iotests: Skip test 079 if it is not possible to create large files
  2019-12-04 15:46 ` [PATCH v2 3/7] iotests: Skip test 079 " Thomas Huth
  2019-12-04 15:53   ` Philippe Mathieu-Daudé
@ 2019-12-06  5:59   ` Thomas Huth
  1 sibling, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2019-12-06  5:59 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: qemu-block, Christian Ehrhardt, Eric Auger,
	Wainer dos Santos Moschetta, Cleber Rosa,
	Philippe Mathieu-Daudé,
	David Gibson

On 04/12/2019 16.46, Thomas Huth wrote:
> Test 079 fails in the arm64, s390x and ppc64le LXD containers on Travis

For the record: It's working on s390x as noticed by Cleber. It's only
failing on arm64 and ppc64le. After fixing the problem with 060 which
fails on all three architectures, I did not pay enough attention when I
wrote this commit message here and thought that this would be the very
same problem, but apparently it is working on s390x. Thus "s390x" should
be removed from the commit message.

 Thomas



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

end of thread, other threads:[~2019-12-06 16:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04 15:46 [PATCH v2 0/7] Enable Travis builds on arm64, ppc64le and s390x Thomas Huth
2019-12-04 15:46 ` [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files Thomas Huth
2019-12-04 15:53   ` Philippe Mathieu-Daudé
2019-12-05  1:06   ` Cleber Rosa
2019-12-04 15:46 ` [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files Thomas Huth
2019-12-04 15:53   ` Philippe Mathieu-Daudé
2019-12-05 18:41   ` Cleber Rosa
2019-12-04 15:46 ` [PATCH v2 3/7] iotests: Skip test 079 " Thomas Huth
2019-12-04 15:53   ` Philippe Mathieu-Daudé
2019-12-06  5:59   ` Thomas Huth
2019-12-04 15:46 ` [PATCH v2 4/7] tests/hd-geo-test: Skip test when images can not be created Thomas Huth
2019-12-05 20:25   ` Cleber Rosa
2019-12-04 15:46 ` [PATCH v2 5/7] tests/test-util-filemonitor: Skip test on non-x86 Travis containers Thomas Huth
2019-12-05 20:37   ` Cleber Rosa
2019-12-04 15:46 ` [PATCH v2 6/7] configure: allow disable of cross compilation containers Thomas Huth
2019-12-05 20:39   ` Cleber Rosa
2019-12-04 15:46 ` [PATCH v2 7/7] travis.yml: Enable builds on arm64, ppc64le and s390x Thomas Huth
2019-12-04 22:09   ` David Gibson
2019-12-04 20:03 ` [PATCH v2 0/7] Enable Travis " Cleber Rosa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).