[libvirt] [PATCH 0/2] tests: fix build without WITH_LIBVIRTD defined

'virdrivermoduletest' failure was caught by the centos ci. virt-aa-helper-test while testing it on my machine with specifically disabled libvirtd. Peter Krempa (2): tests: Run virt-aa-helper-test only when the helper was compiled tests: Run virdrivermoduletest only when WITH_LIBVIRTD is defined tests/Makefile.am | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 2.13.2

'virt-aa-helper' is compiled when both WITH_LIBVIRTD and WITH_SECDRIVER_APPARMOR are defined. The test was run only when WITH_SECDRIVER_APPARMOR was defined thus causing a build failure when building without the daemon. --- tests/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 542c4a572..6da3e4778 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -423,10 +423,11 @@ endif ! WITH_LIBVIRTD test_programs += objecteventtest if WITH_SECDRIVER_APPARMOR +if WITH_LIBVIRTD test_scripts += virt-aa-helper-test -else ! WITH_SECDRIVER_APPARMOR +endif WITH_LIBVIRTD +endif WITH_SECDRIVER_APPARMOR EXTRA_DIST += virt-aa-helper-test -endif ! WITH_SECDRIVER_APPARMOR EXTRA_DIST += $(test_scripts) -- 2.13.2

The test makes sense only when building the daemon, thus run it only in such case. --- tests/Makefile.am | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 6da3e4778..3e3d58071 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -261,8 +261,6 @@ endif WITH_QEMU endif WITH_ATTR endif WITH_SECDRIVER_SELINUX -test_programs += virdrivermoduletest - # This is a fake SSH we use from virnetsockettest ssh_SOURCES = ssh.c ssh_LDADD = $(COVERAGE_LDFLAGS) @@ -415,7 +413,8 @@ if WITH_LIBVIRTD test_scripts += $(libvirtd_test_scripts) test_programs += \ - eventtest + eventtest \ + virdrivermoduletest else ! WITH_LIBVIRTD EXTRA_DIST += $(libvirtd_test_scripts) endif ! WITH_LIBVIRTD @@ -1393,9 +1392,11 @@ utiltest_SOURCES = \ utiltest.c testutils.h testutils.c utiltest_LDADD = $(LDADDS) +if WITH_LIBVIRTD virdrivermoduletest_SOURCES = \ virdrivermoduletest.c testutils.h testutils.c virdrivermoduletest_LDADD = $(LDADDS) +endif WITH_LIBVIRTD if WITH_LIBVIRTD eventtest_SOURCES = \ -- 2.13.2

On Fri, Jul 28, 2017 at 12:18:10PM +0200, Peter Krempa wrote:
'virdrivermoduletest' failure was caught by the centos ci. virt-aa-helper-test while testing it on my machine with specifically disabled libvirtd.
Peter Krempa (2): tests: Run virt-aa-helper-test only when the helper was compiled tests: Run virdrivermoduletest only when WITH_LIBVIRTD is defined
tests/Makefile.am | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
ACK series Jan
participants (2)
-
Ján Tomko
-
Peter Krempa