From f8754ffa2624ff224ae480dd4e021019f76db7f6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 26 Jan 2018 17:49:22 +0000 Subject: [PATCH] Run a simplified test suite on all arches. Note this change *enhances* test coverage. --- nbdkit.spec | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index ad9e793..c45bf72 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -4,6 +4,13 @@ %global have_libguestfs 1 %endif +# Architectures where the complete test suite must pass. +# +# On all other architectures, a simpler test suite must pass. This +# omits any tests that run full qemu, since running qemu under TCG is +# often broken on non-x86_64 arches. +%global complete_test_arches aarch64 x86_64 + # Currently everything has Python 2. RHEL 7 doesn't have Python 3. %if 0%{?rhel} != 7 %global have_python3 1 @@ -11,7 +18,7 @@ Name: nbdkit Version: 1.1.28 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NBD server License: BSD @@ -27,6 +34,9 @@ Source0: http://libguestfs.org/download/nbdkit/%{name}-%{version}.tar.gz ExclusiveArch: x86_64 %endif +%ifnarch %{complete_test_arches} +BuildRequires: autoconf, automake, libtool +%endif BuildRequires: /usr/bin/pod2man BuildRequires: gnutls-devel BuildRequires: libselinux-devel @@ -352,6 +362,12 @@ plugins for %{name}. %setup -q %autopatch -p1 +%ifnarch %{complete_test_arches} +# Simplify the test suite so it doesn't require qemu. +sed -i -e '/^if HAVE_LIBGUESTFS/,/^endif HAVE_LIBGUESTFS/d' tests/Makefile.am +autoreconf -i +%endif + %build # Force immediate binding for hardened build for plugins. @@ -416,18 +432,12 @@ mkdir -p $HOME/.cache/libvirt export LIBGUESTFS_DEBUG=1 export LIBGUESTFS_TRACE=1 -# Disabled on armv7 and ppc/power because we haven't currently spent -# any effort on making the tests work there. -# -# The tests rely on libguestfs which needs the kernel to work, and that -# usually doesn't work on i686, so it is disabled. -%ifnarch %{arm} %{ix86} ppc %{power64} - make check -j1 || { cat tests/test-suite.log exit 1 } +%ifnarch %{complete_test_arches} %if 0%{?have_libguestfs} %if 0%{?have_python3} pushd python3 @@ -438,7 +448,6 @@ make check -j1 TESTS=test-python || { popd %endif %endif - %endif @@ -604,6 +613,9 @@ popd %changelog +* Fri Jan 26 2018 Richard W.M. Jones - 1.1.28-2 +- Run a simplified test suite on all arches. + * Mon Jan 22 2018 Richard W.M. Jones - 1.1.28-1 - New upstream version 1.1.28. - Add two new filters to nbdkit-basic-filters.