2 ##############################################################################
3 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 usage="Script to run the tests in bottlenecks auto.
14 bash $(basename "$0") [-h|--help] [-s <test suite>]
17 -h|--help show the help text
18 -r|--report push results to DB(true by default)
19 -s|--suite run specific test suite
20 <test suite> one of the following:
25 $(basename "$0") -s posca"
29 arr_test_suite=(rubbos vstf posca)
31 Bottlenecks_key_dir="/home/opnfv/bottlenecks/utils/infra_setup"
36 echo "Running test suite $test_suite"
40 info "After OPNFV Colorado release, Rubbos testsuite is not updating anymore.
41 This entrance for running Rubbos within Bottlenecks is no longer supported.
42 This testsuite is also not in the release plan with Bottlenecks since then.
43 If you want to run Rubbos, please refer to earlier releases.\n"
46 info "After OPNFV Colorado release, VSTF testsuite is not updating anymore.
47 This entrance for running VSTF within Bottlenecks is no longer supported.
48 This testsuite is also not in the release plan with Bottlenecks since then.
49 If you want to run VSTF, please refer to earlier releases.\n"
52 POSCA_SCRIPT=/home/opnfv/bottlenecks/testsuites/posca
53 TEST_CASE=posca_factor_system_bandwidth
54 info "Composing up dockers"
55 docker-compose -f /home/opnfv/bottlenecks/docker/bottleneck-compose/docker-compose.yml up -d
56 info "Pulling tutum/influxdb for yardstick"
57 docker pull tutum/influxdb:0.13
58 info "Copying testing scripts to docker"
59 docker cp /home/opnfv/bottlenecks/run_posca.sh bottleneckcompose_bottlenecks_1:/home/opnfv/bottlenecks
61 info "Running posca test suite with default testcase posca_stress_traffic"
62 docker exec bottleneckcompose_bottlenecks_1 python ${POSCA_SCRIPT}/run_posca.py testcase $TEST_CASE
84 echo "unkown option $1 $2"
92 source ${BASEDIR}/common.sh
94 #Add random key generation
95 if [ ! -d $Bottlenecks_key_dir/bottlenecks_key ]; then
96 mkdir $Bottlenecks_key_dir/bottlenecks_key
98 rm -rf $Bottlenecks_key_dir/bottlenecks_key
99 mkdir $Bottlenecks_key_dir/bottlenecks_key
101 chmod 700 $Bottlenecks_key_dir/bottlenecks_key
103 ssh-keygen -t rsa -f $Bottlenecks_key_dir/bottlenecks_key/bottlenecks_key -q -N ""
104 chmod 600 $Bottlenecks_key_dir/bottlenecks_key/*
106 #check the test suite name is correct
107 if [ "${SUITE}" != "" ]; then
108 suite_exec=(${SUITE//,/ })
109 for i in "${suite_exec[@]}"; do
110 if [[ " ${arr_test_suite[*]} " != *" $i "* ]]; then
111 error "unkown test suite: $i"
114 info "Tests to execute: ${SUITE}"
118 info "Sourcing Credentials openstack.creds to run the tests.."
119 source /home/opnfv/bottlenecks/config/openstack.creds
122 if [ "${SUITE}" != "" ]; then
123 for i in "${suite_exec[@]}"; do