-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtest-namespace.sh
30 lines (22 loc) · 957 Bytes
/
test-namespace.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
#!/bin/bash
NAMESPACE=$1
TEST_IMAGE=$2
echo ${TEST_IMAGE}
cp "${AWS_CONFIG_FILE}" ./aws_config
cp "${AWS_SHARED_CREDENTIALS_FILE}" ./aws_shared_credentials
set -x
docker run --name system-tests --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun --network=host --volumes-from="$(docker ps -q)" -e AWS_CONFIG_FILE="$(pwd)/aws_config" -e AWS_SHARED_CREDENTIALS_FILE="$(pwd)/aws_shared_credentials" -i "${TEST_IMAGE}" "signalFlowSanityTests" "signalbox" "${NAMESPACE}"
docker cp system-tests:junit-report "${CI_PROJECT_DIR}/" || echo "junit-report copy failed"
docker cp system-tests:system-tests-status.txt "." || echo "system-tests-status copy failed"
docker rm system-tests
if grep -q "SYSTEM_TESTS_FAILED=true" system-tests-status.txt
then
echo "System-tests failed"
exit 1
elif grep -q "SYSTEM_TESTS_FAILED=false" system-tests-status.txt
then
echo "System-tests passed"
else
echo "System-tests run-time error"
exit 1
fi