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 <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7a1efd68 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7a1efd68 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7a1efd68 Branch: refs/heads/4.8 Commit: 7a1efd687e31e26f5b687d43c320751610a0aeab Parents: fcdc2cc Author: Boris <[email protected]> Authored: Thu Sep 29 18:57:58 2016 +0300 Committer: Rohit Yadav <[email protected]> Committed: Wed Oct 5 15:11:00 2016 +0530 ---------------------------------------------------------------------- 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(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a1efd68/test/integration/smoke/test_network.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 719d78a..bb1e14b 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, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a1efd68/test/integration/smoke/test_password_server.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_password_server.py b/test/integration/smoke/test_password_server.py index 0fc7e25..c10478f 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: http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a1efd68/test/integration/smoke/test_primary_storage.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index 8221225..b1759a5 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 http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a1efd68/test/integration/smoke/test_privategw_acl.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py index 3b9e0a7..4946dfa 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: http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a1efd68/test/integration/smoke/test_router_dhcphosts.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_router_dhcphosts.py b/test/integration/smoke/test_router_dhcphosts.py index 4c2ec4c..1681674 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: http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a1efd68/test/integration/smoke/test_routers_iptables_default_policy.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_routers_iptables_default_policy.py b/test/integration/smoke/test_routers_iptables_default_policy.py index a1bec4c..2607207 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"]]
