-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.sh
executable file
·45 lines (37 loc) · 1.14 KB
/
test.sh
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
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
#
# test.sh - will pull and run the TestRunner suite against an already Demo compose cluster.
#
# Usage : ./test.sh -h
#
set -o errexit -o pipefail -o noclobber -o nounset
cd "$(dirname "$0")"
# Import our helper functions
. ./utils.sh
printHelp() {
echo "Usage: ./test.sh"
echo "Tests ioFog environment"
echo ""
echo "Arguments:"
echo " -h, --help print this help / usage"
}
if [[ $# -gt 0 ]]; then
printHelp
exit 1
fi
prettyHeader "Running Test Runner Suite"
# Check to see if we are already running the Demo
IOFOG_RUNNING=$(docker inspect -f '{{.State.Running}}' iofog-agent iofog-controller | tr -d "[:space:]")
if [[ "${IOFOG_RUNNING}" == "truetrue" ]]; then
echoInfo "ioFog stack is running"
else
echoError 'ioFog stack is not running! Please run `./start.sh` first'
exit 2
fi
echoInfo "Running Test Runner..."
# Testing local agent, need mounted docker socket to use legacy agent commands
docker run --rm --name test-runner --network host \
-v ~/.iofog/:/root/.iofog/ \
-v /var/run/docker.sock:/var/run/docker.sock \
iofog/test-runner:2.0.0-rc1
echoNotify "## Test Runner Tests complete"