From d0c9a0a23b72409142bc66be053de264b7dad4ce Mon Sep 17 00:00:00 2001 From: "Boris Stoyanov - a.k.a Bobby" Date: Wed, 28 Nov 2018 13:07:14 +0200 Subject: [PATCH] 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. --- test/integration/smoke/test_scale_vm.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/integration/smoke/test_scale_vm.py b/test/integration/smoke/test_scale_vm.py index e4d7b4029e1..ddd6bcfbc71 100644 --- a/test/integration/smoke/test_scale_vm.py +++ b/test/integration/smoke/test_scale_vm.py @@ -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,