diff options
-rw-r--r-- | functest/opnfv_tests/openstack/vping/vping_ssh.py | 4 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/vping/vping_userdata.py | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py index a8a6fd9a6..6420013a0 100644 --- a/functest/opnfv_tests/openstack/vping/vping_ssh.py +++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py @@ -45,7 +45,9 @@ class VPingSSH(singlevm.SingleVm2): """ assert self.ssh (_, stdout, stderr) = self.ssh.exec_command( - 'ping -c 1 ' + self.vm2.private_v4) + 'ping -c 1 {}'.format( + self.vm2.private_v4 or self.vm2.addresses[ + self.network.name][0].addr)) self.__logger.info("output:\n%s", stdout.read()) self.__logger.info("error:\n%s", stderr.read()) return stdout.channel.recv_exit_status() diff --git a/functest/opnfv_tests/openstack/vping/vping_userdata.py b/functest/opnfv_tests/openstack/vping/vping_userdata.py index 421ea6a2c..f9d0bdbf0 100644 --- a/functest/opnfv_tests/openstack/vping/vping_userdata.py +++ b/functest/opnfv_tests/openstack/vping/vping_userdata.py @@ -62,7 +62,8 @@ class VPingUserdata(singlevm.VmReady2): """ Override from super """ - if not self.vm1.private_v4: + if not (self.vm1.private_v4 or self.vm1.addresses[ + self.network.name][0].addr): self.logger.error("vm1: IP addr missing") return testcase.TestCase.EX_TESTCASE_FAILED @@ -94,7 +95,8 @@ class VPingUserdata(singlevm.VmReady2): else: self.logger.debug( "Pinging %s. Waiting for response...", - self.vm1.private_v4) + self.vm1.private_v4 or self.vm1.addresses[ + self.network.name][0].addr) sec += 1 return exit_code @@ -105,7 +107,8 @@ class VPingUserdata(singlevm.VmReady2): :param test_ip: the IP value to substitute into the script :return: the bash script contents """ - if self.vm1.private_v4: + if self.vm1.private_v4 or self.vm1.addresses[ + self.network.name][0].addr: return ("#!/bin/sh\n\n" "while true; do\n" " ping -c 1 %s 2>&1 >/dev/null\n" @@ -117,7 +120,9 @@ class VPingUserdata(singlevm.VmReady2): " echo 'vPing KO'\n" " fi\n" " sleep 1\n" - "done\n" % str(self.vm1.private_v4)) + "done\n" % str( + self.vm1.private_v4 or self.vm1.addresses[ + self.network.name][0].addr)) return None def clean(self): |