mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8132: Fixed issue related to secondary storage count of template
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org> (cherry picked from commit f938a5e1c352971aa61e75a60935c735c3d3920c) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
fc502a97c2
commit
9a75a0cd22
@ -143,24 +143,28 @@ class TestSecondaryStorageLimits(cloudstackTestCase):
|
|||||||
response = self.setupAccount(value)
|
response = self.setupAccount(value)
|
||||||
self.assertEqual(response[0], PASS, response[1])
|
self.assertEqual(response[0], PASS, response[1])
|
||||||
|
|
||||||
|
apiclient = self.testClient.getUserApiClient(
|
||||||
|
UserName=self.account.name,
|
||||||
|
DomainName=self.account.domain)
|
||||||
|
|
||||||
builtin_info = get_builtin_template_info(self.apiclient, self.zone.id)
|
builtin_info = get_builtin_template_info(self.apiclient, self.zone.id)
|
||||||
self.services["template_2"]["url"] = builtin_info[0]
|
self.services["template_2"]["url"] = builtin_info[0]
|
||||||
self.services["template_2"]["hypervisor"] = builtin_info[1]
|
self.services["template_2"]["hypervisor"] = builtin_info[1]
|
||||||
self.services["template_2"]["format"] = builtin_info[2]
|
self.services["template_2"]["format"] = builtin_info[2]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
template = Template.register(self.apiclient,
|
template = Template.register(apiclient,
|
||||||
self.services["template_2"],
|
self.services["template_2"],
|
||||||
zoneid=self.zone.id,
|
zoneid=self.zone.id,
|
||||||
account=self.account.name,
|
account=self.account.name,
|
||||||
domainid=self.account.domainid,
|
domainid=self.account.domainid,
|
||||||
hypervisor=self.hypervisor)
|
hypervisor=self.hypervisor)
|
||||||
|
|
||||||
template.download(self.apiclient)
|
template.download(apiclient)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("Failed to register template: %s" % e)
|
self.fail("Failed to register template: %s" % e)
|
||||||
|
|
||||||
templates = Template.list(self.apiclient,
|
templates = Template.list(apiclient,
|
||||||
templatefilter=\
|
templatefilter=\
|
||||||
self.services["template_2"]["templatefilter"],
|
self.services["template_2"]["templatefilter"],
|
||||||
id=template.id)
|
id=template.id)
|
||||||
@ -170,19 +174,19 @@ class TestSecondaryStorageLimits(cloudstackTestCase):
|
|||||||
templateSize = (templates[0].size / (1024**3))
|
templateSize = (templates[0].size / (1024**3))
|
||||||
expectedCount = templateSize
|
expectedCount = templateSize
|
||||||
response = matchResourceCount(
|
response = matchResourceCount(
|
||||||
self.apiclient, expectedCount,
|
apiclient, expectedCount,
|
||||||
RESOURCE_SECONDARY_STORAGE,
|
RESOURCE_SECONDARY_STORAGE,
|
||||||
accountid=self.account.id)
|
accountid=self.account.id)
|
||||||
self.assertEqual(response[0], PASS, response[1])
|
self.assertEqual(response[0], PASS, response[1])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
template.delete(self.apiclient)
|
template.delete(apiclient)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("Failed to delete template: %s" % e)
|
self.fail("Failed to delete template: %s" % e)
|
||||||
|
|
||||||
expectedCount = 0
|
expectedCount = 0
|
||||||
response = matchResourceCount(
|
response = matchResourceCount(
|
||||||
self.apiclient, expectedCount,
|
apiclient, expectedCount,
|
||||||
RESOURCE_SECONDARY_STORAGE,
|
RESOURCE_SECONDARY_STORAGE,
|
||||||
accountid=self.account.id)
|
accountid=self.account.id)
|
||||||
self.assertEqual(response[0], PASS, response[1])
|
self.assertEqual(response[0], PASS, response[1])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user