From 2231fc8920f258ee4062a4269ea440caa5056c29 Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Mon, 4 Aug 2014 11:01:31 +0530 Subject: [PATCH] Revert "CLOUDSTACK-6992 Test data was passed to test methods.Made code changes to get test data and pass it to test methods. Also reading portable ip config values was not proper in getPortableIpRangeServices method. So corrected it" This reverts commit dfee7b1456e9490889f93060023555d898bf5ae5. --- .../integration/component/test_portable_ip.py | 30 +++++++------------ tools/marvin/marvin/lib/common.py | 20 ++++++------- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index ce27dd82706..b9c9059d2b8 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -105,7 +105,7 @@ class Services: "privateport": 22, "publicport": 22, "protocol": "TCP", - "cidr": '0.0.0.0/0', + "cidr" : '0.0.0.0/0', }, "small": # Create a small virtual machine instance with disk offering @@ -143,14 +143,6 @@ class Services: "publicport": 22, "protocol": 'TCP', }, - "portableIpRange": - { - "gateway": "10.223.252.195", - "netmask": "255.255.255.192", - "startip": "10.223.252.196", - "endip": "10.223.252.197", - "vlan": "1001", - }, "ostype": 'CentOS 5.3 (64-bit)' } @@ -163,8 +155,8 @@ class TestCreatePortablePublicIpRanges(cloudstackTestCase): def setUpClass(cls): cls.testClient = super(TestCreatePortablePublicIpRanges, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - cls.config = cls.services # Get Zone, Domain and templates cls.region = get_region(cls.api_client) cls.domain = get_domain(cls.api_client) @@ -295,8 +287,8 @@ class TestDeletePortablePublicIpRanges(cloudstackTestCase): def setUpClass(cls): cls.testClient = super(TestDeletePortablePublicIpRanges, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - cls.config = cls.services # Get Zone, Domain and templates cls.region = get_region(cls.api_client) cls.domain = get_domain(cls.api_client) @@ -453,8 +445,8 @@ class TestListPortablePublicIpRanges(cloudstackTestCase): def setUpClass(cls): cls.testClient = super(TestListPortablePublicIpRanges, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - cls.config = cls.services # Get Zone, Domain and templates cls.region = get_region(cls.api_client) cls.domain = get_domain(cls.api_client) @@ -545,7 +537,7 @@ class TestListPortablePublicIpRanges(cloudstackTestCase): "Listed netmask not matching with the netmask of created public ip range") return - @attr(tags=["advanced", "swamy", "selfservice"]) + @attr(tags=["advanced","swamy", "selfservice"]) def test_list_portable_ip_range_non_root_admin(self): """Test list portable ip ranges with non admin root account """ @@ -579,8 +571,8 @@ class TestAssociatePublicIp(cloudstackTestCase): def setUpClass(cls): cls.testClient = super(TestAssociatePublicIp, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - cls.config = cls.services # Get Zone, Domain and templates cls.region = get_region(cls.api_client) cls.domain = get_domain(cls.api_client) @@ -895,8 +887,8 @@ class TestDisassociatePublicIp(cloudstackTestCase): def setUpClass(cls): cls.testClient = super(TestDisassociatePublicIp, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - cls.config = cls.services # Get Zone, Domain and templates cls.region = get_region(cls.api_client) cls.domain = get_domain(cls.api_client) @@ -1134,8 +1126,8 @@ class TestDeleteAccount(cloudstackTestCase): def setUpClass(cls): cls.testClient = super(TestDeleteAccount, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - cls.config = cls.services # Get Zone, Domain and templates cls.region = get_region(cls.api_client) cls.domain = get_domain(cls.api_client) @@ -1336,8 +1328,8 @@ class TestPortableIpTransferAcrossNetworks(cloudstackTestCase): def setUpClass(cls): cls.testClient = super(TestPortableIpTransferAcrossNetworks, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - cls.config = cls.services # Get Zone, Domain and templates cls.region = get_region(cls.api_client) cls.domain = get_domain(cls.api_client) @@ -1455,7 +1447,7 @@ class TestPortableIpTransferAcrossNetworks(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags=["advanced", "swamy", "selfservice"]) + @attr(tags=["advanced","swamy", "selfservice"]) def test_list_portable_ip_range_non_root_admin(self): """Test list portable ip ranges with non admin root account """ @@ -1522,7 +1514,7 @@ class TestPortableIpTransferAcrossNetworks(cloudstackTestCase): "List Public IP should return a valid static NAT info that was created on portable ip" ) self.assertTrue( - static_nat_list[0].ipaddress == portableip.ipaddress.ipaddress and static_nat_list[0].virtualmachineid == self.virtual_machine2.id, + static_nat_list[0].ipaddress == portableip.ipaddress.ipaddress and static_nat_list[0].virtualmachineid==self.virtual_machine2.id, "There is some issue in transferring portable ip {} across networks".format(portableip.ipaddress.ipaddress) ) try: diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index bc6b9c775f9..29677d3a0ca 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -1172,28 +1172,28 @@ def getPortableIpRangeServices(config): services = {} attributeError = False - if config["portableIpRange"]["startip"]: - services["startip"] = config["portableIpRange"]["startip"] + if config.portableIpRange.startip: + services["startip"] = config.portableIpRange.startip else: attributeError = True - if config["portableIpRange"]["endip"]: - services["endip"] = config["portableIpRange"]["endip"] + if config.portableIpRange.endip: + services["endip"] = config.portableIpRange.endip else: attributeError = True - if config["portableIpRange"]["netmask"]: - services["netmask"] = config["portableIpRange"]["netmask"] + if config.portableIpRange.netmask: + services["netmask"] = config.portableIpRange.netmask else: attributeError = True - if config["portableIpRange"]["gateway"]: - services["gateway"] = config["portableIpRange"]["gateway"] + if config.portableIpRange.gateway: + services["gateway"] = config.portableIpRange.gateway else: attributeError = True - if config["portableIpRange"]["vlan"]: - services["vlan"] = config["portableIpRange"]["vlan"] + if config.portableIpRange.vlan: + services["vlan"] = config.portableIpRange.vlan if attributeError: services = FAILED