From e72a4a7f011502917d4f1c11d90109e05e55c842 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Tue, 18 Aug 2020 15:38:34 +0200 Subject: [PATCH] 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 Signed-off-by: Pavel Hrdina Reviewed-by: Michal Privoznik --- src/bhyve/meson.build | 3 +++ src/libxl/meson.build | 3 +++ src/locking/meson.build | 9 +++++++++ src/logging/meson.build | 3 +++ src/lxc/meson.build | 3 +++ src/meson.build | 27 ++++++++++++++++++--------- src/qemu/meson.build | 3 +++ 7 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 643e72680e..7d54718820 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -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 += { diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 7afde2f81f..3bb6cc5f2e 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -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 += { diff --git a/src/locking/meson.build b/src/locking/meson.build index a67a41298b..8a28310e40 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -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 += [ diff --git a/src/logging/meson.build b/src/logging/meson.build index 1f06a51e93..996d4265fc 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -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 += { diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 11526b637b..2810da7604 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -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 += { diff --git a/src/meson.build b/src/meson.build index 96ec3e2675..73ac99f01e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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() diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 7faba16049..72c1a8c665 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -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 += {