[PATCH 33/35] tests: Reimplement 'libvirtd-fail' case directly in meson

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/meson.build     |  5 +++++
 tests/libvirtd-fail | 16 ----------------
 tests/meson.build   |  8 +++++++-
 3 files changed, 12 insertions(+), 17 deletions(-)
 delete mode 100755 tests/libvirtd-fail

diff --git a/src/meson.build b/src/meson.build
index f52d2d5994..a51f40fe16 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -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
index f9e927b61f..0000000000
--- a/tests/libvirtd-fail
+++ /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
diff --git a/tests/meson.build b/tests/meson.build
index 8ccc63b3a6..4da1b099e4 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -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',
   ]
-- 
2.44.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux