diff --git a/test/integration/smoke/test_password_server.py b/test/integration/smoke/test_password_server.py index a85bd5488b1..98c5ced19f1 100644 --- a/test/integration/smoke/test_password_server.py +++ b/test/integration/smoke/test_password_server.py @@ -169,6 +169,7 @@ class TestIsolatedNetworksPasswdServer(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() + self.hypervisor = self.testClient.getHypervisorInfo() return def test_ssh_command(self, vm, nat_rule, rule_label): @@ -204,20 +205,31 @@ class TestIsolatedNetworksPasswdServer(cloudstackTestCase): host.user = self.hostConfig['username'] host.passwd = self.hostConfig['password'] host.port = self.services["configurableData"]["host"]["port"] - - try: + + if self.hypervisor.lower() in ('vmware', 'hyperv'): result = get_process_status( - host.ipaddress, - host.port, - host.user, - host.passwd, + self.apiclient.connection.mgtSvr, + 22, + self.apiclient.connection.user, + self.apiclient.connection.passwd, router.linklocalip, - "cat /var/cache/cloud/passwords-%s | grep %s | sed 's/=/ /g' | awk '{print $1}'" % (vm.nic[0].gateway, vm.nic[0].ipaddress)) - except KeyError: - self.skipTest( - "Provide a marvin config file with host\ - credentials to run %s" % - self._testMethodName) + "cat /var/cache/cloud/passwords-%s | grep %s | sed 's/=/ /g' | awk '{print $1}'" % (vm.nic[0].gateway, vm.nic[0].ipaddress), + hypervisor=self.hypervisor + ) + else: + try: + result = get_process_status( + host.ipaddress, + host.port, + host.user, + host.passwd, + router.linklocalip, + "cat /var/cache/cloud/passwords-%s | grep %s | sed 's/=/ /g' | awk '{print $1}'" % (vm.nic[0].gateway, vm.nic[0].ipaddress)) + except KeyError: + self.skipTest( + "Provide a marvin config file with host\ + credentials to run %s" % + self._testMethodName) self.logger.debug("cat /var/cache/cloud/passwords-%s | grep %s | sed 's/=/ /g' | awk '{print $1}' RESULT IS ==> %s" % (vm.nic[0].gateway, vm.nic[0].ipaddress, result)) res = str(result) diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py index 4946dfa2312..9d39bdb2a6b 100644 --- a/test/integration/smoke/test_privategw_acl.py +++ b/test/integration/smoke/test_privategw_acl.py @@ -750,24 +750,43 @@ class TestPrivateGwACL(cloudstackTestCase): host.passwd = self.hostConfig['password'] host.port = self.services["configurableData"]["host"]["port"] - try: + if self.hypervisor.lower() in ('vmware', 'hyperv'): state = get_process_status( - host.ipaddress, - host.port, - host.user, - host.passwd, - router.linklocalip, - "ip addr | grep eth6 | grep state | awk '{print $9;}'") + self.apiclient.connection.mgtSvr, + 22, + self.apiclient.connection.user, + self.apiclient.connection.passwd, + router.linklocalip, + "ip addr | grep eth6 | grep state | awk '{print $9;}'", + hypervisor=self.hypervisor) mac = get_process_status( - host.ipaddress, - host.port, - host.user, - host.passwd, - router.linklocalip, - "ip addr | grep link/ether | awk '{print $2;}' | sed -n 7p") - except KeyError: - self.skipTest("Provide a marvin config file with host credentials to run %s" % self._testMethodName) + self.apiclient.connection.mgtSvr, + 22, + self.apiclient.connection.user, + self.apiclient.connection.passwd, + router.linklocalip, + "ip addr | grep link/ether | awk '{print $2;}' | sed -n 7p", + hypervisor=self.hypervisor) + else: + try: + state = get_process_status( + host.ipaddress, + host.port, + host.user, + host.passwd, + router.linklocalip, + "ip addr | grep eth6 | grep state | awk '{print $9;}'") + + mac = get_process_status( + host.ipaddress, + host.port, + host.user, + host.passwd, + router.linklocalip, + "ip addr | grep link/ether | awk '{print $2;}' | sed -n 7p") + except KeyError: + self.skipTest("Provide a marvin config file with host credentials to run %s" % self._testMethodName) state = str(state[0]) mac = str(mac[0]) diff --git a/test/integration/smoke/test_router_dhcphosts.py b/test/integration/smoke/test_router_dhcphosts.py index c90599bfc38..4e619542003 100644 --- a/test/integration/smoke/test_router_dhcphosts.py +++ b/test/integration/smoke/test_router_dhcphosts.py @@ -169,6 +169,7 @@ class TestRouterDHCPHosts(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() + self.hypervisor = self.testClient.getHypervisorInfo() self.cleanup = [] return @@ -212,20 +213,30 @@ class TestRouterDHCPHosts(cloudstackTestCase): host.user = self.hostConfig['username'] host.passwd = self.hostConfig['password'] host.port = self.services["configurableData"]["host"]["port"] - #mac1,10.7.32.101,infinite - try: + + if self.hypervisor.lower() in ('vmware', 'hyperv'): result = get_process_status( - host.ipaddress, - host.port, - host.user, - host.passwd, + self.apiclient.connection.mgtSvr, + 22, + self.apiclient.connection.user, + self.apiclient.connection.passwd, router.linklocalip, - "cat /etc/dhcphosts.txt | grep %s | sed 's/\,/ /g' | awk '{print $2}'" % (vm.nic[0].ipaddress)) - except KeyError: - self.skipTest( - "Provide a marvin config file with host\ - credentials to run %s" % - self._testMethodName) + "cat /etc/dhcphosts.txt | grep %s | sed 's/\,/ /g' | awk '{print $2}'" % (vm.nic[0].ipaddress), + hypervisor=self.hypervisor) + else: + try: + result = get_process_status( + host.ipaddress, + host.port, + host.user, + host.passwd, + router.linklocalip, + "cat /etc/dhcphosts.txt | grep %s | sed 's/\,/ /g' | awk '{print $2}'" % (vm.nic[0].ipaddress)) + except KeyError: + self.skipTest( + "Provide a marvin config file with host\ + credentials to run %s" % + self._testMethodName) self.logger.debug("cat /etc/dhcphosts.txt | grep %s | sed 's/\,/ /g' | awk '{print $2}' RESULT IS ==> %s" % (vm.nic[0].ipaddress, result)) res = str(result) diff --git a/test/integration/smoke/test_routers_iptables_default_policy.py b/test/integration/smoke/test_routers_iptables_default_policy.py index 26072072a64..ec35396017b 100644 --- a/test/integration/smoke/test_routers_iptables_default_policy.py +++ b/test/integration/smoke/test_routers_iptables_default_policy.py @@ -253,6 +253,7 @@ class TestVPCIpTablesPolicies(cloudstackTestCase): return def setUp(self): + self.hypervisor = self.testClient.getHypervisorInfo() self.logger.debug("Creating a VPC offering.") self.vpc_off = VpcOffering.create( self.apiclient, @@ -317,19 +318,30 @@ class TestVPCIpTablesPolicies(cloudstackTestCase): tables = [self.services["configurableData"]["input"], self.services["configurableData"]["forward"]] for table in tables: - try: + result = None + if self.hypervisor.lower() in ('vmware', 'hyperv'): result = get_process_status( - host.ipaddress, - host.port, - host.user, - host.passwd, + self.apiclient.connection.mgtSvr, + 22, + self.apiclient.connection.user, + self.apiclient.connection.passwd, router.linklocalip, - 'iptables -L %s' % table) - except KeyError: - self.skipTest( - "Provide a marvin config file with host\ - credentials to run %s" % - self._testMethodName) + 'iptables -L %s' % table, + hypervisor=self.hypervisor) + else: + try: + result = get_process_status( + host.ipaddress, + host.port, + host.user, + host.passwd, + router.linklocalip, + 'iptables -L %s' % table) + except KeyError: + self.skipTest( + "Provide a marvin config file with host\ + credentials to run %s" % + self._testMethodName) self.logger.debug("iptables -L %s: %s" % (table, result)) res = str(result) @@ -392,6 +404,7 @@ class TestRouterIpTablesPolicies(cloudstackTestCase): return def setUp(self): + self.hypervisor = self.testClient.getHypervisorInfo() self.cleanup = [] self.entity_manager.set_cleanup(self.cleanup) return @@ -434,19 +447,30 @@ class TestRouterIpTablesPolicies(cloudstackTestCase): tables = [self.services["configurableData"]["input"], self.services["configurableData"]["forward"]] for table in tables: - try: + result = None + if self.hypervisor.lower() in ('vmware', 'hyperv'): result = get_process_status( - host.ipaddress, - host.port, - host.user, - host.passwd, + self.apiclient.connection.mgtSvr, + 22, + self.apiclient.connection.user, + self.apiclient.connection.passwd, router.linklocalip, - 'iptables -L %s' % table) - except KeyError: - self.skipTest( - "Provide a marvin config file with host\ - credentials to run %s" % - self._testMethodName) + 'iptables -L %s' % table, + hypervisor=self.hypervisor) + else: + try: + result = get_process_status( + host.ipaddress, + host.port, + host.user, + host.passwd, + router.linklocalip, + 'iptables -L %s' % table) + except KeyError: + self.skipTest( + "Provide a marvin config file with host\ + credentials to run %s" % + self._testMethodName) self.logger.debug("iptables -L %s: %s" % (table, result)) res = str(result)