--- /dev/null
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+pip install -U /home/opnfv/bottlenecks
+
+function check_testcase(){
+
+ check_suite="$1"
+ SUITE_PREFIX="/home/opnfv/bottlenecks/testsuites/posca/testcase_cfg"
+
+ TEST_CASE=$2
+
+ #find all the test case yaml files first
+ find $SUITE_PREFIX -name "*yaml" > /tmp/all_testcases.yaml
+ all_testcases_insuite=`cat /tmp/all_testcases.yaml | awk -F '/' '{print $NF}' | awk -F '.' '{print $1}'`
+ all_testcases=(${all_testcases_insuite})
+
+ if [ "${TEST_CASE}" != "" ]; then
+ testcase_exec=(${TEST_CASE// /})
+ for i in "${testcase_exec[@]}"; do
+ if [[ " ${all_testcases[*]} " != *" $i "* ]]; then
+ error "unknown test case: $i. available test cases are: ${all_test_cases[@]}"
+ fi
+ done
+ info "tests to execute: ${TEST_CASE}."
+ else
+ error "lack of testcase name"
+ fi
+}
+
+SUITE_PREFIX="/home/opnfv/bottlenecks/testsuites/posca/testcase_cfg"
+source /home/opnfv/bottlenecks/common.sh
+test_file="/home/opnfv/bottlenecks/testsuites/posca/testsuite_story/posca_factor_test"
+if [[ -f $test_file ]]; then
+ testcases=($(cat $test_file))
+else
+ error "no posca test suite file "
+fi
+
+for i in "${testcases[@]}"; do
+ #check if the testcase is legal or not
+ check_testcase -posca $i
+ #adjust config parameters
+ #run test case
+ file=${SUITE_PREFIX}/${i}.yaml
+ python /home/opnfv/bottlenecks/testsuites/posca/run_posca.py
+done
case $test_suite in
"rubbos")
- info "Running rubbos test suite"
+ info "Running rubbos test suite\n"
test_file="/home/opnfv/bottlenecks/testsuites/rubbos/testsuite_story/rubbos_story1"
if [[ -f $test_file ]]; then
testcases=($(cat $test_file))
done
;;
"posca")
+ info "Composing up dockers"
+ docker-compose -f /home/opnfv/bottlenecks/docker/bottleneck-compose/docker-compose.yml up -d
+ info "Pulling tutum/influxdb for yardstick"
+ docker pull tutum/influxdb:0.13
+ info "Copying testing scripts to docker"
+ docker cp /home/opnfv/bottlenecks/run_posca.sh bottleneckcompose_bottlenecks_1:/home/opnfv/bottlenecks
+ sleep 5
info "Running posca test suite"
- test_file="/home/opnfv/bottlenecks/testsuites/posca/testsuite_story/posca_factor_test"
- if [[ -f $test_file ]]; then
- testcases=($(cat $test_file))
- else
- error "no posca test suite file "
- fi
-
- for i in "${testcases[@]}"; do
- #check if the testcase is legal or not
- check_testcase -posca $i
- #adjust config parameters
- #run test case
- file=${BASEDIR}/testsuites/posca/testcase_cfg/${i}.yaml
- python /home/opnfv/bottlenecks/testsuites/posca/run_posca.py -c ${i}
- done
+ docker exec bottleneckcompose_bottlenecks_1 bash /home/opnfv/bottlenecks/run_posca.sh
;;
esac
}
test_config:
tool: netperf
protocol: tcp
- test_time: 60
- tx_pkt_sizes: 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072
- rx_pkt_sizes: 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072
+ test_time: 20
+ tx_pkt_sizes: 64, 256, 1024, 4096, 8192, 16384, 32768, 65536
+ rx_pkt_sizes: 64, 256, 1024, 4096, 8192, 16384, 32768, 65536
cpu_load: 0.9
latency: 100000
runner_config:
}
-def env_pre():
- Runner.Create_Incluxdb()
+def env_pre(con_dic):
+ Runner.Create_Incluxdb(con_dic['runner_config'])
def do_test(test_config, con_dic):
if con_dic["runner_config"]["yardstick_test_ip"] is None:
con_dic["runner_config"]["yardstick_test_ip"] =\
conf_parser.ip_parser("yardstick_test_ip")
+ env_pre(con_dic)
for test_x in data["tx_pkt_sizes"]:
data_max["throughput"] = 1
bandwidth_tmp = 1
if reply_data["status"] == 1:
return(reply_data["result"])
if reply_data["status"] == 0:
- if time_test == 10:
+ if time_test == 100:
LOG.info("yardstick time out")
sys.exit()
time.sleep(10)
requests.post(
base_url, headers=headers)
LOG.info("check for creating InfluxDB")
-