From 7a1efd687e31e26f5b687d43c320751610a0aeab Mon Sep 17 00:00:00 2001 From: Boris Date: Thu, 29 Sep 2016 18:57:58 +0300 Subject: [PATCH] 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 --- test/integration/smoke/test_network.py | 5 +++-- test/integration/smoke/test_password_server.py | 7 +++---- test/integration/smoke/test_primary_storage.py | 3 +++ test/integration/smoke/test_privategw_acl.py | 7 +++---- test/integration/smoke/test_router_dhcphosts.py | 8 +++----- .../smoke/test_routers_iptables_default_policy.py | 12 ++++++------ 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 719d78afa88..bb1e14b5d14 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -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, diff --git a/test/integration/smoke/test_password_server.py b/test/integration/smoke/test_password_server.py index 0fc7e258d58..c10478fe590 100644 --- a/test/integration/smoke/test_password_server.py +++ b/test/integration/smoke/test_password_server.py @@ -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: diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index 82212255540..b1759a50582 100644 --- a/test/integration/smoke/test_primary_storage.py +++ b/test/integration/smoke/test_primary_storage.py @@ -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 diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py index 3b9e0a70d71..4946dfa2312 100644 --- a/test/integration/smoke/test_privategw_acl.py +++ b/test/integration/smoke/test_privategw_acl.py @@ -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: diff --git a/test/integration/smoke/test_router_dhcphosts.py b/test/integration/smoke/test_router_dhcphosts.py index 4c2ec4ce57e..1681674a289 100644 --- a/test/integration/smoke/test_router_dhcphosts.py +++ b/test/integration/smoke/test_router_dhcphosts.py @@ -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: diff --git a/test/integration/smoke/test_routers_iptables_default_policy.py b/test/integration/smoke/test_routers_iptables_default_policy.py index a1bec4cac36..26072072a64 100644 --- a/test/integration/smoke/test_routers_iptables_default_policy.py +++ b/test/integration/smoke/test_routers_iptables_default_policy.py @@ -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"]]