summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2015-09-11 10:21:01 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2015-09-11 15:01:31 +0100
commit8b245bb9573bc4c1ec848736134e88fa79492d64 (patch)
tree9f781d6dd33002ee21f94f3ddaa3573b824e902c
parent013d6bb5e59dbadaf6aabb6705e930741727202f (diff)
downloadciat-tester-8b245bb9573bc4c1ec848736134e88fa79492d64.tar.gz
Add test runner.
-rwxr-xr-xtest-runner.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/test-runner.sh b/test-runner.sh
new file mode 100755
index 0000000..a1020ef
--- /dev/null
+++ b/test-runner.sh
@@ -0,0 +1,31 @@
+#!/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="$@"
+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"
+
+# Run the test
+"$OS_TEST_SCRIPT" \
+ --net-id "$OS_NET_ID" \
+ --flavour "$OS_FLAVOUR" \
+ --image-file "$FILE" \
+ "$TEST_FILES" >> "$LOG_FILE" 2>&1