5 VM_MANAGER_PASSWD="root"
11 function fn_parser_ipaddress(){
12 #parser and get output ipaddress
13 manager_control_private_ip=`heat output-show ${STACK_NAME} manager_control_private_ip | sed 's/\"//g'`
14 manager_control_public_ip=`heat output-show ${STACK_NAME} manager_control_public_ip | sed 's/\"//g'`
17 for ipaddr in ${manager_control_private_ip} ${manager_control_public_ip}
19 if [ "${ipaddr}x" == "x" ]
21 echo "[ERROR]The ipaddress is null ,get ip from heat output failed"
29 function fn_vstf_test_config(){
30 #get testing ipaddress
31 tester_testing_ip=`nova list | grep "vstf-tester" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
32 target_testing_ip=`nova list | grep "vstf-target" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
33 echo "tester_testing_ip = ${tester_testing_ip}"
34 echo "target_testing_ip = ${target_testing_ip}"
35 #setting testting ipaddress
36 local cmd="vstfadm settings ${tester_testing_ip} ${target_testing_ip}"
38 #run_cmd ${manager_control_public_ip} ${VM_MANAGER_USER} ${VM_MANAGER_PASSWD} "${cmd}"
39 ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
40 sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${cmd}"
45 function fn_testing_scenario(){
46 local head_cmd="vstfadm perf-test "
47 local test_length_list="64"
48 local test_scenario_list="Tu-1 Tu-3"
49 local test_tool="netperf"
51 local test_type="frameloss"
52 for scene in ${test_scenario_list}
54 local cmd="${head_cmd} ${scene} ${test_tool} ${protocol} ${test_type} \"${test_length_list}\" > /root/${scene}-result.txt"
57 ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
58 #run_cmd ${manager_control_public_ip} ${VM_MANAGER_USER} ${VM_MANAGER_PASSWD} "${head_cmd} ${scene} ${test_tool} ${protocol} ${test_type} \"${test_length_list}\" > /root/${scene}"
59 sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${cmd}"
66 local test_scenario_list="Tu-1 Tu-3"
69 for scene in ${test_scenario_list}
71 #remote_scp_cmd ${manager_control_public_ip} ${VM_MANAGER_USER} ${VM_MANAGER_PASSWD} "/root/${scene}-result.txt" "./result/${scene}" "file"
72 sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "cat /root/${scene}-result.txt"
73 sshpass -p root scp -o StrictHostKeyChecking=no root@${manager_control_public_ip}:/root/${scene}-result.txt "./result/${scene}"