From a9d45a4321b797326e1ceb4c4a1150555ffbc5f9 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 11 Sep 2015 15:11:06 +0100 Subject: Allow selection of testing backend. --- openstack/do-tests.sh | 19 +++++++++++++++++++ test-runner.sh | 26 +++++++++----------------- 2 files changed, 28 insertions(+), 17 deletions(-) create mode 100755 openstack/do-tests.sh diff --git a/openstack/do-tests.sh b/openstack/do-tests.sh new file mode 100755 index 0000000..a615711 --- /dev/null +++ b/openstack/do-tests.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Config +OS_TEST_SCRIPT="openstack/tester" +OS_NET_ID="b635e4b7-40f2-4ca2-8d35-644c479f6ba6" +OS_FLAVOUR="dc1.1x2" + +# Inputs +FILE=$1 +shift +TEST_FILES=$@ + +# Run the test +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 diff --git a/test-runner.sh b/test-runner.sh index a1020ef..dbff65b 100755 --- a/test-runner.sh +++ b/test-runner.sh @@ -1,31 +1,23 @@ #!/bin/bash -# TODO: Extend to support support different testing backends in addition to -# openstack. Take the testing backend to use as a CLI param. - -# Config -OS_TEST_SCRIPT="openstack/tester" -OS_NET_ID="71f5151a-b7c3-405d-a841-d1b07e5db099" -OS_FLAVOUR="m1.medium" - # Inputs URL=$1 FILE=`basename "$URL"` shift -TEST_FILES="$@" +BACKEND=$1 +shift +TEST_FILES=$@ LOG_FILE="$FILE.test.log" -# Fetch the image -curl -o "$FILE" "$URL" - # Write log header echo "Testing image $FILE on `date`" > "$LOG_FILE" echo " with test command files: $TEST_FILES" >> "$LOG_FILE" echo "===============================================================================" >> "$LOG_FILE" +# Fetch the image +echo "Fetching image $FILE" >> "$LOG_FILE" +curl -o "$FILE" "$URL" + # Run the test -"$OS_TEST_SCRIPT" \ - --net-id "$OS_NET_ID" \ - --flavour "$OS_FLAVOUR" \ - --image-file "$FILE" \ - "$TEST_FILES" >> "$LOG_FILE" 2>&1 +echo "Launching $BACKEND test backend" >> "$LOG_FILE" +"$BACKEND/do-tests.sh" "$FILE" $TEST_FILES >> "$LOG_FILE" 2>&1 -- cgit v1.2.1