summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocker/run_tests.sh5
-rw-r--r--testcases/config_functest.yaml15
-rw-r--r--testcases/vPing/CI/libraries/vPing.py27
3 files changed, 33 insertions, 14 deletions
diff --git a/docker/run_tests.sh b/docker/run_tests.sh
index 7e8b01206..6ae12b906 100755
--- a/docker/run_tests.sh
+++ b/docker/run_tests.sh
@@ -59,6 +59,11 @@ function run_test(){
python ${FUNCTEST_REPO_DIR}/testcases/vPing/CI/libraries/vPing2.py \
--debug ${report}
;;
+ "vping_userdata")
+ info "Running vPing test using userdata/cloudinit.... "
+ python ${FUNCTEST_REPO_DIR}/testcases/vPing/CI/libraries/vPing.py \
+ --debug ${report}
+ ;;
"odl")
info "Running ODL test..."
neutron_ip=$(keystone catalog --service identity | grep publicURL | cut -f3 -d"/" | cut -f1 -d":")
diff --git a/testcases/config_functest.yaml b/testcases/config_functest.yaml
index 6a612067b..229cb9b7d 100644
--- a/testcases/config_functest.yaml
+++ b/testcases/config_functest.yaml
@@ -158,13 +158,13 @@ results:
# and if vPing is failing is usually not needed to continue...
test_exec_priority:
1: vping
- 2: tempest
- 3: odl
- 4: onos
- 5: ovno
- #6: doctor
- 7: promise
- #8: policy-test
+ 2: vping_userdata
+ 3: tempest
+ 4: odl
+ 5: onos
+ 6: ovno
+ #7: doctor
+ 8: promise
#9: odl-vpn_service-tests
#10: opnfv-yardstick-tc026-sdnvpn
#11: openstack-neutron-bgpvpn-api-extension-tests
@@ -222,6 +222,7 @@ test-dependencies:
functest:
vims:
vping:
+ vping_userdata:
tempest:
rally:
odl:
diff --git a/testcases/vPing/CI/libraries/vPing.py b/testcases/vPing/CI/libraries/vPing.py
index b87de850d..aa3e400ca 100644
--- a/testcases/vPing/CI/libraries/vPing.py
+++ b/testcases/vPing/CI/libraries/vPing.py
@@ -428,6 +428,7 @@ def main():
logger.info("Waiting for ping...")
sec = 0
+ metadata_tries = 0
console_log = vm2.get_console_output()
duration = 0
@@ -445,31 +446,43 @@ def main():
logger.info("vPing duration:'%s'" % duration)
EXIT_CODE = 0
break
+ elif "failed to read iid from metadata" in console_log or \
+ metadata_tries > 5:
+ EXIT_CODE = -2
+ break
elif sec == PING_TIMEOUT:
logger.info("Timeout reached.")
break
- else:
- logger.debug("No vPing detected...")
+ elif sec % 10 == 0:
+ if "request failed" in console_log:
+ logger.debug("It seems userdata is not supported in nova boot."+\
+ " Waiting a bit...")
+ metadata_tries += 1
+ else:
+ logger.debug("No ping detected yet...")
sec += 1
- cleanup(nova_client, neutron_client, image_id, network_dic,
- port_id1, port_id2)
-
test_status = "NOK"
if EXIT_CODE == 0:
logger.info("vPing OK")
test_status = "OK"
+ elif EXIT_CODE == -2:
+ logger.info("Userdata is not supported in nova boot. Aborting test...")
else:
logger.error("vPing FAILED")
+ cleanup(nova_client, neutron_client, image_id, network_dic,
+ port_id1, port_id2)
+
try:
- if args.report:
+ if args.report and EXIT_CODE != -2:
+ # Don't report if userdata is not supported
logger.debug("Push result into DB")
# TODO check path result for the file
git_version = functest_utils.get_git_branch(REPO_PATH)
pod_name = functest_utils.get_pod_name(logger)
functest_utils.push_results_to_db(TEST_DB,
- "vPing",
+ "vPing_userdata",
logger, pod_name, git_version,
payload={'timestart': start_time_ts,
'duration': duration,