]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src/meson: add missing augeas tests
authorPavel Hrdina <phrdina@redhat.com>
Tue, 18 Aug 2020 13:38:34 +0000 (15:38 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 18 Aug 2020 14:35:56 +0000 (16:35 +0200)
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>
src/bhyve/meson.build
src/libxl/meson.build
src/locking/meson.build
src/logging/meson.build
src/lxc/meson.build
src/meson.build
src/qemu/meson.build

index 643e72680ed4e435f6db7b757e190667e03134a0..7d54718820d05d87e25827ff48e21a6d10fcfaa3 100644 (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 += {
index 7afde2f81f0fa0dff9643b3576346c205b54c367..3bb6cc5f2e331d41a7fc096adcdc59aa1e3d5356 100644 (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 += {
index a67a41298b1c03a28829cf0008b48fe7e381351b..8a28310e4075b4ed9896e2766270a70c63d8e014 100644 (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 += [
index 1f06a51e935647f34ddfddd7ddc8d707d3ba14d5..996d4265fcea8a41f602d8f83ff34bc9d856a568 100644 (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 += {
index 11526b637b2ce4d383ac7821da0091cccbdbbc1e..2810da760467fbc1a4cf24c9080cfaced563ddb2 100644 (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 += {
index 96ec3e26757d216f01ceb484bc13524e9e73b943..73ac99f01e04207221a17b43901a2b7ffaca0d1d 100644 (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()
index 7faba16049c0b6930afe7627230546c29bc77743..72c1a8c665839d871873a10de1970f987fbd4146 100644 (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 += {