]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Reimplement 'libvirtd-fail' case directly in meson
authorPeter Krempa <pkrempa@redhat.com>
Fri, 22 Mar 2024 09:32:52 +0000 (10:32 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 2 Apr 2024 12:24:30 +0000 (14:24 +0200)
The test simply invokes libvirtd and expects it to fail. We can do that
directly in meson without the need for a wrapper script.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/meson.build
tests/libvirtd-fail [deleted file]
tests/meson.build

index f52d2d599487bc530f5e38713f5da27b738205ac..a51f40fe16d986a4dc2149cc48aa2b93226b7d6f 100644 (file)
@@ -654,6 +654,11 @@ foreach daemon : virt_daemons
     install_dir: sbindir,
     install_rpath: libvirt_rpath,
   )
+
+   # libvirtd_prog is needed by the test suite
+  if daemon['name'] == 'libvirtd'
+    libvirtd_prog = bin
+  endif
 endforeach
 
 
diff --git a/tests/libvirtd-fail b/tests/libvirtd-fail
deleted file mode 100755 (executable)
index f9e927b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-# Ensure that libvirt fails when given nonexistent --config=FILE
-
-. "$(dirname $0)/test-lib.sh"
-
-if test "$VERBOSE" = yes; then
-  set -x
-  $abs_top_builddir/src/libvirtd --version
-fi
-
-fail=0
-
-$abs_top_builddir/src/libvirtd --config=no-such-conf --timeout=5 2> log
-RET=$?
-
-test "$RET" != "0" && exit 0 || exit 1
index 8ccc63b3a6a049b924ad854f4cec366d0a4d3d02..4da1b099e483d1f140ed495f49f239ae72c2e013 100644 (file)
@@ -701,8 +701,14 @@ endforeach
 test_scripts = []
 
 if conf.has('WITH_LIBVIRTD')
+  test('libvirtd fail with missing config',
+    libvirtd_prog,
+    args: [ '--config=no-such-conf', '--timeout=5' ],
+    should_fail: true,
+    suite: 'bin',
+  )
+
   test_scripts += [
-    'libvirtd-fail',
     'virsh-auth',
     'virsh-uriprecedence',
   ]