summaryrefslogtreecommitdiff
path: root/test-runner.sh
blob: a36a7489524fc3ab96c7ca8aefb97a406480dc71 (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
#!/bin/bash

# Inputs
URL=$1
FILE=`basename "$URL"`
shift
BACKEND=$1
shift
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 "===============================================================================" >> "$LOG_FILE"

# Fetch the image
echo "Fetching image $FILE" >> "$LOG_FILE"
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

# Delete the test image
echo "Deleting local image $FILE" >> "$LOG_FILE" 2>&1
rm "$FILE"