Fix test_nova.sh script for quantum.

Change-Id: I014f17d2be001a2447d3bd00bde3699840b9443e
This commit is contained in:
Maru Newby
2013-06-15 03:19:33 +00:00
parent a094921a30
commit eb5ecb69a1

View File

@@ -29,7 +29,10 @@ login_user='ubuntu'
# create a pub/priv keypair # 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. #add the public key to nova.
nova --no-cache keypair-add --pub_key /tmp/id_rsa.pub key_cirros 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 # get port
ip_addr=`nova show $instance_name | grep 'net1 network' | awk -F'|' '{print $3}'` 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}'` 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 %> sleep <%= sleep_time %>
ssh $login_user@$floating_ip -i /tmp/id_rsa -o StrictHostKeyChecking=no hostname ssh $login_user@$floating_ip -i /tmp/id_rsa -o StrictHostKeyChecking=no hostname
<% end %> <% end %>