summaryrefslogtreecommitdiff
path: root/test-runner.sh
blob: a1020ef6db9ff1e3e3fdf9f0ab25728162d6c040 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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