2 ##############################################################################
3 # Copyright (c) 2015 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 ##############################################################################
12 VM_MANAGER_USER="root"
13 VM_MANAGER_PASSWD="root"
14 STACK_NAME="bottlenecks_vstf_stack"
16 function fn_parser_ipaddress(){
17 #parser and get output ipaddress
18 manager_control_private_ip=`heat output-show ${STACK_NAME} manager_control_private_ip | sed 's/\"//g'`
19 manager_control_public_ip=`heat output-show ${STACK_NAME} manager_control_public_ip | sed 's/\"//g'`
22 for ipaddr in ${manager_control_private_ip} ${manager_control_public_ip}
24 if [ "${ipaddr}x" == "x" ]
26 echo "[ERROR]The ipaddress is null ,get ip from heat output failed"
34 function fn_vstf_test_config(){
35 #get testing ipaddress
36 tester_testing_ip=`nova list | grep "vstf-tester" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
37 target_testing_ip=`nova list | grep "vstf-target" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
38 echo "tester_testing_ip = ${tester_testing_ip}"
39 echo "target_testing_ip = ${target_testing_ip}"
40 #setting testting ipaddress
41 local cmd="vstfadm settings ${tester_testing_ip} ${target_testing_ip}"
43 ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
44 sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${cmd}"
49 function fn_testing_scenario(){
50 local head_cmd="vstfadm perf-test "
51 local test_length_list="64 128 256 512 1024"
52 local test_scenario_list="Tu-1 Tu-3"
53 local test_tool="netperf"
55 local test_type="frameloss"
56 for scene in ${test_scenario_list}
58 local cmd="${head_cmd} ${scene} ${test_tool} ${protocol} ${test_type} \"${test_length_list}\" > /root/${scene}-result.txt"
61 ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
62 sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${cmd}"
69 local test_scenario_list="Tu-1 Tu-3"
72 for scene in ${test_scenario_list}
74 sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "cat /root/${scene}-result.txt"
75 sshpass -p root scp -o StrictHostKeyChecking=no root@${manager_control_public_ip}:/root/${scene}-result.txt "./result/${scene}"
81 python vstf_collector.py --config dashboard.json --dir result