Skip to content

Commit 335e26b

Browse files
authored
test: fix failure on non-VMware env (#6969)
PR #6964 added some changes for VM import test which are causing exceptions on non-VMware environments. This PR fixes those error and correctly skips unmanage and import tests for non-VMware env. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 7f760cc commit 335e26b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/integration/smoke/test_vm_lifecycle_unmanage_import.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def setUpClass(cls):
6060
assert False, "get_suitable_test_template() failed to return template with description %s" % cls.services["ostype"]
6161

6262
cls.hypervisorNotSupported = cls.hypervisor.lower() != "vmware"
63+
if cls.hypervisorNotSupported:
64+
return
6365

6466
cls.services["small"]["zoneid"] = cls.zone.id
6567
cls.services["small"]["template"] = cls.template.id
@@ -97,9 +99,14 @@ def tearDownClass(cls):
9799
def setUp(self):
98100
self.apiclient = self.testClient.getApiClient()
99101
self.dbclient = self.testClient.getDbConnection()
100-
self.services["network"]["networkoffering"] = self.network_offering.id
101102
self.cleanup = []
102103
self.created_networks = []
104+
self.virtual_machine = None
105+
self.unmanaged_instance = None
106+
self.imported_vm = None
107+
if self.hypervisorNotSupported:
108+
return
109+
self.services["network"]["networkoffering"] = self.network_offering.id
103110
network_data = self.services["l2-network"]
104111
self.network = Network.create(
105112
self.apiclient,
@@ -127,8 +134,6 @@ def setUp(self):
127134
)
128135
self.cleanup.append(self.network2)
129136
self.created_networks.append(self.network2)
130-
self.unmanaged_instance = None
131-
self.imported_vm = None
132137

133138
'''
134139
Fetch vmware datacenter login details

0 commit comments

Comments
 (0)