Run a simplified test suite on all arches.

Note this change *enhances* test coverage.
This commit is contained in:
Richard W.M. Jones 2018-01-26 17:49:22 +00:00
parent 44518f07e0
commit f8754ffa26

View File

@ -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 <rjones@redhat.com> - 1.1.28-2
- Run a simplified test suite on all arches.
* Mon Jan 22 2018 Richard W.M. Jones <rjones@redhat.com> - 1.1.28-1
- New upstream version 1.1.28.
- Add two new filters to nbdkit-basic-filters.