diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-31 13:01:14 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-31 13:11:41 +0200 |
commit | 5522ecd302ee54b494714cb2e1af0fe2381e5c37 (patch) | |
tree | ef5806328fa5cd7da178b97f94328949cb0d9b51 | |
parent | b66827d753e09c29cd6f541119dc0ec4c6344511 (diff) |
Add fallback mechanism if vlan
private_v4 and public_v4 are incorrectly set when vlan is used as
overlay.
JIRA: FUNCTEST-996
Change-Id: I120a247e92e0fd295769b2a0eeb15ce82a0eabc8
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-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): |