libvirt/tests/Makefile.am

1572 lines
39 KiB
Makefile
Raw Normal View History

2006-05-09 15:35:46 +00:00
## Process this file with automake to produce Makefile.in
## Copyright (C) 2005-2019 Red Hat, Inc.
maint: use LGPL correctly Several files called out COPYING or COPYING.LIB instead of using the normal boilerplate. It's especially important that we don't call out COPYING from an LGPL file, since COPYING is traditionally used for the GPL. A few files were lacking copyright altogether. * src/rpc/gendispatch.pl: Add missing copyright. * Makefile.nonreentrant: Likewise. * src/check-symfile.pl: Likewise. * src/check-symsorting.pl: Likewise. * src/driver.h: Likewise. * src/internal.h: Likewise. * tools/libvirt-guests.sh.in: Likewise. * tools/virt-pki-validate.in: Mention copyright in comment, not just code. * tools/virt-sanlock-cleanup.in: Likewise. * src/rpc/genprotocol.pl: Spell out license terms. * src/xen/xend_internal.h: Likewise. * src/xen/xend_internal.c: Likewise. * Makefile.am: Likewise. * daemon/Makefile.am: Likewise. * docs/Makefile.am: Likewise. * docs/schemas/Makefile.am: Likewise. * examples/apparmor/Makefile.am: Likewise. * examples/domain-events/events-c/Makefile.am: Likewise. * examples/dominfo/Makefile.am: Likewise. * examples/domsuspend/Makefile.am: Likewise. * examples/hellolibvirt/Makefile.am: Likewise. * examples/openauth/Makefile.am: Likewise. * examples/python/Makefile.am: Likewise. * examples/systemtap/Makefile.am: Likewise. * examples/xml/nwfilter/Makefile.am: Likewise. * gnulib/lib/Makefile.am: Likewise. * gnulib/tests/Makefile.am: Likewise. * include/Makefile.am: Likewise. * include/libvirt/Makefile.am: Likewise. * python/Makefile.am: Likewise. * python/tests/Makefile.am: Likewise. * src/Makefile.am: Likewise. * tests/Makefile.am: Likewise. * tools/Makefile.am: Likewise. * configure.ac: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-14 23:42:12 +00:00
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library. If not, see
## <http://www.gnu.org/licenses/>.
AM_CPPFLAGS = \
-I$(top_builddir) -I$(top_srcdir) \
-I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_builddir)/src -I$(top_srcdir)/src \
-I$(top_srcdir)/src/util \
-I$(top_srcdir)/src/conf \
-I$(top_srcdir)/src/hypervisor \
-I$(top_builddir)/src/rpc \
$(NULL)
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)
AM_CFLAGS = \
-Dabs_builddir="\"$(abs_builddir)\"" \
-Dabs_top_builddir="\"$(abs_top_builddir)\"" \
-Dabs_srcdir="\"$(abs_srcdir)\"" \
-Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
$(LIBXML_CFLAGS) \
build: link to glib library Add the main glib.h to internal.h so that all common code can use it. Historically glib allowed applications to register an alternative memory allocator, so mixing g_malloc/g_free with malloc/free was not safe. This was feature was dropped in 2.46.0 with: commit 3be6ed60aa58095691bd697344765e715a327fc1 Author: Alexander Larsson <alexl@redhat.com> Date: Sat Jun 27 18:38:42 2015 +0200 Deprecate and drop support for memory vtables Applications are still encourged to match g_malloc/g_free, but it is no longer a mandatory requirement for correctness, just stylistic. This is explicitly clarified in commit 1f24b36607bf708f037396014b2cdbc08d67b275 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Thu Sep 5 14:37:54 2019 +0100 gmem: clarify that g_malloc always uses the system allocator Applications can still use custom allocators in general, but they must do this by linking to a library that replaces the core malloc/free implemenentation entirely, instead of via a glib specific call. This means that libvirt does not need to be concerned about use of g_malloc/g_free causing an ABI change in the public libary, and can avoid memory copying when talking to external libraries. This patch probes for glib, which provides the foundation layer with a collection of data structures, helper APIs, and platform portability logic. Later patches will introduce linkage to gobject which provides the object type system, built on glib, and gio which providing objects for various interesting tasks, most notably including DBus client and server support and portable sockets APIs, but much more too. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-29 15:12:24 +00:00
$(GLIB_CFLAGS) \
qemu: qemuMonitorQueryRxFilter - retrieve guest netdev rx-filter This function can be called at any time to get the current status of a guest's network device rx-filter. In particular it is useful to call after libvirt recieves a NIC_RX_FILTER_CHANGED event - this event only tells you that something has changed in the rx-filter, the details are retrieved with the query-rx-filter monitor command (only available in the json monitor). The command sent to the qemu monitor looks like this: {"execute":"query-rx-filter", "arguments": {"name":"net2"} }' and the results will look something like this: { "return": [ { "promiscuous": false, "name": "net2", "main-mac": "52:54:00:98:2d:e3", "unicast": "normal", "vlan": "normal", "vlan-table": [ 42, 0 ], "unicast-table": [ ], "multicast": "normal", "multicast-overflow": false, "unicast-overflow": false, "multicast-table": [ "33:33:ff:98:2d:e3", "01:80:c2:00:00:21", "01:00:5e:00:00:fb", "33:33:ff:98:2d:e2", "01:00:5e:00:00:01", "33:33:00:00:00:01" ], "broadcast-allowed": false } ], "id": "libvirt-14" } This is all parsed from JSON into a virNetDevRxFilter object for easier consumption. (unicast-table is usually empty, but is also an array of mac addresses similar to multicast-table). (NB: LIBNL_CFLAGS was added to tests/Makefile.am because virnetdev.h now includes util/virnetlink.h, which includes netlink/msg.h when appropriate. Without LIBNL_CFLAGS, gcc can't find that file (if libnl/netlink isn't available, LIBNL_CFLAGS will be empty and virnetlink.h won't try to include netlink/msg.h anyway).)
2014-09-22 16:19:41 +00:00
$(LIBNL_CFLAGS) \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \
2008-02-20 15:38:29 +00:00
$(SELINUX_CFLAGS) \
$(APPARMOR_CFLAGS) \
$(YAJL_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(XDR_CFLAGS) \
$(WARN_CFLAGS)
AM_LDFLAGS = \
-export-dynamic
MOCKLIBS_LDFLAGS = -avoid-version \
-rpath /evil/libtool/hack/to/force/shared/lib/creation \
$(MINGW_EXTRA_LDFLAGS)
DRIVERLIB_LDFLAGS = \
-avoid-version \
-rpath /evil/libtool/hack/to/force/shared/lib/creation \
$(MINGW_EXTRA_LDFLAGS) \
$(FLAT_NAMESPACE_FLAGS) \
$(NULL)
PROBES_O =
if WITH_DTRACE_PROBES
PROBES_O += ../src/libvirt_probes.lo
endif WITH_DTRACE_PROBES
2006-05-09 15:35:46 +00:00
LDADDS = \
$(NO_INDIRECT_LDFLAGS) \
$(PROBES_O) \
build: link to glib library Add the main glib.h to internal.h so that all common code can use it. Historically glib allowed applications to register an alternative memory allocator, so mixing g_malloc/g_free with malloc/free was not safe. This was feature was dropped in 2.46.0 with: commit 3be6ed60aa58095691bd697344765e715a327fc1 Author: Alexander Larsson <alexl@redhat.com> Date: Sat Jun 27 18:38:42 2015 +0200 Deprecate and drop support for memory vtables Applications are still encourged to match g_malloc/g_free, but it is no longer a mandatory requirement for correctness, just stylistic. This is explicitly clarified in commit 1f24b36607bf708f037396014b2cdbc08d67b275 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Thu Sep 5 14:37:54 2019 +0100 gmem: clarify that g_malloc always uses the system allocator Applications can still use custom allocators in general, but they must do this by linking to a library that replaces the core malloc/free implemenentation entirely, instead of via a glib specific call. This means that libvirt does not need to be concerned about use of g_malloc/g_free causing an ABI change in the public libary, and can avoid memory copying when talking to external libraries. This patch probes for glib, which provides the foundation layer with a collection of data structures, helper APIs, and platform portability logic. Later patches will introduce linkage to gobject which provides the object type system, built on glib, and gio which providing objects for various interesting tasks, most notably including DBus client and server support and portable sockets APIs, but much more too. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-29 15:12:24 +00:00
../src/libvirt.la \
$(GLIB_LIBS) \
$(NULL)
2006-05-09 15:35:46 +00:00
MOCKLIBS_LIBS = \
../src/libvirt.la
EXTRA_DIST = \
.valgrind.supp \
bhyvexml2argvdata \
bhyveargv2xmldata \
bhyvexml2xmloutdata \
capabilityschemadata \
commanddata \
cputestdata \
domaincapsdata \
backup: Document new XML for backups Prepare for new backup APIs by describing the XML that will represent a backup. The XML resembles snapshots and checkpoints in being able to select actions for a set of disks, but has other differences. It can support both push model (the hypervisor does the backup directly into the destination file) and pull model (the hypervisor exposes an access port for a third party to grab what is necessary). Add testsuite coverage for some minimal uses of the XML. The <disk> element within <domainbackup> tries to model the same elements as a <disk> under <domain>, but sharing the RNG grammar proved to be hairy. That is in part because while <domain> use <source> to describe a host resource in use by the guest, a backup job is using a host resource that is not visible to the guest: a push backup action is instead describing a <target> (which ultimately could be a remote network resource, but for simplicity the RNG just validates a local file for now), and a pull backup action is instead describing a temporary local file <scratch> (which probably should not be a remote resource). A future refactoring may thus introduce some way to parameterize RNG to accept <disk type='FOO'>...</disk> so that the name of the subelement can be <source> for domain, or <target> or <scratch> as needed for backups. Future patches may improve this area of code. Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-22 01:42:41 +00:00
domainbackupxml2xmlin \
domainbackupxml2xmlout \
domainconfdata \
domainschemadata \
fchostdata \
genericxml2xmlindata \
genericxml2xmloutdata \
interfaceschemadata \
libxlxml2domconfigdata \
2014-02-14 15:06:55 +00:00
lxcconf2xmldata \
lxcxml2xmldata \
lxcxml2xmloutdata \
networkxml2confdata \
networkxml2firewalldata \
networkxml2xmlin \
networkxml2xmlout \
networkxml2xmlupdatein \
networkxml2xmlupdateout \
nodedevschemadata \
nodedevmdevctldata \
virhostcpudata \
nssdata \
nwfilterxml2firewalldata \
nwfilterxml2xmlin \
nwfilterxml2xmlout \
qemuagentdata \
qemublocktestdata \
qemucapabilitiesdata \
qemucaps2xmloutdata \
qemudomaincheckpointxml2xmlin \
qemudomaincheckpointxml2xmlout \
qemudomainsnapshotxml2xmlin \
qemudomainsnapshotxml2xmlout \
qemuhotplugtestcpus \
qemuhotplugtestdevices \
qemuhotplugtestdomains \
qemumigparamsdata \
qemumonitorjsondata \
qemuxml2argvdata \
qemuxml2xmloutdata \
qemustatusxml2xmldata \
qemumemlockdata \
qemufirmwaredata \
qemuvhostuserdata \
secretxml2xmlin \
securityselinuxhelperdata \
securityselinuxlabeldata \
storagepoolcapsschemadata \
storagepoolschemadata \
storagepoolxml2xmlin \
storagepoolxml2xmlout \
storagepoolxml2argvdata \
storagevolschemadata \
storagevolxml2argvdata \
storagevolxml2xmlin \
storagevolxml2xmlout \
sysinfodata \
test-lib.sh \
vboxsnapshotxmldata \
vircaps2xmldata \
vircgroupdata \
virconfdata \
virfiledata \
virjsondata \
virmacmaptestdata \
virmock.h \
virmockstathelpers.c \
virnetdaemondata \
virnetdevtestdata \
virnetdevopenvswitchdata \
virnetworkportxml2xmldata \
virnwfilterbindingxml2xmldata \
virpcitestdata \
virscsidata \
virsh-uriprecedence \
virusbtestdata \
vmwareverdata \
vmx2xmldata \
xlconfigdata \
xmconfigdata \
xml2vmxdata \
virsh-auth.xml \
virstorageutildata \
virfilecachedata \
virresctrldata \
$(NULL)
2006-05-09 15:35:46 +00:00
test_helpers = commandhelper ssh
test_programs = virshtest sockettest \
virhostcputest virbuftest \
commandtest seclabeltest \
virhashtest virconftest \
utiltest shunloadtest \
virtimetest viruritest \
viralloctest \
virauthconfigtest \
virbitmaptest \
vircgrouptest \
vircryptotest \
virpcitest \
virendiantest \
virfiletest \
virfilecachetest \
virfirewalltest \
viriscsitest \
virkeycodetest \
Introduce an internal API for handling file based lockspaces The previously introduced virFile{Lock,Unlock} APIs provide a way to acquire/release fcntl() locks on individual files. For unknown reason though, the POSIX spec says that fcntl() locks are released when *any* file handle referring to the same path is closed. In the following sequence threadA: fd1 = open("foo") threadB: fd2 = open("foo") threadA: virFileLock(fd1) threadB: virFileLock(fd2) threadB: close(fd2) you'd expect threadA to come out holding a lock on 'foo', and indeed it does hold a lock for a very short time. Unfortunately when threadB does close(fd2) this releases the lock associated with fd1. For the current libvirt use case for virFileLock - pidfiles - this doesn't matter since the lock is acquired at startup while single threaded an never released until exit. To provide a more generally useful API though, it is necessary to introduce a slightly higher level abstraction, which is to be referred to as a "lockspace". This is to be provided by a virLockSpacePtr object in src/util/virlockspace.{c,h}. The core idea is that the lockspace keeps track of what files are already open+locked. This means that when a 2nd thread comes along and tries to acquire a lock, it doesn't end up opening and closing a new FD. The lockspace just checks the current list of held locks and immediately returns VIR_ERR_RESOURCE_BUSY. NB, the API as it stands is designed on the basis that the files being locked are not being otherwise opened and used by the application code. One approach to using this API is to acquire locks based on a hash of the filepath. eg to lock /var/lib/libvirt/images/foo.img the application might do virLockSpacePtr lockspace = virLockSpaceNew("/var/lib/libvirt/imagelocks"); lockname = md5sum("/var/lib/libvirt/images/foo.img"); virLockSpaceAcquireLock(lockspace, lockname); NB, in this example, the caller should ensure that the path is canonicalized before calculating the checksum. It is also possible to do locks directly on resources by using a NULL lockspace directory and then using the file path as the lock name eg virLockSpacePtr lockspace = virLockSpaceNew(NULL); virLockSpaceAcquireLock(lockspace, "/var/lib/libvirt/images/foo.img"); This is only safe to do though if no other part of the process will be opening the files. This will be the case when this code is used inside the soon-to-be-reposted virlockd daemon Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-08-02 16:02:40 +00:00
virlockspacetest \
virlogtest \
virrotatingfiletest \
virschematest \
virstringtest \
virportallocatortest \
sysinfotest \
virkmodtest \
vircapstest \
domaincapstest \
domainconftest \
virhostdevtest \
virnetdevtest \
virtypedparamtest \
vshtabletest \
virerrortest \
Introduce an internal API for handling file based lockspaces The previously introduced virFile{Lock,Unlock} APIs provide a way to acquire/release fcntl() locks on individual files. For unknown reason though, the POSIX spec says that fcntl() locks are released when *any* file handle referring to the same path is closed. In the following sequence threadA: fd1 = open("foo") threadB: fd2 = open("foo") threadA: virFileLock(fd1) threadB: virFileLock(fd2) threadB: close(fd2) you'd expect threadA to come out holding a lock on 'foo', and indeed it does hold a lock for a very short time. Unfortunately when threadB does close(fd2) this releases the lock associated with fd1. For the current libvirt use case for virFileLock - pidfiles - this doesn't matter since the lock is acquired at startup while single threaded an never released until exit. To provide a more generally useful API though, it is necessary to introduce a slightly higher level abstraction, which is to be referred to as a "lockspace". This is to be provided by a virLockSpacePtr object in src/util/virlockspace.{c,h}. The core idea is that the lockspace keeps track of what files are already open+locked. This means that when a 2nd thread comes along and tries to acquire a lock, it doesn't end up opening and closing a new FD. The lockspace just checks the current list of held locks and immediately returns VIR_ERR_RESOURCE_BUSY. NB, the API as it stands is designed on the basis that the files being locked are not being otherwise opened and used by the application code. One approach to using this API is to acquire locks based on a hash of the filepath. eg to lock /var/lib/libvirt/images/foo.img the application might do virLockSpacePtr lockspace = virLockSpaceNew("/var/lib/libvirt/imagelocks"); lockname = md5sum("/var/lib/libvirt/images/foo.img"); virLockSpaceAcquireLock(lockspace, lockname); NB, in this example, the caller should ensure that the path is canonicalized before calculating the checksum. It is also possible to do locks directly on resources by using a NULL lockspace directory and then using the file path as the lock name eg virLockSpacePtr lockspace = virLockSpaceNew(NULL); virLockSpaceAcquireLock(lockspace, "/var/lib/libvirt/images/foo.img"); This is only safe to do though if no other part of the process will be opening the files. This will be the case when this code is used inside the soon-to-be-reposted virlockd daemon Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-08-02 16:02:40 +00:00
$(NULL)
test_libraries = libshunload.la \
libvirportallocatormock.la \
libvirnetdaemonmock.la \
libvirnetserverclientmock.la \
libvircgroupmock.la \
libvirhostdevmock.la \
libvirpcimock.la \
libvirnetdevmock.la \
libvirrandommock.la \
libvirprocessmock.la \
libvirhostcpumock.la \
libdomaincapsmock.la \
libvirfilecachemock.la \
libqemuhotplugmock.la \
$(NULL)
if WITH_REMOTE
test_programs += \
virnetmessagetest \
virnetsockettest \
virnetdaemontest \
virnetserverclienttest \
virnettlscontexttest \
virnettlssessiontest \
$(NULL)
endif WITH_REMOTE
if WITH_LINUX
test_programs += fchosttest
test_programs += scsihosttest
test_programs += vircaps2xmltest
test_programs += virresctrltest
test_libraries += libvirusbmock.la \
libvirnetdevbandwidthmock.la \
libvirnumamock.la \
libvirtestmock.la \
libvirfilemock.la \
$(NULL)
endif WITH_LINUX
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD
if WITH_DBUS
test_programs += virdbustest \
virsystemdtest \
$(NULL)
test_libraries += libvirdbusmock.la
if WITH_POLKIT
test_programs += virpolkittest
endif WITH_POLKIT
endif WITH_DBUS
if WITH_SECDRIVER_SELINUX
if WITH_ATTR
test_programs += securityselinuxtest \
viridentitytest
if WITH_QEMU
test_programs += securityselinuxlabeltest
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
if WITH_LIBXL
test_programs += xlconfigtest \
xmconfigtest libxlxml2domconfigtest
test_libraries += libxltestdriver.la libxlmock.la
endif WITH_LIBXL
if WITH_QEMU
test_programs += qemuxml2argvtest qemuxml2xmltest \
backup: Parse and output checkpoint XML Add a new file checkpoint_conf.c that performs the translation to and from new XML describing a checkpoint. The code shares a common base class with snapshots, since a checkpoint similarly represents the domain state at a moment in time. Add some basic testing of round trip XML handling through the new code. Of note - this code intentionally differs from snapshots in that XML schema validation is unconditional, rather than based on a public API flag. We have many existing interfaces that still need to add a flag for opt-in schema validation, but those interfaces have existing clients that may not have been producing strictly-compliant XML, or we may still uncover bugs where our RNG grammar is inconsistent with our code (where omitting the opt-in flag allows existing apps to keep working while waiting for an RNG patch). But since checkpoints are brand-new, it's easier to ensure the code matches the schema by always using the schema. If needed, a later patch could extend the API and add a flag to turn on to request schema validation, rather than having it forced (possibly just the validation of the <domain> sub-element during REDEFINE) - but if a user encounters XML that looks like it should be good but fails to validate with our RNG schema, they would either have to upgrade to a new libvirt that adds the new flag, or upgrade to a new libvirt that fixes the RNG schema, which implies adding such a flag won't help much. Also, the redefine flag requires the <domain> sub-element to be present, rather than catering to historical back-compat to older versions. Signed-off-by: Eric Blake <eblake@redhat.com>
2018-07-08 02:01:14 +00:00
qemudomaincheckpointxml2xmltest qemudomainsnapshotxml2xmltest \
qemumonitorjsontest qemuhotplugtest \
qemuagenttest qemucapabilitiestest qemucaps2xmltest \
qemumemlocktest \
qemucommandutiltest \
qemublocktest \
qemumigparamstest \
qemusecuritytest \
qemufirmwaretest \
qemuvhostusertest \
$(NULL)
test_helpers += qemucapsprobe
test_libraries += libqemumonitortestutils.la \
libqemutestdriver.la \
libqemuxml2argvmock.la \
libqemucaps2xmlmock.la \
libqemucapsprobemock.la \
libqemucpumock.la \
$(NULL)
endif WITH_QEMU
if WITH_LXC
test_programs += lxcxml2xmltest lxcconf2xmltest
endif WITH_LXC
if WITH_OPENVZ
test_programs += openvzutilstest
endif WITH_OPENVZ
if WITH_ESX
test_programs += esxutilstest
endif WITH_ESX
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX
if WITH_VMX
test_programs += vmx2xmltest xml2vmxtest
endif WITH_VMX
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE
if WITH_BHYVE
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
test_libraries += libbhyvexml2argvmock.la libbhyveargv2xmlmock.la
endif WITH_BHYVE
if WITH_YAJL
2017-06-26 14:47:26 +00:00
test_programs += virjsontest
endif WITH_YAJL
test_programs += \
networkxml2xmlupdatetest \
virnetworkportxml2xmltest \
$(NULL)
2009-10-09 12:47:43 +00:00
if WITH_NETWORK
test_programs += \
networkxml2xmltest \
networkxml2conftest \
networkxml2firewalltest \
$(NULL)
endif WITH_NETWORK
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif WITH_STORAGE_SHEEPDOG
test_programs += nwfilterxml2xmltest
test_programs += virnwfilterbindingxml2xmltest
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
test_programs += nwfilterxml2firewalltest
endif WITH_NWFILTER
if WITH_STORAGE
test_programs += storagevolxml2argvtest
test_programs += storagepoolxml2argvtest
test_programs += virstorageutiltest
test_programs += storagepoolxml2xmltest
test_programs += storagepoolcapstest
endif WITH_STORAGE
if WITH_STORAGE_FS
test_programs += virstoragetest
endif WITH_STORAGE_FS
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX
if WITH_NSS
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
test_libraries += libnssmock.la
endif WITH_NSS
test_programs += storagevolxml2xmltest
test_programs += nodedevxml2xmltest
if WITH_NODE_DEVICES
test_programs += nodedevmdevctltest
endif WITH_NODE_DEVICES
test_programs += interfacexml2xmltest
test_programs += cputest
test_programs += metadatatest
test_programs += secretxml2xmltest
test_programs += genericxml2xmltest
if WITH_LINUX
test_programs += virusbtest \
virnetdevbandwidthtest \
$(NULL)
endif WITH_LINUX
test_scripts =
libvirtd_test_scripts = \
libvirtd-fail \
libvirtd-pool \
virsh-auth \
virsh-cpuset \
virsh-define-dev-segfault \
virsh-int-overflow \
virsh-optparse \
virsh-read-bufsiz \
virsh-read-non-seekable \
virsh-schedinfo \
virsh-self-test \
virt-admin-self-test \
virsh-checkpoint \
virsh-snapshot \
virsh-start \
virsh-undefine \
virsh-uriprecedence \
virsh-vcpupin \
$(NULL)
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)
test_programs += \
eventtest \
virdrivermoduletest \
virdriverconnvalidatetest
else ! WITH_LIBVIRTD
EXTRA_DIST += $(libvirtd_test_scripts)
endif ! WITH_LIBVIRTD
test_programs += objecteventtest
if WITH_SECDRIVER_APPARMOR
if WITH_LIBVIRTD
test_scripts += virt-aa-helper-test
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
EXTRA_DIST += virt-aa-helper-test
EXTRA_DIST += $(test_scripts)
if WITH_LINUX
check-access: file-access-clean
VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check
$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-file-access.py \
$(abs_builddir)/test_file_access.txt \
$(abs_srcdir)/permitted_file_access.txt | sort -u
file-access-clean:
> test_file_access.txt
endif WITH_LINUX
EXTRA_DIST += \
permitted_file_access.txt
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
noinst_LTLIBRARIES = $(test_libraries)
else ! WITH_TESTS
check_PROGRAMS = $(test_programs) $(test_helpers)
check_LTLIBRARIES = $(test_libraries)
endif ! WITH_TESTS
TESTS = $(test_programs) \
$(test_scripts)
build: add configure option to disable gnulib tests The gnulib testsuite is relatively stable - the only times it is likely to have a test change from pass to fail is on a gnulib submodule update or a major system change (such as moving from Fedora 18 to 19, or other large change to libc). While it is an important test for end users on arbitrary machines (to make sure that the portability glue works for their machine), it mostly wastes time for development testing (as most developers aren't making any of the major changes that would cause gnulib tests to alter behavior). Thus, it pays to make the tests optional at configure time, defaulting to off for development, on for tarballs, with autobuilders requesting it to be on. It also helps to allow a make-time override, via VIR_TEST_EXPENSIVE=[01] (much the way automake sets up V=[01] for overriding the configure time default of how verbose to be). Automake has some pretty hard-coded magic with regards to the TESTS variable; I had quite a job figuring out how to keep 'make distcheck' passing regardless of the configure option setting in use, while still disabling the tests at runtime when I did not configure them on and did not use the override variable. Thankfully, we require GNU make, which lets me hide some information from Automake's magic handling of TESTS. * bootstrap.conf (bootstrap_epilogue): Munge gnulib test variable. * configure.ac (--enable-expensive-tests): Add new enable switch. (VIR_TEST_EXPENSIVE_DEFAULT, WITH_EXPENSIVE_TESTS): Set new witnesses. * gnulib/tests/Makefile.am (TESTS): Make tests conditional on configure settings and the VIR_TEST_EXPENSIVE variable. * tests/Makefile.am (TESTS_ENVIRONMENT): Expose VIR_TEST_EXPENSIVE to all tests. * autobuild.sh: Enable all tests during autobuilds. * libvirt.spec.in (%configure): Likewise. * mingw-libvirt.spec.in (%mingw_configure): Likewise. * docs/hacking.html.in: Document the option. * HACKING: Regenerate. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-07-31 13:18:58 +00:00
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
TESTS_ENVIRONMENT = \
abs_top_builddir="$(abs_top_builddir)" \
abs_top_srcdir="$(abs_top_srcdir)" \
abs_builddir="$(abs_builddir)" \
abs_srcdir="$(abs_srcdir)" \
LIBVIRT_AUTOSTART=0 \
LC_ALL=C \
VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
$(VG)
VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
--trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \
--suppressions=$(abs_srcdir)/.valgrind.supp
2006-08-24 16:00:19 +00:00
valgrind:
$(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)"
2006-08-24 16:00:19 +00:00
sockettest_SOURCES = \
sockettest.c \
testutils.c testutils.h
sockettest_LDADD = $(LDADDS)
if WITH_LIBXL
libxl_LDADDS = \
../src/libvirt_driver_libxl_impl.la \
$(LDADDS) \
$(NULL)
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)
xlconfigtest_SOURCES = \
xlconfigtest.c testutilsxen.c testutilsxen.h \
testutils.c testutils.h
xlconfigtest_LDADD = libxltestdriver.la \
$(libxl_LDADDS)
xmconfigtest_SOURCES = \
xmconfigtest.c testutilsxen.c testutilsxen.h \
testutils.c testutils.h
xmconfigtest_LDADD = libxltestdriver.la \
$(libxl_LDADDS)
libxlxml2domconfigtest_SOURCES = \
libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
testutils.c testutils.h
libxlxml2domconfigtest_LDADD = libxltestdriver.la \
$(libxl_LDADDS) $(LIBXML_LIBS)
libxlmock_la_SOURCES = \
libxlmock.c
build: link to glib library Add the main glib.h to internal.h so that all common code can use it. Historically glib allowed applications to register an alternative memory allocator, so mixing g_malloc/g_free with malloc/free was not safe. This was feature was dropped in 2.46.0 with: commit 3be6ed60aa58095691bd697344765e715a327fc1 Author: Alexander Larsson <alexl@redhat.com> Date: Sat Jun 27 18:38:42 2015 +0200 Deprecate and drop support for memory vtables Applications are still encourged to match g_malloc/g_free, but it is no longer a mandatory requirement for correctness, just stylistic. This is explicitly clarified in commit 1f24b36607bf708f037396014b2cdbc08d67b275 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Thu Sep 5 14:37:54 2019 +0100 gmem: clarify that g_malloc always uses the system allocator Applications can still use custom allocators in general, but they must do this by linking to a library that replaces the core malloc/free implemenentation entirely, instead of via a glib specific call. This means that libvirt does not need to be concerned about use of g_malloc/g_free causing an ABI change in the public libary, and can avoid memory copying when talking to external libraries. This patch probes for glib, which provides the foundation layer with a collection of data structures, helper APIs, and platform portability logic. Later patches will introduce linkage to gobject which provides the object type system, built on glib, and gio which providing objects for various interesting tasks, most notably including DBus client and server support and portable sockets APIs, but much more too. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-29 15:12:24 +00:00
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) $(GLIB_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
else ! WITH_LIBXL
EXTRA_DIST += xlconfigtest.c \
xmconfigtest.c libxlxml2domconfigtest.c
endif ! WITH_LIBXL
QEMUMONITORTESTUTILS_SOURCES = \
qemumonitortestutils.c \
qemumonitortestutils.h \
testutilsqemuschema.h testutilsqemuschema.c \
$(NULL)
if WITH_QEMU
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
if WITH_DTRACE_PROBES
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
endif WITH_DTRACE_PROBES
qemu_LDADDS += $(LDADDS)
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
libqemucpumock_la_SOURCES = \
qemucpumock.c testutilshostcpus.h
libqemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)
libqemuhotplugmock_la_SOURCES = \
qemuhotplugmock.c
libqemuhotplugmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemuhotplugmock_la_LIBADD = $(MOCKLIBS_LIBS)
2007-07-18 21:34:22 +00:00
qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h \
virfilewrapper.c virfilewrapper.h \
$(NULL)
qemuxml2argvtest_LDADD = libqemutestdriver.la libqemumonitortestutils.la \
$(LDADDS) $(LIBXML_LIBS)
2007-07-18 21:34:22 +00:00
libqemuxml2argvmock_la_SOURCES = \
qemuxml2argvmock.c
libqemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
2007-07-18 21:34:22 +00:00
qemuxml2xmltest_SOURCES = \
qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h \
virfilewrapper.c virfilewrapper.h
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
qemumonitorjsontest_SOURCES = \
qemumonitorjsontest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
$(qemu_LDADDS)
qemucapabilitiestest_SOURCES = \
qemucapabilitiestest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
$(qemu_LDADDS)
qemucapsprobe_SOURCES = \
qemucapsprobe.c
qemucapsprobe_LDADD = \
libqemutestdriver.la $(LDADDS)
libqemucapsprobemock_la_SOURCES = \
qemucapsprobemock.c
libqemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS)
qemucommandutiltest_SOURCES = \
qemucommandutiltest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
$(qemu_LDADDS)
qemucaps2xmltest_SOURCES = \
qemucaps2xmltest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
qemucaps2xmltest_LDADD = $(qemu_LDADDS)
libqemucaps2xmlmock_la_SOURCES = \
qemucaps2xmlmock.c
libqemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
qemuagenttest_SOURCES = \
qemuagenttest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
qemuhotplugtest_SOURCES = \
qemuhotplugtest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
qemuhotplugtest_LDADD = \
libqemutestdriver.la \
libqemumonitortestutils.la \
$(qemu_LDADDS) \
$(NULL)
qemublocktest_SOURCES = \
qemublocktest.c \
testutils.h testutils.c \
testutilsqemu.h testutilsqemu.c \
$(NULL)
qemublocktest_LDADD = \
libqemumonitortestutils.la \
../src/libvirt.la \
$(qemu_LDADDS) \
$(NULL)
backup: Parse and output checkpoint XML Add a new file checkpoint_conf.c that performs the translation to and from new XML describing a checkpoint. The code shares a common base class with snapshots, since a checkpoint similarly represents the domain state at a moment in time. Add some basic testing of round trip XML handling through the new code. Of note - this code intentionally differs from snapshots in that XML schema validation is unconditional, rather than based on a public API flag. We have many existing interfaces that still need to add a flag for opt-in schema validation, but those interfaces have existing clients that may not have been producing strictly-compliant XML, or we may still uncover bugs where our RNG grammar is inconsistent with our code (where omitting the opt-in flag allows existing apps to keep working while waiting for an RNG patch). But since checkpoints are brand-new, it's easier to ensure the code matches the schema by always using the schema. If needed, a later patch could extend the API and add a flag to turn on to request schema validation, rather than having it forced (possibly just the validation of the <domain> sub-element during REDEFINE) - but if a user encounters XML that looks like it should be good but fails to validate with our RNG schema, they would either have to upgrade to a new libvirt that adds the new flag, or upgrade to a new libvirt that fixes the RNG schema, which implies adding such a flag won't help much. Also, the redefine flag requires the <domain> sub-element to be present, rather than catering to historical back-compat to older versions. Signed-off-by: Eric Blake <eblake@redhat.com>
2018-07-08 02:01:14 +00:00
qemudomaincheckpointxml2xmltest_SOURCES = \
qemudomaincheckpointxml2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
qemudomaincheckpointxml2xmltest_LDADD = $(qemu_LDADDS)
qemudomainsnapshotxml2xmltest_SOURCES = \
qemudomainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
qemudomainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
qemumemlocktest_SOURCES = \
qemumemlocktest.c \
testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
qemumemlocktest_LDADD = $(qemu_LDADDS)
qemumigparamstest_SOURCES = \
qemumigparamstest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
qemumigparamstest_LDADD = libqemumonitortestutils.la \
$(qemu_LDADDS)
qemusecuritytest_SOURCES = \
qemusecuritytest.c qemusecuritytest.h \
qemusecuritymock.c \
testutils.h testutils.c \
testutilsqemu.h testutilsqemu.c
qemusecuritytest_LDADD = $(qemu_LDADDS)
qemufirmwaretest_SOURCES = \
qemufirmwaretest.c \
testutils.h testutils.c \
virfilewrapper.c virfilewrapper.h \
$(NULL)
qemufirmwaretest_LDADD = $(qemu_LDADDS)
qemuvhostusertest_SOURCES = \
qemuvhostusertest.c \
testutils.h testutils.c \
virfilewrapper.c virfilewrapper.h \
$(NULL)
qemuvhostusertest_LDADD = $(qemu_LDADDS)
else ! WITH_QEMU
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c \
backup: Parse and output checkpoint XML Add a new file checkpoint_conf.c that performs the translation to and from new XML describing a checkpoint. The code shares a common base class with snapshots, since a checkpoint similarly represents the domain state at a moment in time. Add some basic testing of round trip XML handling through the new code. Of note - this code intentionally differs from snapshots in that XML schema validation is unconditional, rather than based on a public API flag. We have many existing interfaces that still need to add a flag for opt-in schema validation, but those interfaces have existing clients that may not have been producing strictly-compliant XML, or we may still uncover bugs where our RNG grammar is inconsistent with our code (where omitting the opt-in flag allows existing apps to keep working while waiting for an RNG patch). But since checkpoints are brand-new, it's easier to ensure the code matches the schema by always using the schema. If needed, a later patch could extend the API and add a flag to turn on to request schema validation, rather than having it forced (possibly just the validation of the <domain> sub-element during REDEFINE) - but if a user encounters XML that looks like it should be good but fails to validate with our RNG schema, they would either have to upgrade to a new libvirt that adds the new flag, or upgrade to a new libvirt that fixes the RNG schema, which implies adding such a flag won't help much. Also, the redefine flag requires the <domain> sub-element to be present, rather than catering to historical back-compat to older versions. Signed-off-by: Eric Blake <eblake@redhat.com>
2018-07-08 02:01:14 +00:00
qemudomaincheckpointxml2xmltest.c qemudomainsnapshotxml2xmltest.c \
testutilsqemu.c testutilsqemu.h \
testutilsqemuschema.c testutilsqemuschema.h \
qemumonitorjsontest.c qemuhotplugtest.c \
qemuagenttest.c qemucapabilitiestest.c \
qemucaps2xmltest.c qemucommandutiltest.c \
qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
qemublocktest.c \
qemumigparamstest.c \
qemusecuritytest.c qemusecuritytest.h \
qemusecuritymock.c \
qemufirmwaretest.c \
qemuvhostusertest.c \
qemuhotplugmock.c \
$(QEMUMONITORTESTUTILS_SOURCES)
endif ! WITH_QEMU
2007-07-18 21:34:22 +00:00
if WITH_LXC
lxc_LDADDS = \
../src/libvirt_driver_lxc_impl.la \
$(LDADDS) \
$(NULL)
lxcxml2xmltest_SOURCES = \
lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
testutils.c testutils.h
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
lxcconf2xmltest_SOURCES = \
lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
else ! WITH_LXC
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif ! WITH_LXC
if WITH_OPENVZ
openvzutilstest_SOURCES = \
openvzutilstest.c \
testutils.c testutils.h
openvzutilstest_LDADD = $(LDADDS) \
../src/libvirt_driver_openvz.la
else ! WITH_OPENVZ
EXTRA_DIST += openvzutilstest.c
endif ! WITH_OPENVZ
EXTRA_DIST += openvzutilstest.conf
if WITH_ESX
esxutilstest_SOURCES = \
esxutilstest.c \
testutils.c testutils.h
esxutilstest_LDADD = $(LDADDS)
esxutilstest_CFLAGS = \
-I$(top_builddir)/src/esx \
$(AM_CFLAGS)
else ! WITH_ESX
EXTRA_DIST += esxutilstest.c
endif ! WITH_ESX
if WITH_VBOX
vboxsnapshotxmltest_SOURCES = \
vboxsnapshotxmltest.c \
testutils.c testutils.h
vbox_LDADDS = ../src/libvirt_driver_vbox_impl.la
vboxsnapshotxmltest_LDADD = $(LDADDS) $(vbox_LDADDS)
else ! WITH_VBOX
EXTRA_DIST += vboxsnapshotxmltest.c
endif ! WITH_VBOX
if WITH_VMX
vmx2xmltest_SOURCES = \
vmx2xmltest.c \
testutils.c testutils.h
vmx2xmltest_LDADD = $(LDADDS)
xml2vmxtest_SOURCES = \
xml2vmxtest.c \
testutils.c testutils.h
xml2vmxtest_LDADD = $(LDADDS)
else ! WITH_VMX
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
endif ! WITH_VMX
if WITH_VMWARE
vmwarevertest_SOURCES = \
vmwarevertest.c \
testutils.c testutils.h
vmwarevertest_LDADD = $(LDADDS)
else ! WITH_VMWARE
EXTRA_DIST += vmwarevertest.c
endif ! WITH_VMWARE
if WITH_BHYVE
libbhyvexml2argvmock_la_SOURCES = \
bhyvexml2argvmock.c
libbhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
libbhyveargv2xmlmock_la_SOURCES = \
bhyveargv2xmlmock.c
libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
bhyve_LDADDS = \
../src/libvirt_driver_bhyve_impl.la \
$(LDADDS) \
$(NULL)
bhyvexml2argvtest_SOURCES = \
bhyvexml2argvtest.c \
testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
bhyvexml2xmltest_SOURCES = \
bhyvexml2xmltest.c \
testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
bhyveargv2xmltest_SOURCES = \
bhyveargv2xmltest.c \
testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
else ! WITH_BHYVE
EXTRA_DIST += \
bhyvexml2argvtest.c \
bhyveargv2xmltest.c \
bhyvexml2xmltest.c \
bhyvexml2argvmock.c \
bhyveargv2xmlmock.c
endif ! WITH_BHYVE
networkxml2xmlupdatetest_SOURCES = \
networkxml2xmlupdatetest.c \
testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)
virnetworkportxml2xmltest_SOURCES = \
virnetworkportxml2xmltest.c \
testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)
if WITH_NETWORK
networkxml2xmltest_SOURCES = \
networkxml2xmltest.c \
testutils.c testutils.h
networkxml2xmltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
networkxml2conftest_SOURCES = \
networkxml2conftest.c \
testutils.c testutils.h
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
networkxml2firewalltest_SOURCES = \
networkxml2firewalltest.c \
testutils.c testutils.h
networkxml2firewalltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
else ! WITH_NETWORK
EXTRA_DIST += networkxml2xmltest.c networkxml2conftest.c
endif ! WITH_NETWORK
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
storagebackendsheepdogtest.c \
testutils.c testutils.h
storagebackendsheepdogtest_LDADD = \
../src/libvirt_storage_backend_sheepdog_priv.la \
../src/libvirt_driver_storage_impl.la \
$(LDADDS)
else ! WITH_STORAGE_SHEEPDOG
EXTRA_DIST += storagebackendsheepdogtest.c
endif ! WITH_STORAGE_SHEEPDOG
nwfilterxml2xmltest_SOURCES = \
nwfilterxml2xmltest.c \
testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
virnwfilterbindingxml2xmltest_SOURCES = \
virnwfilterbindingxml2xmltest.c \
testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
nwfilterebiptablestest.c \
testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
nwfilterxml2firewalltest_SOURCES = \
nwfilterxml2firewalltest.c \
testutils.c testutils.h
nwfilterxml2firewalltest_LDADD = \
../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
endif WITH_NWFILTER
secretxml2xmltest_SOURCES = \
secretxml2xmltest.c \
testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)
genericxml2xmltest_SOURCES = \
genericxml2xmltest.c \
testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)
if WITH_STORAGE
virstorageutiltest_SOURCES = \
virstorageutiltest.c \
testutils.c \
testutils.h \
$(NULL)
virstorageutiltest_LDADD = \
../src/libvirt_driver_storage_impl.la \
$(LDADDS) \
$(NULL)
storagevolxml2argvtest_SOURCES = \
storagevolxml2argvtest.c \
testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
$(LIBXML_LIBS) \
../src/libvirt_driver_storage_impl.la \
../src/libvirt.la \
$(LDADDS)
storagepoolxml2argvtest_SOURCES = \
storagepoolxml2argvtest.c \
testutils.c testutils.h
storagepoolxml2argvtest_LDADD = \
$(LIBXML_LIBS) \
../src/libvirt_driver_storage_impl.la \
../src/libvirt.la \
$(LDADDS)
storagepoolxml2xmltest_SOURCES = \
storagepoolxml2xmltest.c \
testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
../src/libvirt_driver_storage_impl.la
storagepoolcapstest_SOURCES = \
storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)
else ! WITH_STORAGE
EXTRA_DIST += storagevolxml2argvtest.c
EXTRA_DIST += virstorageutiltest.c
EXTRA_DIST += storagepoolxml2argvtest.c
EXTRA_DIST += storagepoolxml2xmltest.c
EXTRA_DIST += storagepoolcapstest.c
endif ! WITH_STORAGE
storagevolxml2xmltest_SOURCES = \
storagevolxml2xmltest.c \
testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)
nodedevxml2xmltest_SOURCES = \
nodedevxml2xmltest.c \
testutils.c testutils.h
nodedevxml2xmltest_LDADD = $(LDADDS)
if WITH_NODE_DEVICES
nodedevmdevctltest_SOURCES = \
nodedevmdevctltest.c \
testutils.c testutils.h
nodedevmdevctltest_LDADD = \
../src/libvirt_driver_nodedev_impl.la \
$(LDADDS)
endif WITH_NODE_DEVICES
interfacexml2xmltest_SOURCES = \
interfacexml2xmltest.c \
testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)
cputest_SOURCES = \
cputest.c \
testutils.c testutils.h
cputest_LDADD = $(LIBXML_LIBS)
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
metadatatest_SOURCES = \
metadatatest.c \
testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)
virerrortest_SOURCES = \
virerrortest.c \
testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)
vshtabletest_SOURCES = \
vshtabletest.c \
testutils.c testutils.h
vshtabletest_LDADD = \
$(LDADDS) \
../tools/libvirt_shell.la
virshtest_SOURCES = \
virshtest.c \
testutils.c testutils.h
virshtest_LDADD = $(LDADDS)
virconftest_SOURCES = \
virconftest.c testutils.h testutils.c
virconftest_LDADD = $(LDADDS)
virhostcputest_SOURCES = \
virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virhostcputest_LDADD = $(LDADDS)
2007-07-25 23:16:30 +00:00
commandtest_SOURCES = \
commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)
# Must not link to any libvirt modules - libc only
Stop linking tests/commandhelper to libvirt code The commandhelper binary is a helper for commandtest that validates what file handles were inherited. For this to work reliably we must not have any libraries that leak file descriptors into commandhelper. Unfortunately some versions of gnutls will intentionally open file handles at library load time via a constructor function. We previously hacked around this in commit 4cbc15d037e1cd8abf5c4aa6acc30d83ae13e34d Author: Martin Kletzander <mkletzan@redhat.com> Date: Fri May 2 09:55:52 2014 +0200 tests: don't fail with newer gnutls gnutls-3.3.0 and newer leaves 2 FDs open in order to be backwards compatible when it comes to chrooted binaries [1]. Linking commandhelper with gnutls then leaves these two FDs open and commandtest fails thanks to that. This patch does not link commandhelper with libvirt.la, but rather only the utilities making the test pass. Based on suggestion from Daniel [2]. [1] http://lists.gnutls.org/pipermail/gnutls-help/2014-April/003429.html [2] https://www.redhat.com/archives/libvir-list/2014-April/msg01119.html That fix relied on fact that while libvirt.so linked with gnutls, libvirt_util.la did not link to it. With the introduction of the util/vircrypto.c file that assumption is no longer valid. We must not link to libvirt_util.la at all - only gnulib and libc can (hopefully) be relied on not to open random file descriptors in constructors. Reviewed-by: Martin Kletzander <mkletzan@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-09-20 11:03:47 +00:00
# otherwise external libraries might unexpectedly leak
# file descriptors into commandhelper invalidating the
# test logic assumptions
commandhelper_SOURCES = \
commandhelper.c
commandhelper_LDADD = \
$(NO_INDIRECT_LDFLAGS)
commandhelper_LDFLAGS = -static
virkmodtest_SOURCES = \
virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)
vircapstest_SOURCES = \
vircapstest.c testutils.h testutils.c
if WITH_LXC
vircapstest_SOURCES += testutilslxc.c testutilslxc.h
endif WITH_LXC
if WITH_QEMU
vircapstest_SOURCES += testutilsqemu.c testutilsqemu.h
endif WITH_QEMU
vircapstest_LDADD =
if WITH_QEMU
vircapstest_LDADD += ../src/libvirt_driver_qemu_impl.la
if WITH_DTRACE_PROBES
vircapstest_LDADD += ../src/libvirt_qemu_probes.lo
endif WITH_DTRACE_PROBES
endif WITH_QEMU
if WITH_LXC
vircapstest_LDADD += ../src/libvirt_driver_lxc_impl.la
endif WITH_LXC
vircapstest_LDADD += $(LDADDS)
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
domaincapstest_SOURCES = \
domaincapstest.c testutils.h testutils.c \
virfilewrapper.c virfilewrapper.h \
$(NULL)
domaincapstest_LDADD = $(LDADDS)
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
domaincapstest_LDADD += libqemutestdriver.la
endif WITH_QEMU
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
domaincapstest_LDADD += libxltestdriver.la
endif WITH_LIBXL
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la
endif WITH_BHYVE
virnetmessagetest_SOURCES = \
virnetmessagetest.c testutils.h testutils.c
virnetmessagetest_LDADD = $(LDADDS)
virnetsockettest_SOURCES = \
virnetsockettest.c testutils.h testutils.c
virnetsockettest_LDADD = $(LDADDS)
virnetdaemontest_SOURCES = \
virnetdaemontest.c \
testutils.h testutils.c
virnetdaemontest_LDADD = $(LDADDS)
libvirnetdaemonmock_la_SOURCES = \
virnetdaemonmock.c
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
virnetserverclienttest_SOURCES = \
virnetserverclienttest.c \
testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)
libvirnetserverclientmock_la_SOURCES = \
virnetserverclientmock.c
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
virnettlscontexttest_SOURCES = \
virnettlscontexttest.c \
virnettlshelpers.h virnettlshelpers.c \
testutils.h testutils.c
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
virnettlssessiontest_SOURCES = \
virnettlssessiontest.c \
virnettlshelpers.h virnettlshelpers.c \
testutils.h testutils.c
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
else ! HAVE_LIBTASN1
EXTRA_DIST += pkix_asn1_tab.c
endif ! HAVE_LIBTASN1
virtimetest_SOURCES = \
virtimetest.c testutils.h testutils.c
virtimetest_LDADD = $(LDADDS)
virschematest_SOURCES = \
virschematest.c testutils.h testutils.c
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
virstringtest_SOURCES = \
virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)
virstoragetest_SOURCES = \
virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS) \
../src/libvirt.la \
../src/libvirt_driver_storage_impl.la \
$(NULL)
viridentitytest_SOURCES = \
viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
if WITH_SELINUX
viridentitytest_LDADD += $(SELINUX_LIBS)
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
endif WITH_SELINUX
viriscsitest_SOURCES = \
viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)
virkeycodetest_SOURCES = \
virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)
Introduce an internal API for handling file based lockspaces The previously introduced virFile{Lock,Unlock} APIs provide a way to acquire/release fcntl() locks on individual files. For unknown reason though, the POSIX spec says that fcntl() locks are released when *any* file handle referring to the same path is closed. In the following sequence threadA: fd1 = open("foo") threadB: fd2 = open("foo") threadA: virFileLock(fd1) threadB: virFileLock(fd2) threadB: close(fd2) you'd expect threadA to come out holding a lock on 'foo', and indeed it does hold a lock for a very short time. Unfortunately when threadB does close(fd2) this releases the lock associated with fd1. For the current libvirt use case for virFileLock - pidfiles - this doesn't matter since the lock is acquired at startup while single threaded an never released until exit. To provide a more generally useful API though, it is necessary to introduce a slightly higher level abstraction, which is to be referred to as a "lockspace". This is to be provided by a virLockSpacePtr object in src/util/virlockspace.{c,h}. The core idea is that the lockspace keeps track of what files are already open+locked. This means that when a 2nd thread comes along and tries to acquire a lock, it doesn't end up opening and closing a new FD. The lockspace just checks the current list of held locks and immediately returns VIR_ERR_RESOURCE_BUSY. NB, the API as it stands is designed on the basis that the files being locked are not being otherwise opened and used by the application code. One approach to using this API is to acquire locks based on a hash of the filepath. eg to lock /var/lib/libvirt/images/foo.img the application might do virLockSpacePtr lockspace = virLockSpaceNew("/var/lib/libvirt/imagelocks"); lockname = md5sum("/var/lib/libvirt/images/foo.img"); virLockSpaceAcquireLock(lockspace, lockname); NB, in this example, the caller should ensure that the path is canonicalized before calculating the checksum. It is also possible to do locks directly on resources by using a NULL lockspace directory and then using the file path as the lock name eg virLockSpacePtr lockspace = virLockSpaceNew(NULL); virLockSpaceAcquireLock(lockspace, "/var/lib/libvirt/images/foo.img"); This is only safe to do though if no other part of the process will be opening the files. This will be the case when this code is used inside the soon-to-be-reposted virlockd daemon Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-08-02 16:02:40 +00:00
virlockspacetest_SOURCES = \
virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)
virlogtest_SOURCES = \
virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)
virportallocatortest_SOURCES = \
virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)
libvirportallocatormock_la_SOURCES = \
virportallocatormock.c
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
vircgrouptest_SOURCES = \
vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)
libvircgroupmock_la_SOURCES = \
vircgroupmock.c
libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
vircryptotest_SOURCES = \
vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)
virhostdevtest_SOURCES = \
virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)
virpcitest_SOURCES = \
virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)
libvirpcimock_la_SOURCES = \
virpcimock.c
libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
libvirrandommock_la_SOURCES = \
virrandommock.c
libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS)
libvirprocessmock_la_SOURCES = \
virprocessmock.c
libvirprocessmock_la_CFLAGS = $(AM_CFLAGS)
libvirprocessmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirprocessmock_la_LIBADD = $(MOCKLIBS_LIBS)
libvirhostcpumock_la_SOURCES = \
virhostcpumock.c
libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
libvirfilecachemock_la_SOURCES = \
virfilecachemock.c
libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)
libvirhostdevmock_la_SOURCES = \
virhostdevmock.c \
$(NULL)
libvirhostdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
if WITH_LINUX
vircaps2xmltest_SOURCES = \
vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
vircaps2xmltest_LDADD = $(LDADDS)
libvirnumamock_la_SOURCES = \
virnumamock.c
libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
virresctrltest_SOURCES = \
virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)
libvirfilemock_la_SOURCES = \
virfilemock.c
libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
else ! WITH_LINUX
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
virfilewrapper.h virresctrltest.c virfilemock.c
endif ! WITH_LINUX
if WITH_NSS
nsstest_SOURCES = \
nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
$(AM_CFLAGS) \
-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
$(LDADDS) \
../tools/nss/libnss_libvirt_impl.la
nssguesttest_SOURCES = \
nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
-DLIBVIRT_NSS_GUEST \
$(AM_CFLAGS) \
-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
$(LDADDS) \
../tools/nss/libnss_libvirt_guest_impl.la
libnssmock_la_SOURCES = \
nssmock.c
libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libnssmock_la_LIBADD = $(MOCKLIBS_LIBS)
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
nsslinktest_CFLAGS = \
$(AM_CFLAGS) \
-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)
nssguestlinktest_SOURCES = nsslinktest.c
nssguestlinktest_CFLAGS = \
-DLIBVIRT_NSS_GUEST \
$(AM_CFLAGS) \
-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
libvirdeterministichashmock_la_SOURCES = \
virdeterministichashmock.c
libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
test_libraries += libvirdeterministichashmock.la
if WITH_YAJL
virmacmaptest_SOURCES = \
virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)
virnetdevopenvswitchtest_SOURCES = \
virnetdevopenvswitchtest.c testutils.h testutils.c
virnetdevopenvswitchtest_LDADD = $(LDADDS)
test_programs += \
virmacmaptest \
virnetdevopenvswitchtest
else ! WITH_YAJL
EXTRA_DIST += \
virmacmaptest.c \
virnetdevopenvswitchtest.c
endif ! WITH_YAJL
virnetdevtest_SOURCES = \
virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)
libvirnetdevmock_la_SOURCES = \
virnetdevmock.c
libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
virrotatingfiletest_SOURCES = \
virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)
if WITH_LINUX
virusbtest_SOURCES = \
virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)
virnetdevbandwidthtest_SOURCES = \
virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)
libvirusbmock_la_SOURCES = virusbmock.c
libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
$(PROBES_O) \
../src/libvirt_util.la
libvirnetdevbandwidthmock_la_SOURCES = \
virnetdevbandwidthmock.c
libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
libvirtestmock_la_SOURCES = \
virtestmock.c
libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirtestmock_la_LIBADD = \
$(MOCKLIBS_LIBS) \
$(PROBES_O) \
../src/libvirt_util.la
else ! WITH_LINUX
EXTRA_DIST += virusbtest.c virusbmock.c \
virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
virtestmock.c
endif ! WITH_LINUX
if WITH_DBUS
virdbustest_SOURCES = \
virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
libvirdbusmock_la_SOURCES = \
virdbusmock.c
libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
virpolkittest_SOURCES = \
virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)
virsystemdtest_SOURCES = \
virsystemdtest.c testutils.h testutils.c
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
else ! WITH_DBUS
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
endif ! WITH_DBUS
viruritest_SOURCES = \
viruritest.c testutils.h testutils.c
viruritest_LDADD = $(LDADDS)
viralloctest_SOURCES = \
viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)
virauthconfigtest_SOURCES = \
virauthconfigtest.c testutils.h testutils.c
virauthconfigtest_LDADD = $(LDADDS)
seclabeltest_SOURCES = \
seclabeltest.c testutils.h testutils.c
seclabeltest_LDADD = $(LDADDS)
if WITH_SECDRIVER_SELINUX
if WITH_ATTR
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
else ! WITH_TESTS
check_LTLIBRARIES += libsecurityselinuxhelper.la
endif ! WITH_TESTS
libsecurityselinuxhelper_la_SOURCES = \
securityselinuxhelper.c
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
securityselinuxtest_SOURCES = \
securityselinuxtest.c testutils.h testutils.c
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
securityselinuxlabeltest.c testutils.h testutils.c \
testutilsqemu.h testutilsqemu.c
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
securityselinuxhelper.c
virbuftest_SOURCES = \
virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)
virhashtest_SOURCES = \
virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
virbitmaptest_SOURCES = \
virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)
virendiantest_SOURCES = \
virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)
virfiletest_SOURCES = \
virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)
virfilecachetest_SOURCES = \
virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)
virfirewalltest_SOURCES = \
virfirewalltest.c testutils.h testutils.c
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
2017-06-26 14:47:26 +00:00
virjsontest_SOURCES = \
virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
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)
virdriverconnvalidatetest_SOURCES = \
virdriverconnvalidatetest.c testutils.h testutils.c
virdriverconnvalidatetest_LDADD = $(LDADDS)
endif WITH_LIBVIRTD
if WITH_LIBVIRTD
eventtest_SOURCES = \
eventtest.c testutils.h testutils.c
eventtest_LDADD = $(LDADDS)
endif WITH_LIBVIRTD
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
shunloadtest_SOURCES = \
shunloadtest.c
shunloadtest_LDADD = $(THREAD_LIBS) $(DLOPEN_LIBS)
shunloadtest_DEPENDENCIES = libshunload.la
sysinfotest_SOURCES = \
sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)
domainconftest_SOURCES = \
domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)
fdstreamtest_SOURCES = \
fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)
objecteventtest_SOURCES = \
objecteventtest.c \
testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)
virtypedparamtest_SOURCES = \
virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)
if WITH_LINUX
fchosttest_SOURCES = \
fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)
scsihosttest_SOURCES = \
scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
EXTRA_DIST += scsihosttest.c
endif ! WITH_LINUX
if WITH_LINUX
virscsitest_SOURCES = \
virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)
else ! WITH_LINUX
EXTRA_DIST += virscsitest.c
endif ! WITH_LINUX
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda