CLOUDSTACK-8211: Correcting expected secondary storage count value by rounding off to floor value and including the physicalsize of snapshot

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
Gaurav Aradhye 2015-02-04 04:10:26 -08:00 committed by SrikanteswaraRao Talluri
parent c31e8e7409
commit a4e9b4e8a4
1 changed files with 6 additions and 2 deletions

View File

@ -127,7 +127,7 @@ class TestSecondaryStorageLimits(cloudstackTestCase):
except Exception as e:
return [FAIL, e]
return [PASS, None]
@data(ROOT_DOMAIN_ADMIN, CHILD_DOMAIN_ADMIN)
@attr(tags = ["advanced"], required_hardware="true")
def test_01_register_template(self, value):
@ -234,6 +234,8 @@ class TestSecondaryStorageLimits(cloudstackTestCase):
self.assertEqual(response[0], PASS, response[1])
snapshot = response[1]
snapshotSize = (snapshot.physicalsize / (1024 ** 3))
try:
template = Template.create_from_snapshot(apiclient,
snapshot=snapshot,
@ -249,7 +251,9 @@ class TestSecondaryStorageLimits(cloudstackTestCase):
"templates list validation failed")
templateSize = (templates[0].size / (1024**3))
response = matchResourceCount(self.apiclient, templateSize,
expectedSecondaryStorageCount = int(templateSize + snapshotSize)
response = matchResourceCount(self.apiclient, expectedSecondaryStorageCount,
resourceType=RESOURCE_SECONDARY_STORAGE,
accountid=self.account.id)
self.assertEqual(response[0], PASS, response[1])