We shouldn't take the virsh bin for granted when running this unittest. Use a trick similar to the one used in other test and skip the test that depends on it directly.
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- virttest/virsh_unittest.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/virttest/virsh_unittest.py b/virttest/virsh_unittest.py index b2e9919..2070327 100755 --- a/virttest/virsh_unittest.py +++ b/virttest/virsh_unittest.py @@ -142,11 +142,15 @@ class ConstructorsTest(ModuleLoad): def test_VirshPersistent(self): - logging.disable(logging.INFO) - vp = self.virsh.VirshPersistent() - self.assertEqual(self.virsh.VirshPersistent.SESSION_COUNTER, 1) - vp.close_session() # Make sure session gets cleaned up - self.assertEqual(self.virsh.VirshPersistent.SESSION_COUNTER, 0) + test_virsh = self.virsh.Virsh() + if test_virsh['virsh_exec'] == '/bin/true': + return + else: + logging.disable(logging.INFO) + vp = self.virsh.VirshPersistent() + self.assertEqual(self.virsh.VirshPersistent.SESSION_COUNTER, 1) + vp.close_session() # Make sure session gets cleaned up + self.assertEqual(self.virsh.VirshPersistent.SESSION_COUNTER, 0) def TestVirshClosure(self): -- 1.8.1.4 _______________________________________________ Virt-test-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/virt-test-devel
