2 ##############################################################################
3 # Copyright (c) 2017 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 pip install -U /home/opnfv/bottlenecks
13 function check_testcase(){
16 SUITE_PREFIX="/home/opnfv/bottlenecks/testsuites/posca/testcase_cfg"
20 #find all the test case yaml files first
21 find $SUITE_PREFIX -name "*yaml" > /tmp/all_testcases.yaml
22 all_testcases_insuite=`cat /tmp/all_testcases.yaml | awk -F '/' '{print $NF}' | awk -F '.' '{print $1}'`
23 all_testcases=(${all_testcases_insuite})
25 if [ "${TEST_CASE}" != "" ]; then
26 testcase_exec=(${TEST_CASE// /})
27 for i in "${testcase_exec[@]}"; do
28 if [[ " ${all_testcases[*]} " != *" $i "* ]]; then
29 error "unknown test case: $i. available test cases are: ${all_test_cases[@]}"
32 info "tests to execute: ${TEST_CASE}."
34 error "lack of testcase name"
38 SUITE_PREFIX="/home/opnfv/bottlenecks/testsuites/posca/testcase_cfg"
39 source /home/opnfv/bottlenecks/common.sh
40 test_file="/home/opnfv/bottlenecks/testsuites/posca/testsuite_story/posca_factor_test"
41 if [[ -f $test_file ]]; then
42 testcases=($(cat $test_file))
44 error "no posca test suite file "
47 for i in "${testcases[@]}"; do
48 #check if the testcase is legal or not
49 check_testcase -posca $i
50 #adjust config parameters
52 file=${SUITE_PREFIX}/${i}.yaml
53 python /home/opnfv/bottlenecks/testsuites/posca/run_posca.py