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
42 export PYTHONUNBUFFERED=1
45 keystone_ip=$(openstack catalog show identity |grep publicURL| cut -f3 -d"/" | cut -f1 -d":")
46 neutron_ip=$(openstack catalog show network | grep publicURL | cut -f3 -d"/" | cut -f1 -d":")
49 if [ "$INSTALLER_TYPE" == "fuel" ]; then
51 elif [ "$INSTALLER_TYPE" == "apex" ]; then
52 odl_ip=$SDN_CONTROLLER_IP
54 elif [ "$INSTALLER_TYPE" == "joid" ]; then
55 odl_ip=$SDN_CONTROLLER
56 elif [ "$INSTALLER_TYPE" == "compass" ]; then
59 odl_ip=$SDN_CONTROLLER_IP
66 if [ $serial == "true" ]; then
72 ${FUNCTEST_REPO_DIR}/testcases/OpenStack/healthcheck/healthcheck.sh
75 python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/vPing/vping.py -m ssh $report
78 python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/vPing/vping.py -m userdata $report
82 [[ "$report" == "-r" ]] && args=-p
83 ${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/OpenDaylightTesting.py \
84 --keystoneip $keystone_ip --neutronip $neutron_ip \
85 --osusername ${OS_USERNAME} --ostenantname ${OS_TENANT_NAME} \
86 --ospassword ${OS_PASSWORD} \
87 --odlip $odl_ip --odlwebport $odl_port ${args}
89 "tempest_smoke_serial")
90 python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/tempest/run_tempest.py \
91 $clean_flag -s -m smoke $report
93 "tempest_full_parallel")
94 python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/tempest/run_tempest.py \
95 $serial_flag $clean_flag -m full $report
98 python ${FUNCTEST_REPO_DIR}/testcases/vnf/vIMS/vIMS.py $clean_flag $report
101 python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/rally/run_rally-cert.py $clean_flag all $report
104 python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/rally/run_rally-cert.py \
105 $clean_flag --sanity all $report
108 sdnvpn_repo_dir=${repos_dir}/sdnvpn/test/functest/
109 python ${sdnvpn_repo_dir}/run_tests.py $report
112 python ${FUNCTEST_REPO_DIR}/testcases/Controllers/ONOS/Teston/onosfunctest.py
115 python ${FUNCTEST_REPO_DIR}/testcases/Controllers/ONOS/Teston/onosfunctest.py -t sfc
118 python ${FUNCTEST_REPO_DIR}/testcases/features/promise.py $report
119 sleep 10 # to let the instances terminate
122 python ${FUNCTEST_REPO_DIR}/testcases/features/doctor.py $report
125 # suite under rewritting for colorado
126 # no need to run anything until refactoring done
127 # ${repos_dir}/ovno/Testcases/RunTests.sh
130 echo "Sourcing Credentials ${FUNCTEST_CONF_DIR}/stackrc for undercloud .."
131 source ${FUNCTEST_CONF_DIR}/stackrc
132 python ${repos_dir}/securityscanning/security_scan.py --config ${repos_dir}/securityscanning/config.ini
135 python ${FUNCTEST_REPO_DIR}/testcases/features/copper.py $report
138 python ${repos_dir}/moon/tests/run_tests.py $report
141 python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/tempest/gen_tempest_conf.py
142 python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/tempest/run_tempest.py \
143 $clean_flag -s -m feature_multisite $report \
144 -c ${FUNCTEST_REPO_DIR}/testcases/OpenStack/tempest/tempest_multisite.conf
147 python ${FUNCTEST_REPO_DIR}/testcases/features/domino.py $report
150 bash ${FUNCTEST_REPO_DIR}/testcases/features/sfc/server_presetup_CI.bash
152 if [ $ret_val != 0 ]; then
155 bash ${FUNCTEST_REPO_DIR}/testcases/features/sfc/compute_presetup_CI.bash
157 if [ $ret_val != 0 ]; then
160 source ${FUNCTEST_REPO_DIR}/testcases/features/sfc/tackerc
161 python ${FUNCTEST_REPO_DIR}/testcases/features/sfc/sfc.py $report
164 python ${FUNCTEST_REPO_DIR}/testcases/vnf/vRNC/parser.py $report
167 echo "The test case '${test_name}' does not exist."
171 if [[ $? != 0 ]]; then exit 1
198 echo "unknown option $1 $2"
202 shift # past argument or value
207 echo "Sourcing Credentials ${FUNCTEST_CONF_DIR}/openstack.creds to run the test.."
208 source ${FUNCTEST_CONF_DIR}/openstack.creds