CLOUDSTACK-9514: Making the credentials of the host to be picked up from the

Use config file, instead of hardcoded crendentials

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Boris 2016-09-29 18:57:58 +03:00 committed by Rohit Yadav
parent fcdc2cc529
commit 7a1efd687e
6 changed files with 21 additions and 21 deletions

View File

@ -1039,6 +1039,7 @@ class TestRouterRules(cloudstackTestCase):
cls.domain = get_domain(cls.apiclient)
cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
cls.hypervisor = testClient.getHypervisorInfo()
cls.hostConfig = cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
template = get_template(
cls.apiclient,
cls.zone.id,
@ -1117,8 +1118,8 @@ class TestRouterRules(cloudstackTestCase):
"Check for list hosts response return valid data"
)
host = hosts[0]
host.user = self.services["configurableData"]["host"]["username"]
host.passwd = self.services["configurableData"]["host"]["password"]
host.user = self.hostConfig['username']
host.passwd = self.hostConfig['password']
result = get_process_status(
host.ipaddress,

View File

@ -64,6 +64,7 @@ class TestIsolatedNetworksPasswdServer(cloudstackTestCase):
cls.testClient = super(TestIsolatedNetworksPasswdServer, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
cls.hostConfig = cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
cls.services = cls.testClient.getParsedTestDataConfig()
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client)
@ -141,8 +142,6 @@ class TestIsolatedNetworksPasswdServer(cloudstackTestCase):
cls.services["configurableData"] = {
"host": {
"password": "password",
"username": "root",
"port": 22
},
"input": "INPUT",
@ -202,8 +201,8 @@ class TestIsolatedNetworksPasswdServer(cloudstackTestCase):
"Check for list hosts response return valid data")
host = hosts[0]
host.user = self.services["configurableData"]["host"]["username"]
host.passwd = self.services["configurableData"]["host"]["password"]
host.user = self.hostConfig['username']
host.passwd = self.hostConfig['password']
host.port = self.services["configurableData"]["host"]["port"]
try:

View File

@ -157,6 +157,9 @@ class TestPrimaryStorageServices(cloudstackTestCase):
if self.hypervisor.lower() in ["kvm","hyperv", "vmware", "lxc"]:
raise self.skipTest("iscsi primary storage not supported on kvm, VMWare, Hyper-V, or LXC")
if not self.services["configurableData"]["iscsi"]["url"]:
raise self.skipTest("iscsi test storage url not setup, skipping")
# Validate the following:
# 1. List Clusters
# 2. verify that the cluster is in 'Enabled' allocation state

View File

@ -36,8 +36,6 @@ class Services:
self.services = {
"configurableData": {
"host": {
"password": "password",
"username": "root",
"port": 22
}
},
@ -172,6 +170,7 @@ class TestPrivateGwACL(cloudstackTestCase):
cls.zone.id,
cls.services["ostype"])
cls.hostConfig = cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
@ -747,8 +746,8 @@ class TestPrivateGwACL(cloudstackTestCase):
"Check for list hosts response return valid data")
host = hosts[0]
host.user = self.services["configurableData"]["host"]["username"]
host.passwd = self.services["configurableData"]["host"]["password"]
host.user = self.hostConfig['username']
host.passwd = self.hostConfig['password']
host.port = self.services["configurableData"]["host"]["port"]
try:

View File

@ -74,7 +74,7 @@ class TestRouterDHCPHosts(cloudstackTestCase):
cls.zone.id,
cls.services["ostype"]
)
cls.hostConfig = cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
@ -143,8 +143,6 @@ class TestRouterDHCPHosts(cloudstackTestCase):
cls.services["configurableData"] = {
"host": {
"password": "password",
"username": "root",
"port": 22
},
"input": "INPUT",
@ -211,8 +209,8 @@ class TestRouterDHCPHosts(cloudstackTestCase):
"Check for list hosts response return valid data")
host = hosts[0]
host.user = self.services["configurableData"]["host"]["username"]
host.passwd = self.services["configurableData"]["host"]["password"]
host.user = self.hostConfig['username']
host.passwd = self.hostConfig['password']
host.port = self.services["configurableData"]["host"]["port"]
#mac1,10.7.32.101,infinite
try:

View File

@ -54,8 +54,6 @@ class Services:
self.services = {
"configurableData": {
"host": {
"password": "password",
"username": "root",
"port": 22
},
"input": "INPUT",
@ -220,6 +218,7 @@ class TestVPCIpTablesPolicies(cloudstackTestCase):
cls.apiclient,
cls.zone.id,
cls.services["ostype"])
cls.hostConfig = cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
@ -312,8 +311,8 @@ class TestVPCIpTablesPolicies(cloudstackTestCase):
"Check for list hosts response return valid data")
host = hosts[0]
host.user = self.services["configurableData"]["host"]["username"]
host.passwd = self.services["configurableData"]["host"]["password"]
host.user = self.hostConfig['username']
host.passwd = self.hostConfig['password']
host.port = self.services["configurableData"]["host"]["port"]
tables = [self.services["configurableData"]["input"], self.services["configurableData"]["forward"]]
@ -360,6 +359,7 @@ class TestRouterIpTablesPolicies(cloudstackTestCase):
cls.zone.id,
cls.services["ostype"])
cls.hostConfig = cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
@ -428,8 +428,8 @@ class TestRouterIpTablesPolicies(cloudstackTestCase):
"Check for list hosts response return valid data")
host = hosts[0]
host.user = self.services["configurableData"]["host"]["username"]
host.passwd = self.services["configurableData"]["host"]["password"]
host.user = self.hostConfig['username']
host.passwd = self.hostConfig['password']
host.port = self.services["configurableData"]["host"]["port"]
tables = [self.services["configurableData"]["input"], self.services["configurableData"]["forward"]]