tests: Adding a try catch for Xen licensing issue (#3061)

Adds a skip if the exception is related to licensing of the particular host, for the scaleVM API test.
This commit is contained in:
Boris Stoyanov - a.k.a Bobby 2018-11-28 13:07:14 +02:00 committed by Rohit Yadav
parent 82cdf1c163
commit d0c9a0a23b
1 changed files with 8 additions and 1 deletions

View File

@ -159,7 +159,14 @@ class TestScaleVm(cloudstackTestCase):
cmd = scaleVirtualMachine.scaleVirtualMachineCmd()
cmd.serviceofferingid = self.big_offering.id
cmd.id = self.virtual_machine.id
self.apiclient.scaleVirtualMachine(cmd)
try:
self.apiclient.scaleVirtualMachine(cmd)
except Exception as e:
if "LicenceRestriction" in str(e):
self.skipTest("Your XenServer License does not allow scaling")
else:
self.fail("Scaling failed with the following exception: " + str(e))
list_vm_response = VirtualMachine.list(
self.apiclient,