[libvirt] [PATCH] Make ZFS storage pool XML tests optional
Eric Blake
eblake at redhat.com
Thu Jan 15 22:37:15 UTC 2015
On 01/15/2015 03:32 PM, Gary R Hook wrote:
> From: Gary R Hook <grhookatwork at gmail.com>
>
> Do not run ZFS tests when ZFS is unsupported in the environment.
>
> The recent patch b4af40226d09adeaf9e33a1d6594c4e8ce7f771d adds tests
> to storagepoolxml2xmltest for the optional ZFS feature. When ZFS is
> not included in the configuration these tests should not / cannot be
> run. Modify Makefile.am and the test source file to check for use of
> the feature and compile in the tests accordingly.
>
> Signed-off-by: Gary R Hook <gary.hook at nimboxx.com>
>
> ---
> tests/Makefile.am | 4 ++++
> tests/storagepoolxml2xmltest.c | 2 ++
> 2 files changed, 6 insertions(+)
>
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index e9418ea..8f8df27 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -780,6 +780,10 @@ storagepoolxml2xmltest_SOURCES = \
> storagepoolxml2xmltest.c \
> testutils.c testutils.h
> storagepoolxml2xmltest_LDADD = $(LDADDS)
> +storagepoolxml2xmltest_CFLAGS = $(AM_CFLAGS)
> +if WITH_STORAGE_ZFS
> +storagepoolxml2xmltest_CFLAGS += -DWITH_STORAGE_ZFS
> +endif
This shouldn't be needed. Our config.h should already be defining all
the appropriate WITH_* feature macros. If it is not, that's a bug in
configure.ac.
>
> nodedevxml2xmltest_SOURCES = \
> nodedevxml2xmltest.c \
> diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c
> index 52e2193..270f75d 100644
> --- a/tests/storagepoolxml2xmltest.c
> +++ b/tests/storagepoolxml2xmltest.c
> @@ -106,8 +106,10 @@ mymain(void)
> DO_TEST("pool-gluster");
> DO_TEST("pool-gluster-sub");
> DO_TEST("pool-scsi-type-scsi-host-stable");
> +#ifdef WITH_STORAGE_ZFS
> DO_TEST("pool-zfs");
> DO_TEST("pool-zfs-sourcedev");
> +#endif
Why is only this test conditional? Shouldn't other things like gluster
also be conditional, based on whether those features were built into
libvirt?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150115/44d62246/attachment-0001.sig>
More information about the libvir-list
mailing list