src/meson: add missing augeas tests

Most of our augeas files are generated during meson setup into build
directory and we were running augeas tests only for these files.

However, we have some other augeas and config files that are not
modified during meson setup and they are only in source directories.
In order to run tests for these files we need to provide different path
to both source and build directories.

Reported-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Pavel Hrdina 2020-08-18 15:38:34 +02:00
parent 055cac9c5f
commit e72a4a7f01
7 changed files with 42 additions and 9 deletions

View File

@ -53,6 +53,9 @@ if conf.has('WITH_BHYVE')
'name': 'test_libvirtd_bhyve.aug',
'aug': files('test_libvirtd_bhyve.aug.in'),
'conf': files('bhyve.conf'),
'test_name': 'libvirtd_bhyve',
'test_srcdir': meson.current_source_dir(),
'test_builddir': meson.current_build_dir(),
}
virt_daemon_confs += {

View File

@ -54,6 +54,9 @@ if conf.has('WITH_LIBXL')
'name': 'test_libvirtd_libxl.aug',
'aug': files('test_libvirtd_libxl.aug.in'),
'conf': files('libxl.conf'),
'test_name': 'libvirtd_libxl',
'test_srcdir': meson.current_source_dir(),
'test_builddir': meson.current_build_dir(),
}
virt_daemon_confs += {

View File

@ -186,6 +186,9 @@ if conf.has('WITH_LIBVIRTD')
'name': 'test_libvirt_lockd.aug',
'aug' : files('test_libvirt_lockd.aug.in'),
'conf': qemu_lockd_conf,
'test_name': 'libvirt_lockd',
'test_srcdir': meson.current_source_dir(),
'test_builddir': meson.current_build_dir(),
}
endif
@ -212,6 +215,9 @@ if conf.has('WITH_LIBVIRTD')
'name': 'test_libvirt_sanlock.aug',
'aug' : files('test_libvirt_sanlock.aug.in'),
'conf': qemu_sanlock_conf,
'test_name': 'libvirt_sanlock',
'test_srcdir': meson.current_source_dir(),
'test_builddir': meson.current_build_dir(),
}
endif
@ -231,6 +237,9 @@ if conf.has('WITH_LIBVIRTD')
'name': 'test_virtlockd.aug',
'aug': files('test_virtlockd.aug.in'),
'conf': files('virtlockd.conf'),
'test_name': 'virtlockd',
'test_srcdir': meson.current_source_dir(),
'test_builddir': meson.current_build_dir(),
}
virt_install_dirs += [

View File

@ -77,6 +77,9 @@ if conf.has('WITH_LIBVIRTD')
'name': 'test_virtlogd.aug',
'aug': files('test_virtlogd.aug.in'),
'conf': files('virtlogd.conf'),
'test_name': 'virtlogd',
'test_srcdir': meson.current_source_dir(),
'test_builddir': meson.current_build_dir(),
}
virt_daemon_units += {

View File

@ -154,6 +154,9 @@ if conf.has('WITH_LXC')
'name': 'test_libvirtd_lxc.aug',
'aug': files('test_libvirtd_lxc.aug.in'),
'conf': files('lxc.conf'),
'test_name': 'libvirtd_lxc',
'test_srcdir': meson.current_source_dir(),
'test_builddir': meson.current_build_dir(),
}
virt_daemon_confs += {

View File

@ -173,6 +173,9 @@ virt_aug_files = []
# * name - augeas test file name (required)
# * aug - augeas test file source (required)
# * conf - conf file (required)
# * test_name: name for the check-augeas test (required)
# * test_srcdir: path to source dir with aug files (required)
# * test_builddir: path to build dir with aug files (required)
virt_test_aug_files = []
# virt_daemon_confs:
@ -670,8 +673,16 @@ virt_conf_files += 'libvirt.conf'
install_data(virt_conf_files, install_dir: confdir)
install_data(virt_aug_files, install_dir: virt_aug_dir)
# augeas_test_data:
# each entry is a dictionary with following items:
# * name: daemon name to run the test for (required)
# * file: test file to use (required)
# * srcdir: path to source dir with aug files (required)
# * builddir: path to build dir with aug files (required)
augeas_test_data = []
foreach data : virt_test_aug_files
custom_target(
augeas_test_file = custom_target(
data['name'],
input: [ data['conf'], data['aug'] ],
output: data['name'],
@ -683,16 +694,14 @@ foreach data : virt_test_aug_files
install: true,
install_dir: virt_test_aug_dir,
)
augeas_test_data += {
'name': data['test_name'],
'file': augeas_test_file,
'srcdir': data['test_srcdir'],
'builddir': data['test_builddir'],
}
endforeach
# augeas_test_data:
# each entry is a dictionary with following items:
# * name: daemon name to run the test for (required)
# * file: test file to use (required)
# * srcdir: path to source dir with aug files (required)
# * builddir: path to build dir with aug files (required)
augeas_test_data = []
foreach data : virt_daemon_confs
capitalize_args = [ '-c', 'print("@0@".capitalize())'.format(data['name']) ]
name_uc = run_command(python3_prog, capitalize_args, check: true).stdout().strip()

View File

@ -132,6 +132,9 @@ if conf.has('WITH_QEMU')
'name': 'test_libvirtd_qemu.aug',
'aug': files('test_libvirtd_qemu.aug.in'),
'conf': files('qemu.conf'),
'test_name': 'libvirtd_qemu',
'test_srcdir': meson.current_source_dir(),
'test_builddir': meson.current_build_dir(),
}
virt_helpers += {