mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Smoke tests: Xenserver - Fix consistent failure noticed on scale VM test (#10741)
* Smoke tests: Xenserver - Fix consistent failure noticed on scale VM test * update test
This commit is contained in:
parent
603cd84b49
commit
1adfaf90ad
@ -664,10 +664,48 @@ class TestScaleVm(cloudstackTestCase):
|
||||
# update setting allow.diskOffering.change.during.scale.vm to true
|
||||
# scale up the VM to serviceoffering3
|
||||
# Check disk offering of root volume to be diskoffering3 since setting allow.diskOffering.change.during.scale.vm is true
|
||||
template = self.template
|
||||
if self.hypervisor.lower() in ['xenserver']:
|
||||
test_template = get_test_template(self.apiclient, self.zone.id, self.hypervisor)
|
||||
self.services["template_2"]["url"] = test_template["url"]
|
||||
self.services["template_2"]["hypervisor"] = test_template["hypervisor"]
|
||||
self.services["template_2"]["format"] = test_template["format"]
|
||||
self.services["template_2"]["ostype"] = "CentOS 5.6 (64-bit)"
|
||||
|
||||
try:
|
||||
template = Template.register(self.apiclient,
|
||||
self.services["template_2"],
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
hypervisor=self.hypervisor
|
||||
)
|
||||
|
||||
template.download(self.apiclient)
|
||||
except Exception as e:
|
||||
self.fail("Failed to register template: %s" % e)
|
||||
|
||||
time.sleep(120)
|
||||
|
||||
template = Template.update(
|
||||
template,
|
||||
self.apiclient,
|
||||
isdynamicallyscalable='true'
|
||||
)
|
||||
|
||||
templates = Template.list(self.apiclient,
|
||||
templatefilter= \
|
||||
self.services["template_2"]["templatefilter"],
|
||||
id=template.id,
|
||||
)
|
||||
|
||||
template = templates[0]
|
||||
|
||||
disk_offering = self.services["disk_offering"]
|
||||
disk_offering["name"] = "Disk Offering 1"
|
||||
self.disk_offering1 = DiskOffering.create(
|
||||
self.apiclient,
|
||||
self.services["disk_offering"],
|
||||
disk_offering,
|
||||
)
|
||||
self._cleanup.append(self.disk_offering1)
|
||||
offering_data = {
|
||||
@ -689,6 +727,7 @@ class TestScaleVm(cloudstackTestCase):
|
||||
self.virtual_machine_test = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["small"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.ServiceOffering1WithDiskOffering1.id,
|
||||
@ -728,9 +767,11 @@ class TestScaleVm(cloudstackTestCase):
|
||||
self.apiclient,
|
||||
isdynamicallyscalable='true')
|
||||
|
||||
disk_offering2 = self.services["disk_offering"]
|
||||
disk_offering2["name"] = "Disk Offering 2"
|
||||
self.disk_offering2 = DiskOffering.create(
|
||||
self.apiclient,
|
||||
self.services["disk_offering"],
|
||||
disk_offering2
|
||||
)
|
||||
self._cleanup.append(self.disk_offering2)
|
||||
offering_data = {
|
||||
@ -809,6 +850,7 @@ class TestScaleVm(cloudstackTestCase):
|
||||
self.debug("Simulator doesn't support changing disk offering, volume resize")
|
||||
return
|
||||
disk_offering_data = self.services["disk_offering"]
|
||||
disk_offering_data["name"] = "Disk Offering 3"
|
||||
if self.hypervisor.lower() in ['xenserver']:
|
||||
self.debug("For hypervisor %s, do not resize volume and just change try to change the disk offering")
|
||||
volume_response = Volume.list(
|
||||
@ -846,6 +888,8 @@ class TestScaleVm(cloudstackTestCase):
|
||||
value="true"
|
||||
)
|
||||
|
||||
time.sleep(30)
|
||||
|
||||
self.debug("Scaling VM-ID: %s to service offering: %s and state %s" % (
|
||||
self.virtual_machine_test.id,
|
||||
self.ServiceOffering3WithDiskOffering3.id,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user