clean up whitespace issues on exercises and friends

Change-Id: I812a73e46ddd4d5fed4d304d9ef92c1de243f497
This commit is contained in:
Sean Dague 2013-10-22 10:06:06 -04:00
parent 101b424842
commit 922c8ae680
8 changed files with 54 additions and 55 deletions

View File

@ -119,7 +119,7 @@ nova flavor-list
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
if [[ -z "$INSTANCE_TYPE" ]]; then
# 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
# Clean-up from previous runs

View File

@ -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)
if [[ -z "$INSTANCE_TYPE" ]]; then
# 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
# Clean-up from previous runs
@ -102,4 +102,3 @@ set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
echo "*********************************************************************"

View File

@ -87,31 +87,31 @@ fi
# Volumes
# -------
if is_service_enabled c-vol && ! is_service_enabled n-cell; then
VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
die_if_not_set $LINENO VOLUME_ZONE "Failure to find zone for volume"
VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
die_if_not_set $LINENO VOLUME_ZONE "Failure to find zone for volume"
VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2`
die_if_not_set $LINENO VOLUME "Failure to create volume"
VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2`
die_if_not_set $LINENO VOLUME "Failure to create volume"
# Test that volume has been created
VOLUME=`euca-describe-volumes $VOLUME | cut -f2`
die_if_not_set $LINENO VOLUME "Failure to get volume"
# Test that volume has been created
VOLUME=`euca-describe-volumes $VOLUME | cut -f2`
die_if_not_set $LINENO VOLUME "Failure to get volume"
# Test volume has become available
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"
fi
# Test volume has become available
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"
fi
# Attach volume to an instance
euca-attach-volume -i $INSTANCE -d $ATTACH_DEVICE $VOLUME || \
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
die $LINENO "Could not attach $VOLUME to $INSTANCE"
fi
# Attach volume to an instance
euca-attach-volume -i $INSTANCE -d $ATTACH_DEVICE $VOLUME || \
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
die $LINENO "Could not attach $VOLUME to $INSTANCE"
fi
# Detach volume from an instance
euca-detach-volume $VOLUME || \
die $LINENO "Failure detaching volume $VOLUME to $INSTANCE"
# Detach volume from an instance
euca-detach-volume $VOLUME || \
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
die $LINENO "Could not detach $VOLUME to $INSTANCE"
fi
@ -120,7 +120,7 @@ if is_service_enabled c-vol && ! is_service_enabled n-cell; then
euca-delete-volume $VOLUME || \
die $LINENO "Failure to delete volume"
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
else
echo "Volume Tests Skipped"

View File

@ -113,7 +113,7 @@ nova flavor-list
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
if [[ -z "$INSTANCE_TYPE" ]]; then
# 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
# Clean-up from previous runs
@ -168,7 +168,7 @@ if ! is_service_enabled neutron; then
# 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
die $LINENO "Floating IP not allocated"
fi
fi
fi
# Dis-allow icmp traffic (ping)

View File

@ -273,12 +273,12 @@ function create_vms {
}
function ping_ip {
# Test agent connection. Assumes namespaces are disabled, and
# that DHCP is in use, but not L3
local VM_NAME=$1
local NET_NAME=$2
IP=$(get_instance_ip $VM_NAME $NET_NAME)
ping_check $NET_NAME $IP $BOOT_TIMEOUT
# Test agent connection. Assumes namespaces are disabled, and
# that DHCP is in use, but not L3
local VM_NAME=$1
local NET_NAME=$2
IP=$(get_instance_ip $VM_NAME $NET_NAME)
ping_check $NET_NAME $IP $BOOT_TIMEOUT
}
function check_vm {
@ -330,12 +330,12 @@ function delete_network {
}
function delete_networks {
foreach_tenant_net 'delete_network ${%TENANT%_NAME} %NUM%'
#TODO(nati) add secuirty group check after it is implemented
# source $TOP_DIR/openrc demo1 demo1
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
# source $TOP_DIR/openrc demo2 demo2
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
foreach_tenant_net 'delete_network ${%TENANT%_NAME} %NUM%'
# TODO(nati) add secuirty group check after it is implemented
# source $TOP_DIR/openrc demo1 demo1
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
# source $TOP_DIR/openrc demo2 demo2
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
}
function create_all {

View File

@ -117,7 +117,7 @@ nova flavor-list
INSTANCE_TYPE=$(nova flavor-list | grep $DEFAULT_INSTANCE_TYPE | get_field 1)
if [[ -z "$INSTANCE_TYPE" ]]; then
# 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
# Clean-up from previous runs

View File

@ -66,12 +66,12 @@ fi
# Heat
if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then
HEAT_USER=$(get_id keystone user-create --name=heat \
--pass="$SERVICE_PASSWORD" \
--tenant_id $SERVICE_TENANT \
--email=heat@example.com)
--pass="$SERVICE_PASSWORD" \
--tenant_id $SERVICE_TENANT \
--email=heat@example.com)
keystone user-role-add --tenant-id $SERVICE_TENANT \
--user-id $HEAT_USER \
--role-id $SERVICE_ROLE
--user-id $HEAT_USER \
--role-id $SERVICE_ROLE
# heat_stack_user role is for users created by Heat
keystone role-create --name heat_stack_user
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
@ -126,16 +126,16 @@ fi
# Ceilometer
if [[ "$ENABLED_SERVICES" =~ "ceilometer" ]]; then
CEILOMETER_USER=$(get_id keystone user-create --name=ceilometer \
--pass="$SERVICE_PASSWORD" \
--tenant_id $SERVICE_TENANT \
--email=ceilometer@example.com)
--pass="$SERVICE_PASSWORD" \
--tenant_id $SERVICE_TENANT \
--email=ceilometer@example.com)
keystone user-role-add --tenant-id $SERVICE_TENANT \
--user-id $CEILOMETER_USER \
--role-id $ADMIN_ROLE
--user-id $CEILOMETER_USER \
--role-id $ADMIN_ROLE
# Ceilometer needs ResellerAdmin role to access swift account stats.
keystone user-role-add --tenant-id $SERVICE_TENANT \
--user-id $CEILOMETER_USER \
--role-id $RESELLER_ROLE
--user-id $CEILOMETER_USER \
--role-id $RESELLER_ROLE
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
CEILOMETER_SERVICE=$(get_id keystone service-create \
--name=ceilometer \

View File

@ -122,16 +122,16 @@ fi
# test empty option
if ini_has_option test.ini ddd empty; then
echo "OK: ddd.empty present"
echo "OK: ddd.empty present"
else
echo "ini_has_option failed: ddd.empty not found"
echo "ini_has_option failed: ddd.empty not found"
fi
# test non-empty option
if ini_has_option test.ini bbb handlers; then
echo "OK: bbb.handlers present"
echo "OK: bbb.handlers present"
else
echo "ini_has_option failed: bbb.handlers not found"
echo "ini_has_option failed: bbb.handlers not found"
fi
# test changing empty option