4 # Author: Jose Lausuch (jose.lausuch@ericsson.com)
5 # Morgan Richomme (morgan.richomme@orange.com)
6 # Installs the Functest framework within the Docker container
7 # and run the tests automatically
10 # All rights reserved. This program and the accompanying materials
11 # are made available under the terms of the Apache License, Version 2.0
12 # which accompanies this distribution, and is available at
13 # http://www.apache.org/licenses/LICENSE-2.0
16 usage="Script to trigger the tests automatically.
19 bash $(basename "$0") [-h|--help] [-t <test_name>]
22 -h|--help show this help text
23 -r|--report push results to database (false by default)
24 -s|--serial run Tempest tests in one thread
25 -t|--test run specific test case
32 # Get the list of runnable tests
33 # Check if we are in CI mode
35 if [[ "${CI_DEBUG,,}" == "true" ]];then
39 FUNCTEST_REPO_DIR=${repos_dir}/functest/
40 FUNCTEST_CONF_DIR=/home/opnfv/functest/conf/
44 keystone_ip=$(openstack catalog show identity |grep publicURL| cut -f3 -d"/" | cut -f1 -d":")
45 # historically most of the installers use the same IP for neutron and keystone API
46 neutron_ip=$keystone_ip
47 odl_ip=$(openstack catalog show network | grep publicURL | cut -f3 -d"/" | cut -f1 -d":")
48 usr_name=$(env | grep OS | grep OS_USERNAME | cut -f2 -d'=')
49 password=$(env | grep OS | grep OS_PASSWORD | cut -f2 -d'=')
51 if [ "$INSTALLER_TYPE" == "fuel" ]; then
53 elif [ "$INSTALLER_TYPE" == "apex" ]; then
55 elif [ "$INSTALLER_TYPE" == "joid" ]; then
56 odl_ip=$(env | grep SDN_CONTROLLER | cut -f2 -d'=')
57 neutron_ip=$(openstack catalog show network | grep publicURL | cut -f3 -d"/" | cut -f1 -d":")
60 elif [ "$INSTALLER_TYPE" == "compass" ]; then
63 echo "INSTALLER_TYPE not valid." >&2
71 if [ $serial == "true" ]; then
77 ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/healthcheck.sh
80 python ${FUNCTEST_REPO_DIR}/testcases/vPing/CI/libraries/vPing_ssh.py \
84 python ${FUNCTEST_REPO_DIR}/testcases/vPing/CI/libraries/vPing_userdata.py \
89 ODL_PORT=$odl_port ODL_IP=$odl_ip KEYSTONE_IP=$keystone_ip NEUTRON_IP=$neutron_ip USR_NAME=$usr_name PASS=$password \
90 ${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI/start_tests.sh
92 # push results to the DB in case of CI
93 if [[ -n "$DEPLOY_SCENARIO" && "$DEPLOY_SCENARIO" != "none" ]]; then
94 odl_logs="/home/opnfv/functest/results/odl/logs/2"
95 odl_path="${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI"
96 node_name=$(env | grep NODE_NAME | cut -f2 -d'=')
97 python ${odl_path}/odlreport2db.py -x ${odl_logs}/output.xml -i ${INSTALLER_TYPE} -p ${node_name} -s ${DEPLOY_SCENARIO}
100 "tempest_smoke_serial")
101 python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/run_tempest.py \
102 $debug $clean_flag -s -m smoke $report
104 "tempest_full_parallel")
105 python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/run_tempest.py \
106 $debug $serial_flag $clean_flag -m full $report
109 python ${FUNCTEST_REPO_DIR}/testcases/vIMS/CI/vIMS.py \
110 $debug $clean_flag $report
113 python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py \
114 $debug $clean_flag all $report
117 python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py \
118 $debug $clean_flag --sanity all $report
121 python ${FUNCTEST_REPO_DIR}/testcases/features/bgpvpn.py
124 if [ "$INSTALLER_TYPE" == "joid" ]; then
125 python ${FUNCTEST_REPO_DIR}/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py -i joid
127 python ${FUNCTEST_REPO_DIR}/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py
131 python ${FUNCTEST_REPO_DIR}/testcases/features/promise.py $debug $report
132 sleep 10 # to let the instances terminate
135 python ${FUNCTEST_REPO_DIR}/testcases/features/doctor.py
138 ${repos_dir}/ovno/Testcases/RunTests.sh
141 echo "The test case '${test_name}' does not exist."
168 echo "unknown option $1 $2"
172 shift # past argument or value
177 echo "Sourcing Credentials ${FUNCTEST_CONF_DIR}/openstack.creds to run the test.."
178 source ${FUNCTEST_CONF_DIR}/openstack.creds