This is an automated email from the ASF dual-hosted git repository.
bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push:
new f506a99 CLOUDSTACK-10154: fixing some smoketests failures (#2335)
f506a99 is described below
commit f506a99df53b498291d38a1cebe13fc436f09220
Author: Boris Stoyanov - a.k.a Bobby <[email protected]>
AuthorDate: Tue Nov 28 06:25:35 2017 +0200
CLOUDSTACK-10154: fixing some smoketests failures (#2335)
* CLOUDSTACK-10154: fixing some smoketests failures
* Adding wait_until pattern to test_volumes
---
test/integration/smoke/test_deploy_vm_root_resize.py | 7 +++++++
test/integration/smoke/test_host_annotations.py | 1 -
test/integration/smoke/test_ssvm.py | 8 ++++----
test/integration/smoke/test_volumes.py | 20 +++++++++++++-------
4 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py
b/test/integration/smoke/test_deploy_vm_root_resize.py
index a41d29f..4855099 100755
--- a/test/integration/smoke/test_deploy_vm_root_resize.py
+++ b/test/integration/smoke/test_deploy_vm_root_resize.py
@@ -155,6 +155,13 @@ class TestDeployVmRootSize(cloudstackTestCase):
Configurations.update(cls.api_client,
"vmware.root.disk.controller",
value=cls.defaultdiskcontroller)
+ StoragePool.update(cls.api_client, id=cls.storageID,
+ tags="")
+ cls.restartServer()
+
+ #Giving 30 seconds to management to warm-up,
+ #Experienced failures when trying to deploy a VM exactly when
management came up
+ time.sleep(30)
cleanup_resources(cls.api_client, cls._cleanup)
except Exception as e:
diff --git a/test/integration/smoke/test_host_annotations.py
b/test/integration/smoke/test_host_annotations.py
index 91c3409..9ce2586 100644
--- a/test/integration/smoke/test_host_annotations.py
+++ b/test/integration/smoke/test_host_annotations.py
@@ -175,4 +175,3 @@ class TestHostAnnotations(cloudstackTestCase):
else:
self.fail("AddAnnotation is allowed for on an unknown entityType")
- return self.added_annotations[-1]
diff --git a/test/integration/smoke/test_ssvm.py
b/test/integration/smoke/test_ssvm.py
index 48512e2..616f8b3 100644
--- a/test/integration/smoke/test_ssvm.py
+++ b/test/integration/smoke/test_ssvm.py
@@ -75,7 +75,7 @@ class TestSSVMs(cloudstackTestCase):
return
def waitForSystemVMAgent(self, vmname):
- timeout = self.services["timeout"]
+ timeout = 120
while True:
list_host_response = list_hosts(
@@ -89,7 +89,7 @@ class TestSSVMs(cloudstackTestCase):
if timeout == 0:
raise Exception("Timed out waiting for SSVM agent to be Up")
- time.sleep(self.services["sleep"])
+ time.sleep(1)
timeout = timeout - 1
@attr(
@@ -798,7 +798,7 @@ class TestSSVMs(cloudstackTestCase):
cmd.id = cpvm.id
self.apiclient.stopSystemVm(cmd)
- timeout = self.services["timeout"]
+ timeout = 120
while True:
list_cpvm_response = list_ssvms(
self.apiclient,
@@ -810,7 +810,7 @@ class TestSSVMs(cloudstackTestCase):
if timeout == 0:
raise Exception("List CPVM call failed!")
- time.sleep(self.services["sleep"])
+ time.sleep(1)
timeout = timeout - 1
cpvm_response = list_cpvm_response[0]
diff --git a/test/integration/smoke/test_volumes.py
b/test/integration/smoke/test_volumes.py
index 588b762..4e9e077 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -24,7 +24,8 @@ from marvin.cloudstackAPI import (deleteVolume,
resizeVolume)
#from marvin.sshClient import SshClient
from marvin.lib.utils import (cleanup_resources,
- format_volume_to_ext3)
+ format_volume_to_ext3,
+ wait_until)
from marvin.lib.base import (ServiceOffering,
VirtualMachine,
Account,
@@ -814,7 +815,7 @@ class TestVolumes(cloudstackTestCase):
host = Host.list(
self.apiclient,
type='Routing',
- virtualmachineid=list_vm.id
+ id=list_vm.hostid
)[0]
list_pods = get_pod(self.apiclient, self.zone.id, host.podid)
@@ -857,15 +858,20 @@ class TestVolumes(cloudstackTestCase):
self.assertEqual(root_volume.podname, list_pods.name)
def wait_for_attributes_and_return_root_vol(self):
-
- for i in range(60):
+ def checkVolumeResponse():
list_volume_response = Volume.list(
self.apiClient,
virtualmachineid=self.virtual_machine.id,
type='ROOT',
listall=True
)
- if list_volume_response[0].virtualsize is not None:
- return list_volume_response[0]
- time.sleep(1)
+ if isinstance(list_volume_response, list) and
list_volume_response[0].virtualsize is not None:
+ return True, list_volume_response[0]
+ return False, None
+
+ # sleep interval is 1s, retries is 360, this will sleep atmost 360
seconds, or 6 mins
+ res, response = wait_until(1, 360, checkVolumeResponse)
+ if not res:
+ self.fail("Failed to return root volume response")
+ return response
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].