[tck PATCH 3/3] hooks: Use internal variable holding the state of the libvirtd service

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

 



Rather than assuming the existence of the 'service' command, use the
object variable holding the current state of the libvirtd service which
got populated right after we performed the tested action on the service.
---
 scripts/hooks/051-daemon-hook.t | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/hooks/051-daemon-hook.t b/scripts/hooks/051-daemon-hook.t
index 82cedee..b66dde0 100644
--- a/scripts/hooks/051-daemon-hook.t
+++ b/scripts/hooks/051-daemon-hook.t
@@ -85,7 +85,7 @@ SKIP: {
     ok($hook->compare_log(), "$hook->{name} is invoked correctly while $hook->{action} libvirtd");
 
     diag "check if libvirtd is stopped";
-    ok(`service libvirtd status` =~ /stopped|unused|inactive/, "libvirtd is stopped");
+    ok($hook->{libvirtd_status} =~ /stopped|unused|inactive/, "libvirtd is stopped");
 
     # start libvirtd
     $hook->action('start');
@@ -110,7 +110,7 @@ SKIP: {
     ok($hook->compare_log(), "$hook->{name} is invoked correctly while $hook->{action} libvirtd");
 
     diag "check if libvirtd is still running";
-    ok(`service libvirtd status` =~ /running/, "libvirtd is running");
+    ok($hook->{libvirtd_status} =~ /running/, "libvirtd is running");
 
     # restart libvirtd
     $hook->action('restart');
@@ -135,7 +135,7 @@ SKIP: {
     ok($hook->compare_log(), "$hook->{name} is invoked correctly while $hook->{action} libvirtd");
 
     diag "check if libvirtd is still running";
-    ok(`service libvirtd status` =~ /running/, "libvirtd is running");
+    ok($hook->{libvirtd_status} =~ /running/, "libvirtd is running");
 
     # reload libvirtd
     $hook->action('reload');
@@ -160,7 +160,7 @@ SKIP: {
     ok($hook->compare_log(), "$hook->{name} is invoked correctly while $hook->{action} libvirtd");
 
     diag "check if libvirtd is still running";
-    ok(`service libvirtd status` =~ /running/, "libvirtd is running");
+    ok($hook->{libvirtd_status} =~ /running/, "libvirtd is running");
 
     $hook->cleanup();
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[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