Fix unit tests for libvirt 2.5+
In libvirt v2.5+, domain.destroy() raises an error in unit tests: "Requested operation is not valid: domain is not running" - check if the domain is active in the unit tests. Change-Id: I92420699738ea3e5ece4e9137ac797fbcbc015ea Related-bug:#1641568
This commit is contained in:
parent
8b65d9184f
commit
aa4679ce01
|
@ -123,7 +123,8 @@ class LibvirtTestCase(TestCase):
|
|||
for domain in conn.listAllDomains():
|
||||
for snapshot in domain.listAllSnapshots(0):
|
||||
snapshot.delete()
|
||||
domain.destroy()
|
||||
if domain.isActive():
|
||||
domain.destroy()
|
||||
domain.undefine()
|
||||
for network in conn.listAllNetworks():
|
||||
network.destroy()
|
||||
|
|
Loading…
Reference in New Issue