-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathdocker-test.sh
More file actions
executable file
·40 lines (33 loc) · 1.05 KB
/
docker-test.sh
File metadata and controls
executable file
·40 lines (33 loc) · 1.05 KB
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
#!/bin/bash
declare -r HOST_ROOT_DIR=`pwd`
declare -r HOST_TEST_RESULTS_PATH=${HOST_ROOT_DIR}/test_results
declare -r HOST_LOG_PATH=${HOST_TEST_RESULTS_PATH}
declare -r HOST_LOG_FILENAME=${HOST_LOG_PATH}/logs.txt
declare -r DOCKER_IMAGE="${DOCKER_IMAGE:-ghcr.io/wolfssl/wolfboot-ci-renode:latest}"
declare -r DOCKER_WORKSPACE=/workspace
declare -r DOCKER_TEST_RESULTS_PATH=/tmp/test_results
mkdir -p ${HOST_LOG_PATH}
docker pull ${DOCKER_IMAGE} >/dev/null 2>&1 || true
exit_code=0
if ! docker run \
--log-driver=none -a stdout -a stderr \
--volume ${HOST_ROOT_DIR}:${DOCKER_WORKSPACE} \
--volume ${HOST_TEST_RESULTS_PATH}:${DOCKER_TEST_RESULTS_PATH} \
--env SCRIPT=${DOCKER_WORKSPACE}/renode-config.resc \
--workdir ${DOCKER_WORKSPACE} \
${DOCKER_IMAGE} \
/bin/bash -c "tools/scripts/renode-test-update.sh $@ 2>&1 > ${DOCKER_TEST_RESULTS_PATH}/logs.txt"
then
echo "FAILED"
exit_code=1
fi
echo -e "\n----- LOGS -----\n"
cat ${HOST_LOG_FILENAME}
if [ $exit_code -eq 0 ]
then
echo "$1: PASS"
else
echo "$1: FAIL"
fi
# Raise the exit
exit $exit_code