summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-08-30 07:07:44 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-08-30 07:07:45 +0000
commitc1c666b957bd235fd86fbbac2fea4d541983c44d (patch)
treea367016f6d11398d09d456d65d72bc62fea1d734
parent07d5fe736339091750d7240b68644d6866b17205 (diff)
parent66334bc798c25d5769f92f2a6292daaf6220da79 (diff)
Merge "Set env vars as mandatory to push to DB"
-rwxr-xr-xci/exec_test.sh7
-rw-r--r--utils/functest_utils.py29
2 files changed, 25 insertions, 11 deletions
diff --git a/ci/exec_test.sh b/ci/exec_test.sh
index 20f7c2d4f..7c4b3578e 100755
--- a/ci/exec_test.sh
+++ b/ci/exec_test.sh
@@ -78,12 +78,7 @@ function run_test(){
;;
"odl")
odl_tests
- if [[ "$report" == "-r" &&
- -n "$DEPLOY_SCENARIO" && "$DEPLOY_SCENARIO" != "none" &&
- -n "$INSTALLER_TYPE" && "$INSTALLER_TYPE" != "none" ]] &&
- env | grep NODE_NAME > /dev/null; then
- args=-p
- fi
+ [[ "$report" == "-r" ]] && args=-p
${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/OpenDaylightTesting.py \
--keystoneip $keystone_ip --neutronip $neutron_ip \
--osusername ${OS_USERNAME} --ostenantname ${OS_TENANT_NAME} \
diff --git a/utils/functest_utils.py b/utils/functest_utils.py
index b916ab129..02e7d3d84 100644
--- a/utils/functest_utils.py
+++ b/utils/functest_utils.py
@@ -200,11 +200,30 @@ def push_results_to_db(project, case_name, logger,
"""
# Retrieve params from CI and conf
url = get_db_url(logger) + "/results"
- installer = get_installer_type(logger)
- scenario = get_scenario(logger)
- version = get_version(logger)
- pod_name = get_pod_name(logger)
- build_tag = get_build_tag(logger)
+
+ try:
+ installer = os.environ['INSTALLER_TYPE']
+ scenario = os.environ['DEPLOY_SCENARIO']
+ pod_name = os.environ['NODE_NAME']
+ build_tag = os.environ['BUILD_TAG']
+ except KeyError as e:
+ msg = "Please set env var: " + str(e)
+ if logger:
+ logger.error(msg)
+ else:
+ print(msg)
+ return False
+ rule = "daily-(.+?)-[0-9]*"
+ m = re.search(rule, build_tag)
+ if m:
+ version = m.group(1)
+ else:
+ msg = "Please fix BUILD_TAG env var: " + build_tag
+ if logger:
+ logger.error(msg)
+ else:
+ print(msg)
+ return False
test_start = dt.fromtimestamp(start_date).strftime('%Y-%m-%d %H:%M:%S')
test_stop = dt.fromtimestamp(stop_date).strftime('%Y-%m-%d %H:%M:%S')