-
Notifications
You must be signed in to change notification settings - Fork 8
/
test-launch.sh
executable file
·61 lines (50 loc) · 2.4 KB
/
test-launch.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Script that launches tests from the repo https://github.ibm.com/powercloud/dockertest
set -eu
FILE_ENV="/workspace/env.list"
source ${FILE_ENV}
# Start the dockerd and wait for it to start
${PATH_SCRIPTS}/dockerctl.sh start
#Calling dockerinfo to trace the versions info (docker and deps)
#TODO addsome automated checks to make sure we are testing the proper package versions
echo "= Docker info for ${DISTRO_NAME} start ="
docker info
echo "= Docker info for ${DISTRO_NAME} end ="
echo ""
DOCKER_CLI_VERSION=$(docker version --format '{{.Client.Version}}')
DOCKER_SERVER_VERSION=$(docker version --format '{{.Server.Version}}')
CONTAINERD_VERSION=$(docker version| awk '/containerd/{getline; print $2}')
RUNC_VERSION=$(docker version| awk '/runc/{getline; print $2}')
if [[ ${RUNC_VERSION} != ${CONTAINERD_RUNC_TAG:1} ]]; then
echo "ERROR: Version mismatch: RUNC version being tested is ${CONTAINERD_RUNC_TAG:1} and RUNC version downloaded from the Docker website is ${RUNC_VERSION}"
exit 1
fi
if [[ ${DOCKER_CLI_VERSION:1} != ${DOCKER_TAG:1} ]]; then
echo "ERROR: Version mismatch: Docker CLI version being tested is ${DOCKER_TAG:1} and Docker CLI version downloaded from the Docker website is ${DOCKER_CLI_VERSION:1}"
exit 1
fi
if [[ ${DOCKER_SERVER_VERSION:1} != ${DOCKER_TAG:1} ]]; then
echo "ERROR: Version mismatch: Docker Server version being tested is ${DOCKER_TAG:1} and Docker Server version downloaded from the Docker website is ${DOCKER_SERVER_VERSION:1}"
exit 1
fi
if [[ ${CONTAINERD_VERSION} != ${CONTAINERD_TAG:1} ]]; then
echo "ERROR: Version mismatch: containerd version being tested is ${CONTAINERD_TAG:1} and containerd version downloaded from the Docker website is ${CONTAINERD}"
exit 1
fi
# Run the docker test suite that consists of 3 tests
echo "= Docker test suite for ${DISTRO_NAME} ="
export GOPATH=${WORKSPACE}/test:/go
export PATH="/workspace/test/bin:$PATH"
export GO111MODULE=auto
cd /workspace/test/src/github.ibm.com/powercloud/dockertest
go install gotest.tools/[email protected]
echo "* Go version:"
go version
if [[ ${DISTRO_NAME} == "alpine" ]]
then
gotestsum --format standard-verbose --junitfile ${DIR_TEST}/junit-tests-${DISTRO_NAME}.xml --debug -- ./tests/${DISTRO_NAME}
else
gotestsum --format standard-verbose --junitfile ${DIR_TEST}/junit-tests-${DISTRO_NAME}-${DISTRO_VERS}.xml --debug -- ./tests/${DISTRO_NAME}
fi
echo "== End of the docker test suite =="
exit 0