From b7cc5bcbb44b1157cbcf61097084d6a178d01c73 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 26 Oct 2011 22:11:31 -0700 Subject: [PATCH 1/4] test pause/unpause using ping --- exercise.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/exercise.sh b/exercise.sh index 3f2c94e..f24693e 100755 --- a/exercise.sh +++ b/exercise.sh @@ -128,6 +128,23 @@ sleep 5 # ping our floating ip ping -c1 -w1 $FLOATING_IP +# pause the VM and verify we can't ping it anymore +nova pause $NAME + +sleep 1 + +if ( ping -c1 -w1 $FLOATING_IP ); then + echo "Pause failure - ping shouldn't work" + exit 1 +fi + +# unpause the VM and verify we can ping it again +nova unpause $NAME + +sleep 1 + +ping -c1 -w1 $FLOATING_IP + # dis-allow icmp traffic (ping) nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0 From 293c2ef6333901b4bb960716bcb4635fa54cf67a Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 27 Oct 2011 12:55:29 -0700 Subject: [PATCH 2/4] turn on admin api to make pause work --- stack.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index 82cc157..cea90d8 100755 --- a/stack.sh +++ b/stack.sh @@ -117,7 +117,7 @@ if [[ $EUID -eq 0 ]]; then fi exit 1 else - # Our user needs passwordless priviledges for certain commands which nova + # Our user needs passwordless priviledges for certain commands which nova # uses internally. # Natty uec images sudoers does not have a '#includedir'. add one. sudo grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers || @@ -602,6 +602,7 @@ function add_nova_flag { rm -f $NOVA_DIR/bin/nova.conf add_nova_flag "--verbose" add_nova_flag "--nodaemon" +add_nova_flag "--allow_admin_api" add_nova_flag "--scheduler_driver=$SCHEDULER" add_nova_flag "--dhcpbridge_flagfile=$NOVA_DIR/bin/nova.conf" add_nova_flag "--network_manager=nova.network.manager.$NET_MAN" From 467135e20cbdd180c81bf27756e72fc778d7e50d Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Thu, 27 Oct 2011 14:06:33 -0700 Subject: [PATCH 3/4] another attempt at pause/unpause --- exercise.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercise.sh b/exercise.sh index 9e7c5ae..f7dd175 100755 --- a/exercise.sh +++ b/exercise.sh @@ -130,9 +130,9 @@ fi # pause the VM and verify we can't ping it anymore nova pause $NAME -sleep 1 +sleep 2 -if ( ping -c1 -w1 $FLOATING_IP ); then +if ( ping -c1 -w1 $IP); then echo "Pause failure - ping shouldn't work" exit 1 fi @@ -140,9 +140,9 @@ fi # unpause the VM and verify we can ping it again nova unpause $NAME -sleep 1 +sleep 2 -ping -c1 -w1 $FLOATING_IP +ping -c1 -w1 $IP # dis-allow icmp traffic (ping) nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0 From 0c484feda47263cf1de5eaf034b39cb46a304d7c Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Thu, 27 Oct 2011 14:10:47 -0700 Subject: [PATCH 4/4] check that you can't hit the floating ip as well --- exercise.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/exercise.sh b/exercise.sh index f7dd175..61c7b08 100755 --- a/exercise.sh +++ b/exercise.sh @@ -137,6 +137,11 @@ if ( ping -c1 -w1 $IP); then exit 1 fi +if ( ping -c1 -w1 $FLOATING_IP); then + echo "Pause failure - ping floating ips shouldn't work" + exit 1 +fi + # unpause the VM and verify we can ping it again nova unpause $NAME