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.
This commit is contained in:
Girish Shilamkar 2014-08-04 11:01:31 +05:30
parent 98e2a0444f
commit 2231fc8920
2 changed files with 21 additions and 29 deletions

View File

@ -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)
@ -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)

View File

@ -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