From a4e9b4e8a4e6bdcec8ad1cda0435f8c61589576f Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 4 Feb 2015 04:10:26 -0800 Subject: [PATCH] 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 --- test/integration/component/test_ss_limits.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/integration/component/test_ss_limits.py b/test/integration/component/test_ss_limits.py index 8662cd5ff86..ec28ea2baad 100644 --- a/test/integration/component/test_ss_limits.py +++ b/test/integration/component/test_ss_limits.py @@ -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])