mirror of https://gitlab.com/libvirt/libvirt.git
Compare commits
13 Commits
df9ffb0256
...
a47e73d6e7
Author | SHA1 | Date |
---|---|---|
Daniel P. Berrangé | a47e73d6e7 | |
Daniel P. Berrangé | 479333af2c | |
Daniel P. Berrangé | 7817c3f89c | |
Daniel P. Berrangé | 971305e86f | |
Daniel P. Berrangé | c8c5170b74 | |
Daniel P. Berrangé | 08bfb18736 | |
Daniel P. Berrangé | a76ffee365 | |
Daniel P. Berrangé | 0dc278dd02 | |
Daniel P. Berrangé | bdfe46ed6e | |
Daniel P. Berrangé | 67ac2cd590 | |
Daniel P. Berrangé | 20acd5b1be | |
Daniel P. Berrangé | ae6a89884a | |
Daniel P. Berrangé | e1c32120ce |
|
@ -4,6 +4,7 @@ option('packager_version', type: 'string', value: '', description: 'Extra packag
|
|||
option('system', type: 'boolean', value: false, description: 'Set install paths to system ones')
|
||||
option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc')
|
||||
option('initconfdir', type: 'string', value: '', description: 'directory for init script configuration files')
|
||||
# dep:tests
|
||||
option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts)')
|
||||
option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation')
|
||||
option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT')
|
||||
|
@ -17,6 +18,7 @@ option('tests', type: 'feature', value: 'auto', description: 'whether to build a
|
|||
option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support')
|
||||
option('attr', type: 'feature', value: 'auto', description: 'attr support')
|
||||
option('audit', type: 'feature', value: 'auto', description: 'audit support')
|
||||
# dep:readline
|
||||
option('bash_completion', type: 'feature', value: 'auto', description: 'bash-completion support')
|
||||
option('bash_completion_dir', type: 'string', value: '', description: 'directory containing bash completion scripts')
|
||||
option('blkid', type: 'feature', value: 'auto', description: 'blkid support')
|
||||
|
@ -40,7 +42,9 @@ option('sanlock', type: 'feature', value: 'auto', description: 'sanlock support'
|
|||
option('sasl', type: 'feature', value: 'auto', description: 'sasl support')
|
||||
option('selinux', type: 'feature', value: 'auto', description: 'selinux support')
|
||||
option('selinux_mount', type: 'string', value: '', description: 'set SELinux mount point')
|
||||
# dep:pciaccess
|
||||
option('udev', type: 'feature', value: 'auto', description: 'udev support')
|
||||
# dep:driver_remote
|
||||
option('wireshark_dissector', type: 'feature', value: 'auto', description: 'wireshark support')
|
||||
option('wireshark_plugindir', type: 'string', value: '', description: 'wireshark plugins directory for use when installing wireshark plugin')
|
||||
option('yajl', type: 'feature', value: 'auto', description: 'yajl support')
|
||||
|
@ -48,17 +52,26 @@ option('yajl', type: 'feature', value: 'auto', description: 'yajl support')
|
|||
|
||||
# build driver options
|
||||
option('driver_bhyve', type: 'feature', value: 'auto', description: 'bhyve driver')
|
||||
# dep:curl
|
||||
option('driver_esx', type: 'feature', value: 'auto', description: 'esx driver')
|
||||
# dep:openwsman
|
||||
option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V driver')
|
||||
# dep:pciaccess dep:udev dep:driver_remote dep:driver_libvirtd
|
||||
option('driver_interface', type: 'feature', value: 'auto', description: 'host interface driver')
|
||||
# dep:driver_remote
|
||||
option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver')
|
||||
# dep:driver_remote dep:driver_libvirtd
|
||||
option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver')
|
||||
# dep:driver_remote dep:driver_libvirtd
|
||||
option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver')
|
||||
# dep:curl dep:yajl dep:driver_remote dep:driver_libvirtd
|
||||
option('driver_ch', type: 'feature', value: 'auto', description: 'Cloud-Hypervisor driver')
|
||||
option('ch_user', type: 'string', value: '', description: 'username to run Cloud-Hypervisor system instance as')
|
||||
option('ch_group', type: 'string', value: '', description: 'groupname to run Cloud-Hypervisor system instance as')
|
||||
# dep:driver_remote dep:driver_libvirtd
|
||||
option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver')
|
||||
option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver')
|
||||
# dep:yajl dep:driver_remote dep:driver_libvirtd
|
||||
option('driver_qemu', type: 'feature', value: 'auto', description: 'QEMU/KVM driver')
|
||||
option('qemu_user', type: 'string', value: '', description: 'username to run QEMU system instance as')
|
||||
option('qemu_group', type: 'string', value: '', description: 'groupname to run QEMU system instance as')
|
||||
|
@ -74,7 +87,9 @@ option('driver_vmware', type: 'feature', value: 'auto', description: 'VMware dri
|
|||
option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driver')
|
||||
|
||||
option('secdriver_apparmor', type: 'feature', value: 'auto', description: 'use AppArmor security driver')
|
||||
# dep:secdriver_apparmor
|
||||
option('apparmor_profiles', type: 'feature', value: 'auto', description: 'install apparmor profiles')
|
||||
# dep:selinux
|
||||
option('secdriver_selinux', type: 'feature', value: 'auto', description: 'use SELinux security driver')
|
||||
|
||||
|
||||
|
@ -97,16 +112,21 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend
|
|||
option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)')
|
||||
option('dtrace', type: 'feature', value: 'auto', description: 'use dtrace for static probing')
|
||||
option('firewalld', type: 'feature', value: 'auto', description: 'firewalld support')
|
||||
# dep:firewalld
|
||||
option('firewalld_zone', type: 'feature', value: 'auto', description: 'whether to install firewalld libvirt zone')
|
||||
option('host_validate', type: 'feature', value: 'auto', description: 'build virt-host-validate')
|
||||
option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install')
|
||||
option('loader_nvram', type: 'string', value: '', description: 'Pass list of pairs of <loader>:<nvram> paths. Both pairs and list items are separated by a colon.')
|
||||
option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell')
|
||||
# dep:yajl dep:driver_network dep:libvirtd
|
||||
option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses')
|
||||
# dep:numactl
|
||||
option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically')
|
||||
option('nbdkit', type: 'feature', value: 'auto', description: 'Build nbdkit storage backend')
|
||||
# dep:nbdkit
|
||||
option('nbdkit_config_default', type: 'feature', value: 'auto', description: 'Whether to use nbdkit storage backend for network disks by default (configurable)')
|
||||
option('pm_utils', type: 'feature', value: 'auto', description: 'use pm-utils for power management')
|
||||
option('sysctl_config', type: 'feature', value: 'auto', description: 'Whether to install sysctl configs')
|
||||
# dep:sysctl_config
|
||||
option('userfaultfd_sysctl', type: 'feature', value: 'auto', description: 'Whether to install sysctl config for enabling unprivileged userfaultfd')
|
||||
option('tls_priority', type: 'string', value: 'NORMAL', description: 'set the default TLS session priority string')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
subdir('rpcgen')
|
||||
|
||||
if tests_enabled[0]
|
||||
if tests_enabled[0] and xdr_dep.found()
|
||||
subdir('tests')
|
||||
|
||||
if pytest_prog.found() and host_machine.system() != 'darwin'
|
||||
|
|
|
@ -578,6 +578,8 @@ endif
|
|||
|
||||
# build libvirt shared modules
|
||||
|
||||
virt_module_deps = []
|
||||
|
||||
foreach module : virt_modules
|
||||
mod = shared_module(
|
||||
module['name'],
|
||||
|
@ -607,6 +609,7 @@ foreach module : virt_modules
|
|||
install_rpath: libvirt_rpath,
|
||||
)
|
||||
set_variable('@0@_module'.format(module['name'].underscorify()), mod)
|
||||
virt_module_deps += mod
|
||||
endforeach
|
||||
|
||||
|
||||
|
@ -1048,7 +1051,8 @@ if tests_enabled[0]
|
|||
'-I', data['builddir'],
|
||||
data['file'].full_path(),
|
||||
],
|
||||
suite: 'script'
|
||||
suite: 'script',
|
||||
depends: [data['file']]
|
||||
)
|
||||
endforeach
|
||||
endif
|
||||
|
|
|
@ -774,8 +774,6 @@ nodeDeviceGetMdevctlCommand(virNodeDeviceDef *def,
|
|||
}
|
||||
|
||||
if (nodeDeviceDefToMdevctlConfig(def, &inbuf, true) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("couldn't convert node device def to mdevctl JSON"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ static char *fchost_prefix;
|
|||
#define TEST_FC_HOST_NUM 5
|
||||
#define TEST_FC_HOST_NUM_NO_FAB 6
|
||||
|
||||
#ifdef WITH_TEST
|
||||
/* virNodeDeviceCreateXML using "<parent>" to find the vport capable HBA */
|
||||
static const char test7_xml[] =
|
||||
"<device>"
|
||||
|
@ -85,7 +86,7 @@ static const char test11_xml[] =
|
|||
" <path>/dev/disk/by-path</path>"
|
||||
" </target>"
|
||||
"</pool>";
|
||||
|
||||
#endif /* WITH_TEST */
|
||||
|
||||
/* Test virIsVHBACapable */
|
||||
static int
|
||||
|
@ -222,7 +223,7 @@ test6(const void *data G_GNUC_UNUSED)
|
|||
}
|
||||
|
||||
|
||||
|
||||
#ifdef WITH_TEST
|
||||
/* Test manageVHBAByNodeDevice
|
||||
* - Test both virNodeDeviceCreateXML and virNodeDeviceDestroy
|
||||
* - Create a node device vHBA allowing usage of various different
|
||||
|
@ -313,7 +314,7 @@ manageVHBAByStoragePool(const void *data)
|
|||
virConnectClose(conn);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int
|
||||
mymain(void)
|
||||
|
@ -334,6 +335,7 @@ mymain(void)
|
|||
ret = -1;
|
||||
if (virTestRun("virVHBAGetConfig-empty-fabric_wwn", test6, NULL) < 0)
|
||||
ret = -1;
|
||||
#ifdef WITH_TEST
|
||||
if (virTestRun("manageVHBAByNodeDevice-by-parent", manageVHBAByNodeDevice,
|
||||
test7_xml) < 0)
|
||||
ret = -1;
|
||||
|
@ -349,6 +351,7 @@ mymain(void)
|
|||
if (virTestRun("manageVHBAByStoragePool-by-parent", manageVHBAByStoragePool,
|
||||
test11_xml) < 0)
|
||||
ret = -1;
|
||||
#endif
|
||||
|
||||
VIR_FREE(fchost_prefix);
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#if defined(WITH_LIBXL) && defined(WITH_YAJL)
|
||||
#if defined(WITH_LIBXL)
|
||||
# include "virmock.h"
|
||||
# include <sys/stat.h>
|
||||
# include <unistd.h>
|
||||
|
@ -168,4 +168,4 @@ libxlDomainGetEmulatorType(const virDomainDef *def G_GNUC_UNUSED)
|
|||
return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
|
||||
}
|
||||
|
||||
#endif /* WITH_LIBXL && WITH_YAJL */
|
||||
#endif /* WITH_LIBXL */
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "testutils.h"
|
||||
|
||||
#if defined(WITH_LIBXL) && defined(WITH_YAJL)
|
||||
#if defined(WITH_LIBXL)
|
||||
|
||||
# include "internal.h"
|
||||
# include "libxl/libxl_conf.h"
|
||||
|
@ -224,4 +224,4 @@ int main(void)
|
|||
return EXIT_AM_SKIP;
|
||||
}
|
||||
|
||||
#endif /* WITH_LIBXL && WITH_YAJL */
|
||||
#endif /* WITH_LIBXL */
|
||||
|
|
|
@ -74,7 +74,6 @@ endif
|
|||
|
||||
mock_libs = [
|
||||
{ 'name': 'domaincapsmock' },
|
||||
{ 'name': 'shunload', 'sources': [ 'shunloadhelper.c' ] },
|
||||
{ 'name': 'vircgroupmock' },
|
||||
{ 'name': 'virdnsmasqmock' },
|
||||
{ 'name': 'virfilecachemock' },
|
||||
|
@ -106,6 +105,11 @@ if host_machine.system() != 'windows'
|
|||
]
|
||||
endif
|
||||
|
||||
if conf.has('WITH_TEST')
|
||||
mock_libs += [
|
||||
{ 'name': 'shunload', 'sources': [ 'shunloadhelper.c' ] },
|
||||
]
|
||||
endif
|
||||
|
||||
# build libraries used by tests
|
||||
|
||||
|
@ -258,15 +262,11 @@ tests += [
|
|||
{ 'name': 'domainconftest' },
|
||||
{ 'name': 'genericxml2xmltest' },
|
||||
{ 'name': 'interfacexml2xmltest' },
|
||||
{ 'name': 'metadatatest' },
|
||||
{ 'name': 'networkmetadatatest' },
|
||||
{ 'name': 'networkxml2xmlupdatetest' },
|
||||
{ 'name': 'nodedevxml2xmltest' },
|
||||
{ 'name': 'nwfilterxml2xmltest' },
|
||||
{ 'name': 'objecteventtest' },
|
||||
{ 'name': 'seclabeltest' },
|
||||
{ 'name': 'secretxml2xmltest' },
|
||||
{ 'name': 'shunloadtest', 'deps': [ thread_dep ] },
|
||||
{ 'name': 'sockettest' },
|
||||
{ 'name': 'storagevolxml2xmltest' },
|
||||
{ 'name': 'sysinfotest' },
|
||||
|
@ -298,7 +298,6 @@ tests += [
|
|||
{ 'name': 'virportallocatortest' },
|
||||
{ 'name': 'virrotatingfiletest' },
|
||||
{ 'name': 'virschematest' },
|
||||
{ 'name': 'virshtest', 'depends': [ virsh_prog ] },
|
||||
{ 'name': 'virstringtest' },
|
||||
{ 'name': 'virsystemdtest' },
|
||||
{ 'name': 'virtimetest' },
|
||||
|
@ -333,6 +332,17 @@ if host_machine.system() == 'linux'
|
|||
endif
|
||||
endif
|
||||
|
||||
if conf.has('WITH_TEST')
|
||||
tests += [
|
||||
{ 'name': 'fdstreamtest' },
|
||||
{ 'name': 'metadatatest' },
|
||||
{ 'name': 'networkmetadatatest' },
|
||||
{ 'name': 'objecteventtest' },
|
||||
{ 'name': 'shunloadtest', 'deps': [ thread_dep ] },
|
||||
{ 'name': 'virshtest', 'depends': [ virsh_prog ] },
|
||||
]
|
||||
endif
|
||||
|
||||
if conf.has('WITH_BHYVE')
|
||||
tests += [
|
||||
{ 'name': 'bhyveargv2xmltest', 'link_with': [ bhyve_driver_impl ] },
|
||||
|
@ -364,9 +374,8 @@ endif
|
|||
if conf.has('WITH_LIBVIRTD')
|
||||
tests += [
|
||||
{ 'name': 'eventtest', 'deps': [ thread_dep ] },
|
||||
{ 'name': 'fdstreamtest' },
|
||||
{ 'name': 'virdriverconnvalidatetest' },
|
||||
{ 'name': 'virdrivermoduletest' },
|
||||
{ 'name': 'virdrivermoduletest', 'depends': virt_module_deps },
|
||||
]
|
||||
endif
|
||||
|
||||
|
@ -393,7 +402,7 @@ if conf.has('WITH_NETWORK')
|
|||
]
|
||||
endif
|
||||
|
||||
if conf.has('WITH_NODE_DEVICES')
|
||||
if conf.has('WITH_NODE_DEVICES') and conf.has('WITH_YAJL')
|
||||
tests += [
|
||||
{ 'name': 'nodedevmdevctltest', 'link_with': [ node_device_driver_impl ] },
|
||||
]
|
||||
|
@ -499,7 +508,9 @@ if conf.has('WITH_SECDRIVER_SELINUX')
|
|||
]
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if conf.has('WITH_SELINUX')
|
||||
mock_libs += [
|
||||
{ 'name': 'securityselinuxhelper' },
|
||||
]
|
||||
|
@ -619,12 +630,14 @@ test(
|
|||
suite: 'script',
|
||||
)
|
||||
|
||||
# vsh based client self-test, which can be run directly from meson
|
||||
test('virsh self-test',
|
||||
virsh_prog,
|
||||
args: [ '-q', '-c', 'test:///default', 'self-test' ],
|
||||
suite: 'bin',
|
||||
)
|
||||
if conf.has('WITH_TEST')
|
||||
# vsh based client self-test, which can be run directly from meson
|
||||
test('virsh self-test',
|
||||
virsh_prog,
|
||||
args: [ '-q', '-c', 'test:///default', 'self-test' ],
|
||||
suite: 'bin',
|
||||
)
|
||||
endif
|
||||
|
||||
if conf.has('WITH_REMOTE')
|
||||
test('virt-admin self-test',
|
||||
|
@ -700,6 +713,12 @@ endforeach
|
|||
# list of test scripts to run
|
||||
test_scripts = []
|
||||
|
||||
if conf.has('WITH_TEST')
|
||||
test_scripts += [
|
||||
{ 'name': 'virsh-auth', 'depends': [ virsh_prog ] }
|
||||
]
|
||||
endif
|
||||
|
||||
if conf.has('WITH_LIBVIRTD')
|
||||
test('libvirtd fail with missing config',
|
||||
libvirtd_prog,
|
||||
|
@ -708,18 +727,20 @@ if conf.has('WITH_LIBVIRTD')
|
|||
suite: 'bin',
|
||||
)
|
||||
|
||||
test_scripts += [
|
||||
'virsh-auth',
|
||||
]
|
||||
|
||||
if conf.has('WITH_SECDRIVER_APPARMOR')
|
||||
test_scripts += 'virt-aa-helper-test'
|
||||
test_scripts += { 'name': 'virt-aa-helper-test' }
|
||||
endif
|
||||
endif
|
||||
|
||||
foreach name : test_scripts
|
||||
script = find_program(name)
|
||||
test(name, script, env: tests_env, suite: 'script')
|
||||
foreach data : test_scripts
|
||||
script = find_program(data['name'])
|
||||
test(data['name'],
|
||||
script,
|
||||
env: tests_env,
|
||||
depends: [
|
||||
data.get('depends', []),
|
||||
],
|
||||
suite: 'script')
|
||||
endforeach
|
||||
|
||||
testenv = runutf8
|
||||
|
|
|
@ -145,15 +145,15 @@ testPipeFeeder(void *opaque)
|
|||
g_autofree char *doc = g_new0(char, emptyspace + xmlsize + 1);
|
||||
VIR_AUTOCLOSE fd = -1;
|
||||
|
||||
if ((fd = open(pipepath, O_RDWR)) < 0) {
|
||||
if ((fd = open(pipepath, O_WRONLY)) < 0) {
|
||||
fprintf(stderr, "\nfailed to open pipe '%s': %s\n", pipepath, g_strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
memset(doc, ' ', emptyspace);
|
||||
virStrcpy(doc + emptyspace, xml, xmlsize);
|
||||
g_assert(virStrcpy(doc + emptyspace, xml, xmlsize + 1) == 0);
|
||||
|
||||
if (safewrite(fd, doc, emptyspace + xmlsize + 1) < 0) {
|
||||
if (safewrite(fd, doc, emptyspace + xmlsize) < 0) {
|
||||
fprintf(stderr, "\nfailed to write to pipe '%s': %s\n", pipepath, g_strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue