mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-5674: cls.fail does not work in setUpClass fixed it with assert.
This commit is contained in:
parent
f0eb184d8a
commit
f3a77c79e8
@ -47,7 +47,7 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
|
||||
)
|
||||
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ class TestDeployVM(cloudstackTestCase):
|
||||
self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
|
||||
|
||||
if self.template == FAILED:
|
||||
self.fail("get_template() failed to return template with description %s" % self.testdata["ostype"])
|
||||
self.fail("get_template() failed to return template with description %s" % self.testdata["ostype"]
|
||||
|
||||
#create a user account
|
||||
self.account = Account.create(
|
||||
|
||||
@ -53,7 +53,7 @@ class TestDeployVmWithUserData(cloudstackTestCase):
|
||||
)
|
||||
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.debug("Successfully created account: %s, id: \
|
||||
%s" % (cls.account.name,\
|
||||
|
||||
@ -42,7 +42,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
|
||||
)
|
||||
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert false, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["template"] = cls.template.id
|
||||
|
||||
@ -48,7 +48,7 @@ class TestInternalLb(cloudstackTestCase):
|
||||
)
|
||||
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.debug("Successfully created account: %s, id: \
|
||||
%s" % (cls.account.name,\
|
||||
|
||||
@ -45,7 +45,7 @@ class TestLoadBalance(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ class TestDeployVM(cloudstackTestCase):
|
||||
self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
|
||||
|
||||
if self.template == FAILED:
|
||||
self.fail("get_template() failed to return template with description %s" % self.testdata["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % self.testdata["ostype"]
|
||||
|
||||
#create a user account
|
||||
self.account = Account.create(
|
||||
|
||||
@ -240,7 +240,7 @@ class TestPortForwarding(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
#Create an account, network, VM and IP addresses
|
||||
cls.account = Account.create(
|
||||
|
||||
@ -46,7 +46,7 @@ class TestNetworkACL(cloudstackTestCase):
|
||||
)
|
||||
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.debug("Successfully created account: %s, id: \
|
||||
%s" % (cls.account.name,\
|
||||
|
||||
@ -45,7 +45,7 @@ class TestResetVmOnReboot(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
|
||||
# Set Zones and disk offerings ??
|
||||
cls.services["small"]["zoneid"] = zone.id
|
||||
|
||||
@ -45,7 +45,7 @@ class TestScaleVm(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
# Set Zones and disk offerings ??
|
||||
cls.services["small"]["zoneid"] = zone.id
|
||||
|
||||
@ -154,7 +154,7 @@ class TestServiceOfferings(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
# Set Zones and disk offerings
|
||||
cls.services["small"]["zoneid"] = cls.zone.id
|
||||
|
||||
@ -41,7 +41,7 @@ class TestSnapshotRootDisk(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
self.assert "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["server_without_disk"]["zoneid"] = cls.zone.id
|
||||
|
||||
@ -71,7 +71,7 @@ class TestCreateTemplate(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["template"]["ostypeid"] = template.ostypeid
|
||||
cls.services["template_2"]["ostypeid"] = template.ostypeid
|
||||
@ -249,7 +249,7 @@ class TestTemplates(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls.services["volume"]["diskoffering"] = cls.disk_offering.id
|
||||
|
||||
@ -55,7 +55,7 @@ class TestDeployVM(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
# Set Zones and disk offerings
|
||||
cls.services["small"]["zoneid"] = cls.zone.id
|
||||
@ -216,7 +216,7 @@ class TestVMLifeCycle(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
# Set Zones and disk offerings
|
||||
cls.services["small"]["zoneid"] = cls.zone.id
|
||||
|
||||
@ -40,7 +40,7 @@ class TestVmSnapshot(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["server"]["zoneid"] = cls.zone.id
|
||||
|
||||
@ -61,7 +61,7 @@ class TestCreateVolume(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["zoneid"] = cls.zone.id
|
||||
@ -244,7 +244,7 @@ class TestVolumes(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.services["domainid"] = cls.domain.id
|
||||
cls.services["zoneid"] = cls.zone.id
|
||||
|
||||
@ -47,7 +47,7 @@ class TestVpcRemoteAccessVpn(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.cleanup = [cls.account]
|
||||
|
||||
@ -154,7 +154,7 @@ class TestVpcSite2SiteVpn(cloudstackTestCase):
|
||||
cls.services["ostype"]
|
||||
)
|
||||
if cls.template == FAILED:
|
||||
cls.fail("get_template() failed to return template with description %s" % cls.services["ostype"])
|
||||
assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
|
||||
|
||||
cls.cleanup = [cls.account]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user