CLOUDSTACK-5674: cls.fail does not work in setUpClass fixed it with assert.

This commit is contained in:
Girish Shilamkar 2014-02-14 14:27:13 +05:30
parent f0eb184d8a
commit f3a77c79e8
18 changed files with 22 additions and 22 deletions

View File

@ -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

View File

@ -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(

View File

@ -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,\

View File

@ -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

View File

@ -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,\

View File

@ -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

View File

@ -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(

View File

@ -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(

View File

@ -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,\

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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]