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_TEST_DIR=${REPOS_DIR}/functest/functest/opnfv_tests
41 FUNCTEST_CONF_DIR=/home/opnfv/functest/conf
43 export PYTHONUNBUFFERED=1
46 keystone_ip=$(openstack catalog show identity |grep publicURL| cut -f3 -d"/" | cut -f1 -d":")
47 neutron_ip=$(openstack catalog show network | grep publicURL | cut -f3 -d"/" | cut -f1 -d":")
51 if [ "$INSTALLER_TYPE" == "fuel" ]; then
53 elif [ "$INSTALLER_TYPE" == "apex" ]; then
54 odl_ip=$SDN_CONTROLLER_IP
57 elif [ "$INSTALLER_TYPE" == "joid" ]; then
58 odl_ip=$SDN_CONTROLLER
59 elif [ "$INSTALLER_TYPE" == "compass" ]; then
62 odl_ip=$SDN_CONTROLLER_IP
71 if [ $serial == "true" ]; then
77 ${FUNCTEST_TEST_DIR}/openstack/healthcheck/healthcheck.sh
81 [[ "$report" == "-r" ]] && args=-p
82 ${FUNCTEST_TEST_DIR}/sdn/odl/odl.py \
83 --keystoneip $keystone_ip \
84 --neutronip $neutron_ip \
86 --odlrestconfport $odl_restport \
87 --odlwebport $odl_port \
88 --ospassword ${OS_PASSWORD} \
89 --ostenantname ${OS_TENANT_NAME} \
90 --osusername ${OS_USERNAME} \
94 python ${FUNCTEST_TEST_DIR}/vnf/ims/vims.py $clean_flag $report
97 python ${FUNCTEST_TEST_DIR}/openstack/rally/run_rally-cert.py $clean_flag all $report
100 python ${FUNCTEST_TEST_DIR}/openstack/rally/run_rally-cert.py \
101 $clean_flag --sanity all $report
104 python ${FUNCTEST_TEST_DIR}/sdn/onos/teston/onos.py
107 python ${FUNCTEST_TEST_DIR}/sdn/onos/teston/onos.py -t sfc
110 python ${FUNCTEST_TEST_DIR}/features/promise.py $report
111 sleep 10 # to let the instances terminate
114 python ${FUNCTEST_TEST_DIR}/features/doctor.py $report
117 # suite under rewritting for colorado
118 # no need to run anything until refactoring done
119 # ${REPOS_DIR}/ovno/Testcases/RunTests.sh
122 echo "Sourcing Credentials ${FUNCTEST_CONF_DIR}/stackrc for undercloud .."
123 source ${FUNCTEST_CONF_DIR}/stackrc
124 python ${FUNCTEST_TEST_DIR}/security_scan/security_scan.py --config ${FUNCTEST_TEST_DIR}/security_scan/config.ini
127 python ${FUNCTEST_TEST_DIR}/features/copper.py $report
130 python ${REPOS_DIR}/moon/tests/run_tests.py $report
133 echo "The test case '${test_name}' does not exist."
137 if [[ $? != 0 ]]; then exit 1
164 echo "unknown option $1 $2"
168 shift # past argument or value
173 echo "Sourcing Credentials ${creds} to run the test.."