borisstoyanov commented on a change in pull request #3425: [WIP DO NOT MERGE]
Better tracking host maintanence success and failure
URL: https://github.com/apache/cloudstack/pull/3425#discussion_r339482865
##########
File path: test/integration/smoke/test_host_maintenance.py
##########
@@ -254,25 +301,101 @@ def
test_02_cancel_host_maintenace_with_migration_jobs(self):
self.logger.debug("Creating vms = {}".format(no_vm_req))
self.vmlist = self.createVMs(listHost[0].id, no_vm_req)
- vm_migrating=False
+ migrations_finished = True
try:
-
- vm_migrating = self.hostPrepareAndCancelMaintenance(listHost[0].id,
listHost[1].id, self.checkVmMigratingOnHost)
-
- vm_migrating = self.hostPrepareAndCancelMaintenance(listHost[1].id,
listHost[0].id, self.checkVmMigratingOnHost)
+ migrations_finished =
self.hostPrepareAndCancelMaintenance(listHost[0].id, listHost[1].id)
+
+ if migrations_finished:
+ migrations_finished =
self.hostPrepareAndCancelMaintenance(listHost[1].id, listHost[0].id)
except Exception as e:
self.logger.debug("Exception {}".format(e))
self.fail("Cancel host maintenance failed {}".format(e[0]))
-
- if (vm_migrating == False):
- raise unittest.SkipTest("No VM is migrating and the test will not
be able to check the conditions the test is intended for");
-
-
+
+ if (migrations_finished == False):
+ raise unittest.SkipTest("VMs are still migrating and the test will
not be able to check the conditions the test is intended for");
+
+ return
+
+ @attr(
+ tags=[
+ "advanced",
+ "advancedns",
+ "smoke",
+ "basic",
+ "eip",
+ "sg"],
+ required_hardware="true")
+ def test_03_cancel_host_maintenace_with_migration_jobs_ports_blocked(self):
+
+ listHost = Host.list(
+ self.apiclient,
+ type='Routing',
+ zoneid=self.zone.id,
+ podid=self.pod.id,
+ )
+ for host in listHost:
+ self.logger.debug('2 Hypervisor = {}'.format(host.id))
+
+ if (len(listHost) != 2):
+ raise unittest.SkipTest("Cancel host maintenance when VMs are
migrating can only be tested with 2 hosts");
Review comment:
why so? what's wrong with having more than 2 hosts?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services