CLOUDSTACK-7769 - Fixed test_ssvm.py script

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b10f0a79
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b10f0a79
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b10f0a79

Branch: refs/heads/hotfix/CLOUDSTACK-7776
Commit: b10f0a7990b916aebf73291e3807cb7eff5fc5ca
Parents: 97aa02c
Author: Chandan Purushothama <chandan.purushoth...@citrix.com>
Authored: Wed Oct 22 12:09:52 2014 -0700
Committer: Sangeetha Hariharan <sangeetha.hariha...@citrix.com>
Committed: Wed Oct 22 15:55:37 2014 -0700

----------------------------------------------------------------------
 test/integration/smoke/test_ssvm.py | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b10f0a79/test/integration/smoke/test_ssvm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_ssvm.py 
b/test/integration/smoke/test_ssvm.py
index 5713569..ed9eab0 100644
--- a/test/integration/smoke/test_ssvm.py
+++ b/test/integration/smoke/test_ssvm.py
@@ -157,8 +157,16 @@ class TestSSVMs(cloudstackTestCase):
                             "Check list response returns a valid list"
                         )
             iprange = ipranges_response[0]
-
-            self.assertEqual(
+            
+            #Fetch corresponding Physical Network of SSVM's Zone
+            listphyntwk = PhysicalNetwork.list(
+                            self.apiclient,
+                            zoneid=ssvm.zoneid
+                            )
+            
+            # Execute the following assertion in all zones except EIP-ELB Zones
+            if not (self.zone.networktype.lower() == 'basic' and 
isinstance(NetScaler.list(self.apiclient,physicalnetworkid=listphyntwk[0].id), 
list) is True):
+                self.assertEqual(
                             ssvm.gateway,
                             iprange.gateway,
                             "Check gateway with that of corresponding ip range"
@@ -274,7 +282,15 @@ class TestSSVMs(cloudstackTestCase):
                         )
             iprange = ipranges_response[0]
 
-            self.assertEqual(
+            #Fetch corresponding Physical Network of SSVM's Zone
+            listphyntwk = PhysicalNetwork.list(
+                            self.apiclient,
+                            zoneid=cpvm.zoneid
+                            )
+            
+            # Execute the following assertion in all zones except EIP-ELB Zones
+            if not (self.zone.networktype.lower() == 'basic' and 
isinstance(NetScaler.list(self.apiclient,physicalnetworkid=listphyntwk[0].id), 
list) is True):
+                self.assertEqual(
                             cpvm.gateway,
                             iprange.gateway,
                             "Check gateway with that of corresponding ip range"

Reply via email to