clean up whitespace issues on exercises and friends
Change-Id: I812a73e46ddd4d5fed4d304d9ef92c1de243f497
This commit is contained in:
parent
101b424842
commit
922c8ae680
@ -119,7 +119,7 @@ nova flavor-list
|
|||||||
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
|
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
|
||||||
if [[ -z "$INSTANCE_TYPE" ]]; then
|
if [[ -z "$INSTANCE_TYPE" ]]; then
|
||||||
# grab the first flavor in the list to launch if default doesn't exist
|
# grab the first flavor in the list to launch if default doesn't exist
|
||||||
INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
|
INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean-up from previous runs
|
# Clean-up from previous runs
|
||||||
|
@ -62,7 +62,7 @@ die_if_not_set $LINENO IMAGE "Failure getting image $DOCKER_IMAGE_NAME"
|
|||||||
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
|
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
|
||||||
if [[ -z "$INSTANCE_TYPE" ]]; then
|
if [[ -z "$INSTANCE_TYPE" ]]; then
|
||||||
# grab the first flavor in the list to launch if default doesn't exist
|
# grab the first flavor in the list to launch if default doesn't exist
|
||||||
INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
|
INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean-up from previous runs
|
# Clean-up from previous runs
|
||||||
@ -102,4 +102,3 @@ set +o xtrace
|
|||||||
echo "*********************************************************************"
|
echo "*********************************************************************"
|
||||||
echo "SUCCESS: End DevStack Exercise: $0"
|
echo "SUCCESS: End DevStack Exercise: $0"
|
||||||
echo "*********************************************************************"
|
echo "*********************************************************************"
|
||||||
|
|
||||||
|
@ -87,31 +87,31 @@ fi
|
|||||||
# Volumes
|
# Volumes
|
||||||
# -------
|
# -------
|
||||||
if is_service_enabled c-vol && ! is_service_enabled n-cell; then
|
if is_service_enabled c-vol && ! is_service_enabled n-cell; then
|
||||||
VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
|
VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
|
||||||
die_if_not_set $LINENO VOLUME_ZONE "Failure to find zone for volume"
|
die_if_not_set $LINENO VOLUME_ZONE "Failure to find zone for volume"
|
||||||
|
|
||||||
VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2`
|
VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2`
|
||||||
die_if_not_set $LINENO VOLUME "Failure to create volume"
|
die_if_not_set $LINENO VOLUME "Failure to create volume"
|
||||||
|
|
||||||
# Test that volume has been created
|
# Test that volume has been created
|
||||||
VOLUME=`euca-describe-volumes $VOLUME | cut -f2`
|
VOLUME=`euca-describe-volumes $VOLUME | cut -f2`
|
||||||
die_if_not_set $LINENO VOLUME "Failure to get volume"
|
die_if_not_set $LINENO VOLUME "Failure to get volume"
|
||||||
|
|
||||||
# Test volume has become available
|
# Test volume has become available
|
||||||
if ! timeout $RUNNING_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
|
if ! timeout $RUNNING_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
|
||||||
die $LINENO "volume didn't become available within $RUNNING_TIMEOUT seconds"
|
die $LINENO "volume didn't become available within $RUNNING_TIMEOUT seconds"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Attach volume to an instance
|
# Attach volume to an instance
|
||||||
euca-attach-volume -i $INSTANCE -d $ATTACH_DEVICE $VOLUME || \
|
euca-attach-volume -i $INSTANCE -d $ATTACH_DEVICE $VOLUME || \
|
||||||
die $LINENO "Failure attaching volume $VOLUME to $INSTANCE"
|
die $LINENO "Failure attaching volume $VOLUME to $INSTANCE"
|
||||||
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -A 1 in-use | grep -q attach; do sleep 1; done"; then
|
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -A 1 in-use | grep -q attach; do sleep 1; done"; then
|
||||||
die $LINENO "Could not attach $VOLUME to $INSTANCE"
|
die $LINENO "Could not attach $VOLUME to $INSTANCE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Detach volume from an instance
|
# Detach volume from an instance
|
||||||
euca-detach-volume $VOLUME || \
|
euca-detach-volume $VOLUME || \
|
||||||
die $LINENO "Failure detaching volume $VOLUME to $INSTANCE"
|
die $LINENO "Failure detaching volume $VOLUME to $INSTANCE"
|
||||||
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
|
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
|
||||||
die $LINENO "Could not detach $VOLUME to $INSTANCE"
|
die $LINENO "Could not detach $VOLUME to $INSTANCE"
|
||||||
fi
|
fi
|
||||||
@ -120,7 +120,7 @@ if is_service_enabled c-vol && ! is_service_enabled n-cell; then
|
|||||||
euca-delete-volume $VOLUME || \
|
euca-delete-volume $VOLUME || \
|
||||||
die $LINENO "Failure to delete volume"
|
die $LINENO "Failure to delete volume"
|
||||||
if ! timeout $ACTIVE_TIMEOUT sh -c "while euca-describe-volumes | grep $VOLUME; do sleep 1; done"; then
|
if ! timeout $ACTIVE_TIMEOUT sh -c "while euca-describe-volumes | grep $VOLUME; do sleep 1; done"; then
|
||||||
die $LINENO "Could not delete $VOLUME"
|
die $LINENO "Could not delete $VOLUME"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Volume Tests Skipped"
|
echo "Volume Tests Skipped"
|
||||||
|
@ -113,7 +113,7 @@ nova flavor-list
|
|||||||
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
|
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
|
||||||
if [[ -z "$INSTANCE_TYPE" ]]; then
|
if [[ -z "$INSTANCE_TYPE" ]]; then
|
||||||
# grab the first flavor in the list to launch if default doesn't exist
|
# grab the first flavor in the list to launch if default doesn't exist
|
||||||
INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
|
INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean-up from previous runs
|
# Clean-up from previous runs
|
||||||
@ -168,7 +168,7 @@ if ! is_service_enabled neutron; then
|
|||||||
# list floating addresses
|
# 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
|
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
|
||||||
die $LINENO "Floating IP not allocated"
|
die $LINENO "Floating IP not allocated"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Dis-allow icmp traffic (ping)
|
# Dis-allow icmp traffic (ping)
|
||||||
|
@ -273,12 +273,12 @@ function create_vms {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ping_ip {
|
function ping_ip {
|
||||||
# Test agent connection. Assumes namespaces are disabled, and
|
# Test agent connection. Assumes namespaces are disabled, and
|
||||||
# that DHCP is in use, but not L3
|
# that DHCP is in use, but not L3
|
||||||
local VM_NAME=$1
|
local VM_NAME=$1
|
||||||
local NET_NAME=$2
|
local NET_NAME=$2
|
||||||
IP=$(get_instance_ip $VM_NAME $NET_NAME)
|
IP=$(get_instance_ip $VM_NAME $NET_NAME)
|
||||||
ping_check $NET_NAME $IP $BOOT_TIMEOUT
|
ping_check $NET_NAME $IP $BOOT_TIMEOUT
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_vm {
|
function check_vm {
|
||||||
@ -330,12 +330,12 @@ function delete_network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function delete_networks {
|
function delete_networks {
|
||||||
foreach_tenant_net 'delete_network ${%TENANT%_NAME} %NUM%'
|
foreach_tenant_net 'delete_network ${%TENANT%_NAME} %NUM%'
|
||||||
#TODO(nati) add secuirty group check after it is implemented
|
# TODO(nati) add secuirty group check after it is implemented
|
||||||
# source $TOP_DIR/openrc demo1 demo1
|
# source $TOP_DIR/openrc demo1 demo1
|
||||||
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
|
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
|
||||||
# source $TOP_DIR/openrc demo2 demo2
|
# source $TOP_DIR/openrc demo2 demo2
|
||||||
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
|
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_all {
|
function create_all {
|
||||||
|
@ -117,7 +117,7 @@ nova flavor-list
|
|||||||
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
|
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
|
||||||
if [[ -z "$INSTANCE_TYPE" ]]; then
|
if [[ -z "$INSTANCE_TYPE" ]]; then
|
||||||
# grab the first flavor in the list to launch if default doesn't exist
|
# grab the first flavor in the list to launch if default doesn't exist
|
||||||
INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
|
INSTANCE_TYPE=$(nova flavor-list | head -n 4 | tail -n 1 | get_field 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean-up from previous runs
|
# Clean-up from previous runs
|
||||||
|
@ -66,12 +66,12 @@ fi
|
|||||||
# Heat
|
# Heat
|
||||||
if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then
|
||||||
HEAT_USER=$(get_id keystone user-create --name=heat \
|
HEAT_USER=$(get_id keystone user-create --name=heat \
|
||||||
--pass="$SERVICE_PASSWORD" \
|
--pass="$SERVICE_PASSWORD" \
|
||||||
--tenant_id $SERVICE_TENANT \
|
--tenant_id $SERVICE_TENANT \
|
||||||
--email=heat@example.com)
|
--email=heat@example.com)
|
||||||
keystone user-role-add --tenant-id $SERVICE_TENANT \
|
keystone user-role-add --tenant-id $SERVICE_TENANT \
|
||||||
--user-id $HEAT_USER \
|
--user-id $HEAT_USER \
|
||||||
--role-id $SERVICE_ROLE
|
--role-id $SERVICE_ROLE
|
||||||
# heat_stack_user role is for users created by Heat
|
# heat_stack_user role is for users created by Heat
|
||||||
keystone role-create --name heat_stack_user
|
keystone role-create --name heat_stack_user
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
@ -126,16 +126,16 @@ fi
|
|||||||
# Ceilometer
|
# Ceilometer
|
||||||
if [[ "$ENABLED_SERVICES" =~ "ceilometer" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "ceilometer" ]]; then
|
||||||
CEILOMETER_USER=$(get_id keystone user-create --name=ceilometer \
|
CEILOMETER_USER=$(get_id keystone user-create --name=ceilometer \
|
||||||
--pass="$SERVICE_PASSWORD" \
|
--pass="$SERVICE_PASSWORD" \
|
||||||
--tenant_id $SERVICE_TENANT \
|
--tenant_id $SERVICE_TENANT \
|
||||||
--email=ceilometer@example.com)
|
--email=ceilometer@example.com)
|
||||||
keystone user-role-add --tenant-id $SERVICE_TENANT \
|
keystone user-role-add --tenant-id $SERVICE_TENANT \
|
||||||
--user-id $CEILOMETER_USER \
|
--user-id $CEILOMETER_USER \
|
||||||
--role-id $ADMIN_ROLE
|
--role-id $ADMIN_ROLE
|
||||||
# Ceilometer needs ResellerAdmin role to access swift account stats.
|
# Ceilometer needs ResellerAdmin role to access swift account stats.
|
||||||
keystone user-role-add --tenant-id $SERVICE_TENANT \
|
keystone user-role-add --tenant-id $SERVICE_TENANT \
|
||||||
--user-id $CEILOMETER_USER \
|
--user-id $CEILOMETER_USER \
|
||||||
--role-id $RESELLER_ROLE
|
--role-id $RESELLER_ROLE
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
CEILOMETER_SERVICE=$(get_id keystone service-create \
|
CEILOMETER_SERVICE=$(get_id keystone service-create \
|
||||||
--name=ceilometer \
|
--name=ceilometer \
|
||||||
|
@ -122,16 +122,16 @@ fi
|
|||||||
|
|
||||||
# test empty option
|
# test empty option
|
||||||
if ini_has_option test.ini ddd empty; then
|
if ini_has_option test.ini ddd empty; then
|
||||||
echo "OK: ddd.empty present"
|
echo "OK: ddd.empty present"
|
||||||
else
|
else
|
||||||
echo "ini_has_option failed: ddd.empty not found"
|
echo "ini_has_option failed: ddd.empty not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# test non-empty option
|
# test non-empty option
|
||||||
if ini_has_option test.ini bbb handlers; then
|
if ini_has_option test.ini bbb handlers; then
|
||||||
echo "OK: bbb.handlers present"
|
echo "OK: bbb.handlers present"
|
||||||
else
|
else
|
||||||
echo "ini_has_option failed: bbb.handlers not found"
|
echo "ini_has_option failed: bbb.handlers not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# test changing empty option
|
# test changing empty option
|
||||||
|
Loading…
Reference in New Issue
Block a user