X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=functest%2Fopnfv_tests%2Fopenstack%2Fvping%2Fvping_ssh.py;h=a7bbfc23c9af5a917eaeb7ff2928ee0d304aa511;hb=c4db06b2254e075af242965bec70a9b4c0c0ba38;hp=a8a6fd9a6798ddcab428ef73f0110708f7b906a6;hpb=b66827d753e09c29cd6f541119dc0ec4c6344511;p=functest.git diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py index a8a6fd9a6..a7bbfc23c 100644 --- a/functest/opnfv_tests/openstack/vping/vping_ssh.py +++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py @@ -44,10 +44,14 @@ class VPingSSH(singlevm.SingleVm2): Returns: ping exit codes """ assert self.ssh + if not self.check_regex_in_console(self.vm2.name): + return 1 (_, stdout, stderr) = self.ssh.exec_command( - 'ping -c 1 ' + self.vm2.private_v4) - self.__logger.info("output:\n%s", stdout.read()) - self.__logger.info("error:\n%s", stderr.read()) + '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().decode("utf-8")) + self.__logger.info("error:\n%s", stderr.read().decode("utf-8")) return stdout.channel.recv_exit_status() def clean(self):