Add some additional floating ip pool testing
Change-Id: I62cd6b43e3250dc28d66dc84d3759f47e81ff134
This commit is contained in:
parent
ea4a53da61
commit
696ad331a4
@ -24,6 +24,11 @@ pushd $(cd $(dirname "$0")/.. && pwd)
|
||||
source ./openrc
|
||||
popd
|
||||
|
||||
# Set some defaults
|
||||
|
||||
DEFAULT_FLOATING_POOL=${DEFAULT_FLOATING_POOL:-nova}
|
||||
TEST_FLOATING_POOL=${TEST_FLOATING_POOL:-test}
|
||||
|
||||
# Get a token for clients that don't support service catalog
|
||||
# ==========================================================
|
||||
|
||||
@ -130,11 +135,14 @@ nova secgroup-add-rule $SECGROUP icmp -1 -1 0.0.0.0/0
|
||||
# List rules for a secgroup
|
||||
nova secgroup-list-rules $SECGROUP
|
||||
|
||||
# allocate a floating ip
|
||||
nova floating-ip-create
|
||||
# allocate a floating ip from default pool
|
||||
FLOATING_IP=`nova floating-ip-create | grep $DEFAULT_FLOATING_POOL | cut -d '|' -f2`
|
||||
|
||||
# store floating address
|
||||
FLOATING_IP=`nova floating-ip-list | grep None | head -1 | cut -d '|' -f2 | sed 's/ //g'`
|
||||
# list floating addresses
|
||||
if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! nova floating-ip-list | grep -q $FLOATING_IP; do sleep 1; done"; then
|
||||
echo "Floating IP not allocated"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# add floating ip to our server
|
||||
nova add-floating-ip $NAME $FLOATING_IP
|
||||
@ -145,6 +153,15 @@ if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! ping -c1 -w1 $FLOATING_IP; do sle
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Allocate an IP from it
|
||||
TEST_FLOATING_IP=`nova floating-ip-create $TEST_FLOATING_POOL | grep $TEST_FLOATING_POOL | cut -d '|' -f2`
|
||||
|
||||
# list floating addresses
|
||||
if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! nova floating-ip-list | grep $TEST_FLOATING_POOL | grep -q $TEST_FLOATING_IP; do sleep 1; done"; then
|
||||
echo "Floating IP not allocated"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# dis-allow icmp traffic (ping)
|
||||
nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0
|
||||
|
||||
@ -161,6 +178,9 @@ fi
|
||||
# de-allocate the floating ip
|
||||
nova floating-ip-delete $FLOATING_IP
|
||||
|
||||
# Delete second floating IP
|
||||
nova floating-ip-delete $TEST_FLOATING_IP
|
||||
|
||||
# shutdown the server
|
||||
nova delete $NAME
|
||||
|
||||
|
8
stack.sh
8
stack.sh
@ -283,6 +283,11 @@ EC2_DMZ_HOST=${EC2_DMZ_HOST:-$SERVICE_HOST}
|
||||
FLAT_NETWORK_BRIDGE=${FLAT_NETWORK_BRIDGE:-br100}
|
||||
VLAN_INTERFACE=${VLAN_INTERFACE:-$PUBLIC_INTERFACE}
|
||||
|
||||
# Test floating pool and range are used for testing. They are defined
|
||||
# here until the admin APIs can replace nova-manage
|
||||
TEST_FLOATING_POOL=${TEST_FLOATING_POOL:-test}
|
||||
TEST_FLOATING_RANGE=${TEST_FLOATING_RANGE:-192.168.253.0/29}
|
||||
|
||||
# Multi-host is a mode where each compute node runs its own network node. This
|
||||
# allows network operations and routing for a VM to occur on the server that is
|
||||
# running the VM - removing a SPOF and bandwidth bottleneck.
|
||||
@ -1327,6 +1332,9 @@ if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then
|
||||
else
|
||||
# create some floating ips
|
||||
$NOVA_DIR/bin/nova-manage floating create $FLOATING_RANGE
|
||||
|
||||
# create a second pool
|
||||
$NOVA_DIR/bin/nova-manage floating create --ip_range=$TEST_FLOATING_RANGE --pool=$TEST_FLOATING_POOL
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user