aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/vping
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-09-30 02:29:30 +0000
committerLinda Wang <wangwulin@huawei.com>2017-09-30 09:26:47 +0000
commit5a24cb4a7db33e693a063f5c2a66406283aa5cfb (patch)
treea4d3f5cd8b3dcc4848d0968ee5d66db1b38ab712 /functest/opnfv_tests/openstack/vping
parentf36d607e1b8f7660bbcb4c06d589d4eeb76158e3 (diff)
Fix userdata issue for vping and orchestra
1. When creating VM, the type of the param userdata should be str, to conform with that in snaps [1]. 2. Remove the infinite loop for vping in userdata 3. Fix the criteria for vping_userdata and vping_ssh [1]: https://git.opnfv.org/snaps/tree/snaps/openstack/utils/nova_utils.py#n92 Change-Id: I262a7ebb93ec90bb6f8f3acb5d564f210abcfc4b Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/vping')
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_ssh.py2
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_userdata.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py
index 5cacddb5..f94d20b2 100644
--- a/functest/opnfv_tests/openstack/vping/vping_ssh.py
+++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py
@@ -160,7 +160,7 @@ class VPingSSH(vping_base.VPingBase):
return TestCase.EX_RUN_ERROR
return self._do_vping_ssh(ssh, test_ip)
else:
- return -1
+ return TestCase.EX_RUN_ERROR
def _transfer_ping_script(self, ssh):
"""
diff --git a/functest/opnfv_tests/openstack/vping/vping_userdata.py b/functest/opnfv_tests/openstack/vping/vping_userdata.py
index 8088a4db..deaacfcc 100644
--- a/functest/opnfv_tests/openstack/vping/vping_userdata.py
+++ b/functest/opnfv_tests/openstack/vping/vping_userdata.py
@@ -88,7 +88,7 @@ class VPingUserdata(vping_base.VPingBase):
Override from super
"""
self.logger.info("Waiting for ping...")
- exit_code = -1
+ exit_code = TestCase.EX_TESTCASE_FAILED
sec = 0
tries = 0
@@ -100,7 +100,7 @@ class VPingUserdata(vping_base.VPingBase):
exit_code = TestCase.EX_OK
break
elif "failed to read iid from metadata" in p_console or tries > 5:
- exit_code = TestCase.EX_TESTCASE_FAILED
+ self.logger.info("Failed to read iid from metadata")
break
elif sec == self.ping_timeout:
self.logger.info("Timeout reached.")
@@ -137,5 +137,5 @@ def _get_userdata(test_ip):
" echo 'vPing KO'\n"
" fi\n"
" sleep 1\n"
- "done\n" % test_ip)
+ "done\n" % str(test_ip))
return None