summaryrefslogtreecommitdiffstats
path: root/docker/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/run_tests.sh')
-rwxr-xr-xdocker/run_tests.sh26
1 files changed, 17 insertions, 9 deletions
diff --git a/docker/run_tests.sh b/docker/run_tests.sh
index bae75e961..48e3741f8 100755
--- a/docker/run_tests.sh
+++ b/docker/run_tests.sh
@@ -21,6 +21,7 @@ usage:
where:
-h|--help show this help text
-r|--report push results to database (false by default)
+ -n|--no-clean do not clean OpenStack resources after test run
-t|--test run specific set of tests
<test_name> one or more of the following: vping,odl,rally,tempest,vims,onos,promise,ovno. Separated by comma.
@@ -35,15 +36,18 @@ examples:
# NOTE: Still not 100% working when running the tests
offline=false
report=""
+clean=true
# Get the list of runnable tests
# Check if we are in CI mode
function clean_openstack(){
- echo -e "\n\nCleaning Openstack environment..."
- python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py \
- --debug
- echo -e "\n\n"
+ if [ $clean == true ]; then
+ echo -e "\n\nCleaning Openstack environment..."
+ python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py \
+ --debug
+ echo -e "\n\n"
+ fi
}
function run_test(){
@@ -86,10 +90,12 @@ function run_test(){
ODL_PORT=$odl_port ODL_IP=$odl_ip NEUTRON_IP=$neutron_ip USR_NAME=$usr_name PASS=$password \
${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI/start_tests.sh
- # save ODL results
- odl_logs="${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI/logs"
- if [ -d ${odl_logs} ]; then
- cp -Rf ${odl_logs} ${FUNCTEST_CONF_DIR}/ODL/
+ # push results to the DB in case of CI
+ if [[ -n "$DEPLOY_SCENARIO" && "$DEPLOY_SCENARIO" != "none" ]]; then
+ odl_logs="/home/opnfv/functest/results/odl/logs/2"
+ odl_path="${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI"
+ node_name=$(env | grep NODE_NAME | cut -f2 -d'=')
+ python ${odl_path}/odlreport2db.py -x ${odl_logs}/output.xml -i ${INSTALLER_TYPE} -p ${node_name} -s ${DEPLOY_SCENARIO}
fi
;;
"tempest")
@@ -168,6 +174,9 @@ while [[ $# > 0 ]]
-r|--report)
report="-r"
;;
+ -n|--no-clean)
+ clean=false
+ ;;
-t|--test|--tests)
TEST="$2"
shift
@@ -184,7 +193,6 @@ done
tests_file="/home/opnfv/functest/conf/testcase-list.txt"
if [[ -n "$DEPLOY_SCENARIO" && "$DEPLOY_SCENARIO" != "none" ]] &&\
[[ -f $tests_file ]]; then
- echo "testcase-list.txt content:";cat $test_file; echo ""
arr_test=($(cat $tests_file))
else
arr_test=(vping tempest vims rally)