summaryrefslogtreecommitdiff
path: root/test-runner.sh
blob: 441a024579be1a38e52d832d0b1fb70b9898e2e2 (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
32
33
34
#!/bin/bash

# Usage:
#  ./test-runner.sh <IMG_URL> <BACKEND> [<TEST> [<TEST> ...]]
#
# Example:
#  ./test-runner.sh file:///test.img openstack tests/uname.test

set -e

# Inputs
URL="$1"
FILE="$(basename "$URL")"
shift
BACKEND="$1"
shift
TEST_FILES=( "$@" )

# Write log header
echo "Testing image $FILE on $(date)"
echo "  with test command files: ${TEST_FILES[@]}"
echo "==============================================================================="

# Fetch the image
echo "Fetching image $FILE"
curl -o "$FILE" "$URL"

# Run the test
echo "Launching $BACKEND test backend"
"$BACKEND/do-tests.sh" "$FILE" "${TEST_FILES[@]}" 2>&1

# Delete the test image
echo "Deleting local image $FILE"
rm "$FILE"