summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh
diff options
context:
space:
mode:
Diffstat (limited to 'utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh')
-rw-r--r--utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh59
1 files changed, 47 insertions, 12 deletions
diff --git a/utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh b/utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh
index 4165e3b3..37754f98 100644
--- a/utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh
+++ b/utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh
@@ -20,22 +20,40 @@ function fn_parser_ipaddress(){
manager_control_private_ip=`heat output-show ${STACK_NAME} manager_control_private_ip | sed 's/\"//g'`
manager_control_public_ip=`heat output-show ${STACK_NAME} manager_control_public_ip | sed 's/\"//g'`
echo "manager_control_private_ip = ${manager_control_private_ip}"
- ping -c 5 ${manager_control_private_ip}
+ #ping -c 5 ${manager_control_private_ip}
echo "manager_control_public_ip = ${manager_control_public_ip}"
ping -c 5 ${manager_control_public_ip}
target_control_private_ip=`heat output-show ${STACK_NAME} target_control_private_ip | sed 's/\"//g'`
target_control_public_ip=`heat output-show ${STACK_NAME} target_control_public_ip | sed 's/\"//g'`
echo "target_control_private_ip = ${target_control_private_ip}"
- ping -c 5 ${target_control_private_ip}
+ #ping -c 5 ${target_control_private_ip}
echo "target_control_public_ip = ${target_control_public_ip}"
ping -c 5 ${target_control_public_ip}
tester_control_private_ip=`heat output-show ${STACK_NAME} tester_control_private_ip | sed 's/\"//g'`
tester_control_public_ip=`heat output-show ${STACK_NAME} tester_control_public_ip | sed 's/\"//g'`
echo "tester_control_private_ip = ${tester_control_private_ip}"
- ping -c 5 ${tester_control_private_ip}
+ #ping -c 5 ${tester_control_private_ip}
echo "tester_control_public_ip = ${tester_control_public_ip}"
ping -c 5 ${tester_control_public_ip}
+ #get testing ipaddress
+ tester_testing_ip=`nova list | grep "vstf-tester" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
+ target_testing_ip=`nova list | grep "vstf-target" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
+ echo "tester_testing_ip = ${tester_testing_ip}"
+ echo "target_testing_ip = ${target_testing_ip}"
+
+ #config ip for the testing plane
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${target_control_public_ip}
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${target_control_public_ip} "ifconfig eth1 ${target_testing_ip}/24;sleep 4"
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${tester_control_public_ip}
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${tester_control_public_ip} "ifconfig eth1 ${tester_testing_ip}/24;sleep 4"
+ #ping with each other
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${target_control_public_ip}
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${target_control_public_ip} "ping -c 10 ${tester_testing_ip}"
+
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${tester_control_public_ip}
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${tester_control_public_ip} "ping -c 10 ${target_testing_ip}"
+
local ipaddr=""
for ipaddr in ${manager_control_private_ip} ${manager_control_public_ip} ${target_control_private_ip} \
${target_control_public_ip} ${tester_control_private_ip} ${tester_control_public_ip}
@@ -72,17 +90,20 @@ function fn_generate_amqp(){
function fn_provision_agent_file(){
- apt-get -y install expect
+ #apt-get -y install expect
#manager
fn_generate_amqp "manager"
-
+
#target
fn_generate_amqp "target"
#scp_cmd ${target_control_public_ip} ${VM_TARGET_USER} ${VM_TARGET_PASSWD} "./vstf-target.ini" "/etc/vstf/amqp/amqp.ini" "file"
-
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${target_control_public_ip}
+ sshpass -p root scp -o StrictHostKeyChecking=no "./vstf-target.ini" root@${target_control_public_ip}:/etc/vstf/amqp/amqp.ini
#tester
fn_generate_amqp "tester"
#scp_cmd ${tester_control_public_ip} ${VM_TESTER_USER} ${VM_TESTER_PASSWD} "./vstf-tester.ini" "/etc/vstf/amqp/amqp.ini" "file"
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${tester_control_public_ip}
+ sshpass -p root scp -o StrictHostKeyChecking=no "./vstf-tester.ini" root@${tester_control_public_ip}:/etc/vstf/amqp/amqp.ini
return 0
}
@@ -91,14 +112,23 @@ function fn_launch_vstf_process(){
#launch manager
local manager_cmd="vstf-manager stop;pkill vstf-manager;rm -rf /opt/vstf/vstf-server.pid;vstf-manager start --monitor ${manager_control_private_ip} --port ${RABBITMQ_PORT}"
- run_cmd ${manager_control_public_ip} ${VM_MANAGER_USER} ${VM_MANAGER_PASSWD} "${manager_cmd}"
-
+ #run_cmd ${manager_control_public_ip} ${VM_MANAGER_USER} ${VM_MANAGER_PASSWD} "${manager_cmd}"
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "ifconfig -a"
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${manager_cmd}"
+
#launch target agent
local target_cmd="vstf-agent stop;pkill vstf-agent;rm -rf /tmp/esp_rpc_client.pid;vstf-agent start --config_file=/etc/vstf/amqp/amqp.ini"
- run_cmd ${target_control_public_ip} ${VM_TARGET_USER} ${VM_TARGET_PASSWD} "${target_cmd}"
-
+ #run_cmd ${target_control_public_ip} ${VM_TARGET_USER} ${VM_TARGET_PASSWD} "${target_cmd}"
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${target_control_public_ip}
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${target_control_public_ip} "ifconfig -a"
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${target_control_public_ip} "${target_cmd}"
+
#launch tester agent
- run_cmd ${tester_control_public_ip} ${VM_TESTER_USER} ${VM_TESTER_PASSWD} "${target_cmd}"
+ #run_cmd ${tester_control_public_ip} ${VM_TESTER_USER} ${VM_TESTER_PASSWD} "${target_cmd}"
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${tester_control_public_ip}
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${tester_control_public_ip} "ifconfig -a"
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${tester_control_public_ip} "${target_cmd}"
return 0
}
@@ -106,7 +136,12 @@ function fn_launch_vstf_process(){
function main(){
fn_parser_ipaddress
fn_provision_agent_file
- #fn_launch_vstf_process
+ fn_launch_vstf_process
+ cmd="rabbitmqctl list_queues"
+ sleep 20
+ #${manager_control_public_ip} ${VM_MANAGER_USER} ${VM_MANAGER_PASSWD} "${cmd}"
+ ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
+ sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${cmd}"
return 0
}