From 6513e3c8c7426c3900334b640326d1549fbb0f21 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 11 Sep 2015 15:25:35 +0000 Subject: Improve shell stuff with review from Richard Maw. --- openstack/do-tests.sh | 8 ++++---- test-runner.sh | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/openstack/do-tests.sh b/openstack/do-tests.sh index a615711..407e398 100755 --- a/openstack/do-tests.sh +++ b/openstack/do-tests.sh @@ -6,14 +6,14 @@ OS_NET_ID="b635e4b7-40f2-4ca2-8d35-644c479f6ba6" OS_FLAVOUR="dc1.1x2" # Inputs -FILE=$1 +FILE="$1" shift -TEST_FILES=$@ +TEST_FILES=( "$@" ) # Run the test -echo "Running: $OS_TEST_SCRIPT --net-id $OS_NET_ID --flavour $OS_FLAVOUR --image-file $FILE $TEST_FILES" +echo "Running: $OS_TEST_SCRIPT --net-id $OS_NET_ID --flavour $OS_FLAVOUR --image-file $FILE ${TEST_FILES[@]}" "$OS_TEST_SCRIPT" \ --net-id "$OS_NET_ID" \ --flavour "$OS_FLAVOUR" \ --image-file "$FILE" \ - $TEST_FILES + "${TEST_FILES[@]}" diff --git a/test-runner.sh b/test-runner.sh index 9ce1694..b272af2 100755 --- a/test-runner.sh +++ b/test-runner.sh @@ -7,17 +7,17 @@ # ./test-runner.sh file:///test.img openstack tests/uname.test # Inputs -URL=$1 -FILE=`basename "$URL"` +URL="$1" +FILE=$(basename "$URL") shift -BACKEND=$1 +BACKEND="$1" shift -TEST_FILES=$@ +TEST_FILES=( "$@" ) LOG_FILE="$FILE.test.log" # Write log header -echo "Testing image $FILE on `date`" > "$LOG_FILE" -echo " with test command files: $TEST_FILES" >> "$LOG_FILE" +echo "Testing image $FILE on $(date)" > "$LOG_FILE" +echo " with test command files: ${TEST_FILES[@]}" >> "$LOG_FILE" echo "===============================================================================" >> "$LOG_FILE" # Fetch the image @@ -26,7 +26,7 @@ curl -o "$FILE" "$URL" # Run the test echo "Launching $BACKEND test backend" >> "$LOG_FILE" -"$BACKEND/do-tests.sh" "$FILE" $TEST_FILES >> "$LOG_FILE" 2>&1 +"$BACKEND/do-tests.sh" "$FILE" "${TEST_FILES[@]}" >> "$LOG_FILE" 2>&1 # Delete the test image echo "Deleting local image $FILE" >> "$LOG_FILE" 2>&1 -- cgit v1.2.1