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@xxxxxxxxxx> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- 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 | 39 ++++++++++++++++++++++++--------------- src/qemu/meson.build | 3 +++ 7 files changed, 48 insertions(+), 15 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,21 +673,6 @@ virt_conf_files += 'libvirt.conf' install_data(virt_conf_files, install_dir: confdir) install_data(virt_aug_files, install_dir: virt_aug_dir) -foreach data : virt_test_aug_files - custom_target( - data['name'], - input: [ data['conf'], data['aug'] ], - output: data['name'], - command: [ - meson_python_prog, python3_prog.path(), augeas_gentest_prog.path(), - '@INPUT@', - ], - capture: true, - install: true, - install_dir: virt_test_aug_dir, - ) -endforeach - # augeas_test_data: # each entry is a dictionary with following items: # * name: daemon name to run the test for (required) @@ -693,6 +681,27 @@ endforeach # * builddir: path to build dir with aug files (required) augeas_test_data = [] +foreach data : virt_test_aug_files + augeas_test_file = custom_target( + data['name'], + input: [ data['conf'], data['aug'] ], + output: data['name'], + command: [ + meson_python_prog, python3_prog.path(), augeas_gentest_prog.path(), + '@INPUT@', + ], + capture: true, + 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 + 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 += { -- 2.26.2