From eb5ecb69a1be39c027ddd26d1f71b7d9961db350 Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Sat, 15 Jun 2013 03:19:33 +0000 Subject: [PATCH] Fix test_nova.sh script for quantum. Change-Id: I014f17d2be001a2447d3bd00bde3699840b9443e --- templates/test_nova.sh.erb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/test_nova.sh.erb b/templates/test_nova.sh.erb index 46da25f..f3a243b 100644 --- a/templates/test_nova.sh.erb +++ b/templates/test_nova.sh.erb @@ -29,7 +29,10 @@ login_user='ubuntu' # create a pub/priv keypair -ssh-keygen -f /tmp/id_rsa -t rsa -N '' +key_path=/tmp/id_rsa +if [ ! -f $key_path ]; then + ssh-keygen -f $key_path -t rsa -N '' +fi #add the public key to nova. nova --no-cache keypair-add --pub_key /tmp/id_rsa.pub key_cirros @@ -93,7 +96,10 @@ ssh $login_user@$floating_ip -i /tmp/id_rsa -o StrictHostKeyChecking=no hostname # get port ip_addr=`nova show $instance_name | grep 'net1 network' | awk -F'|' '{print $3}'` port_id=`quantum port-list | grep $ip_addr | awk -F' ' '{print $2}'` -quantum floatingip-create --port_id $port_id $quantum_public_net +floating_ip=`quantum floatingip-create --port_id $port_id $quantum_public_net | grep floating_ip_address | awk '{print $4}'` +quantum security-group-rule-create --protocol icmp --direction ingress default +quantum security-group-rule-create --protocol tcp --port-range-min 22 \ + --port-range-max 22 --direction ingress default sleep <%= sleep_time %> ssh $login_user@$floating_ip -i /tmp/id_rsa -o StrictHostKeyChecking=no hostname <% end %>