This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.15 in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit f5a44b3502d73d089e73836d009e82e9d6703b41 Merge: 6bde138 c9c1d4a Author: Rohit Yadav <rohit.ya...@shapeblue.com> AuthorDate: Fri Feb 5 18:28:02 2021 +0530 Merge remote-tracking branch 'origin/4.14' into 4.15 systemvm/debian/opt/cloud/bin/cs_dhcp.py | 5 +---- test/integration/smoke/test_service_offerings.py | 17 +++++++++++++++++ test/integration/smoke/test_vm_snapshots.py | 24 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) diff --cc test/integration/smoke/test_vm_snapshots.py index cb930ef,ce63ed4..047ed20 --- a/test/integration/smoke/test_vm_snapshots.py +++ b/test/integration/smoke/test_vm_snapshots.py @@@ -457,9 -454,33 +457,33 @@@ class TestChangeServiceOfferingForVmWit self.debug("Stopping VM - ID: %s" % virtual_machine.id) try: virtual_machine.stop(self.apiclient) + timeout = self.services["timeout"] + + while True: + time.sleep(self.services["sleep"]) + + # Ensure that VM is in stopped state + list_vm_response = list_virtual_machines( + self.apiclient, + id=virtual_machine.id + ) + + if isinstance(list_vm_response, list): + + vm = list_vm_response[0] + if vm.state == 'Stopped': + self.debug("VM state: %s" % vm.state) + break + + if timeout == 0: + raise Exception( + "Failed to stop VM (ID: %s) in change service offering" % vm.id) + + timeout = timeout - 1 + except Exception as e: self.fail("Failed to stop VM: %s" % e) - + # 4) Change service offering for VM with snapshots from Service Offering 1 to Service Offering 2 self.debug("Changing service offering from Service Offering 1 to Service Offering 2 for VM - ID: %s" % virtual_machine.id) virtual_machine.change_service_offering(self.apiclient, self.service_offering_2.id)