[libvirt-php 4/6] tests: skip test if not running on host with running libvirtd

Daniel P. Berrangé berrange at redhat.com
Mon May 4 17:40:44 UTC 2020


Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 tests/test-get-models.phpt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test-get-models.phpt b/tests/test-get-models.phpt
index 60af7fa..3ed6ec5 100644
--- a/tests/test-get-models.phpt
+++ b/tests/test-get-models.phpt
@@ -1,9 +1,9 @@
 <?php
 	require_once('functions.phpt');
 
-	$conn = libvirt_connect(NULL);
+	$conn = @libvirt_connect(NULL, false);
 	if (!is_resource($conn))
-		bail('Connection to default hypervisor failed');
+		skip( basename(__FILE__) );
 
 	$soundhw = libvirt_connect_get_soundhw_models($conn, NULL, VIR_CONNECT_FLAG_SOUNDHW_GET_NAMES);
 	$nics = libvirt_connect_get_nic_models($conn);
-- 
2.26.2




More information about the libvir-list mailing list