diff options
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/exec_test.sh | 16 | ||||
-rwxr-xr-x | ci/generate_report.py | 6 | ||||
-rwxr-xr-x | ci/run_tests.py | 16 | ||||
-rw-r--r-- | ci/testcases.yaml | 2 |
4 files changed, 21 insertions, 19 deletions
diff --git a/ci/exec_test.sh b/ci/exec_test.sh index 03eb2c87..deb505df 100755 --- a/ci/exec_test.sh +++ b/ci/exec_test.sh @@ -39,25 +39,24 @@ fi FUNCTEST_REPO_DIR=${repos_dir}/functest FUNCTEST_CONF_DIR=/home/opnfv/functest/conf +export PYTHONUNBUFFERED=1 function odl_tests(){ keystone_ip=$(openstack catalog show identity |grep publicURL| cut -f3 -d"/" | cut -f1 -d":") neutron_ip=$(openstack catalog show network | grep publicURL | cut -f3 -d"/" | cut -f1 -d":") odl_ip=${neutron_ip} - odl_port=8181 + odl_port=8080 if [ "$INSTALLER_TYPE" == "fuel" ]; then odl_port=8282 elif [ "$INSTALLER_TYPE" == "apex" ]; then odl_ip=$SDN_CONTROLLER_IP + odl_port=8181 elif [ "$INSTALLER_TYPE" == "joid" ]; then odl_ip=$SDN_CONTROLLER - odl_port=8080 - : elif [ "$INSTALLER_TYPE" == "compass" ]; then - : + odl_port=8181 else odl_ip=$SDN_CONTROLLER_IP - odl_port=8080 fi } @@ -80,12 +79,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/ci/generate_report.py b/ci/generate_report.py index 3ca2847b..d2e09eb8 100755 --- a/ci/generate_report.py +++ b/ci/generate_report.py @@ -3,6 +3,7 @@ import os import re import urllib2 import functest.utils.functest_logger as ft_logger +import functest.utils.functest_utils as ft_utils COL_1_LEN = 25 @@ -32,8 +33,7 @@ def init(tiers_to_run): def get_results_from_db(): - url = 'http://testresults.opnfv.org/test/api/v1/results?build_tag=' + \ - BUILD_TAG + url = ft_utils.get_db_url() + '/results?build_tag=' + BUILD_TAG logger.debug("Query to rest api: %s" % url) try: data = json.load(urllib2.urlopen(url)) @@ -49,7 +49,7 @@ def get_data(test, results): for test_db in results: if test['test_name'] in test_db['case_name']: id = test_db['_id'] - url = 'http://testresults.opnfv.org/test/api/v1/results/' + id + url = ft_utils.get_db_url() + '/results/' + id test_result = test_db['criteria'] return {"url": url, "result": test_result} diff --git a/ci/run_tests.py b/ci/run_tests.py index 98256721..f2a11990 100755 --- a/ci/run_tests.py +++ b/ci/run_tests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python -u # # Author: Jose Lausuch (jose.lausuch@ericsson.com) # @@ -13,8 +13,10 @@ import datetime import os import re import sys + import functest.ci.generate_report as generate_report import functest.ci.tier_builder as tb +from functest.testcases.Controllers.ODL.OpenDaylightTesting import ODLTestCases import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import functest.utils.openstack_clean as os_clean @@ -100,9 +102,15 @@ def run_test(test, tier_name): if REPORT_FLAG: flags += " -r" - cmd = ("%s%s" % (EXEC_SCRIPT, flags)) - logger.debug("Executing command '%s'" % cmd) - result = ft_utils.execute_command(cmd, exit_on_error=False) + if test_name == 'odl': + result = ODLTestCases.functest_run() + if result and REPORT_FLAG: + result = ODLTestCases.push_to_db() + result = not result + else: + cmd = ("%s%s" % (EXEC_SCRIPT, flags)) + logger.debug("Executing command '%s'" % cmd) + result = ft_utils.execute_command(cmd, exit_on_error=False) if CLEAN_FLAG: cleanup() diff --git a/ci/testcases.yaml b/ci/testcases.yaml index 7b7a7d14..69d4a2ef 100644 --- a/ci/testcases.yaml +++ b/ci/testcases.yaml @@ -17,7 +17,7 @@ tiers: dependencies: installer: '' - scenario: '' + scenario: '^((?!lxd).)*$' - name: smoke |