forked from pabra/docker_awstats
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·37 lines (28 loc) · 1.03 KB
/
run_tests.sh
File metadata and controls
executable file
·37 lines (28 loc) · 1.03 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
#!/bin/sh
set -e
cleanup() {
docker compose -f test/docker-compose.yml down --volumes
}
trap cleanup EXIT INT
if [ -t 1 ]; then
no_tty=
else
no_tty='-T'
fi
run_tests() {
export HTTPD_PORT="$1"
export USER="$2"
docker compose -f test/docker-compose.yml up -d
docker compose -f test/docker-compose.yml run --rm ${no_tty} awstats-test /bin/sh -c "wait4ports -t 10 tcp://awstats:$HTTPD_PORT"
docker compose -f test/docker-compose.yml run --rm ${no_tty} awstats-test test1.sh "$HTTPD_PORT"
docker compose -f test/docker-compose.yml exec ${no_tty} awstats awstats_updateall.pl now
docker compose -f test/docker-compose.yml run --rm ${no_tty} awstats-test test2.sh "$HTTPD_PORT"
docker compose -f test/docker-compose.yml exec ${no_tty} awstats awstats_updateall.pl now
docker compose -f test/docker-compose.yml run --rm ${no_tty} awstats-test test3.sh "$HTTPD_PORT"
}
if [ "$1" != 'skip_build' ]; then
docker compose -f test/docker-compose.yml build
fi
run_tests 80 0
cleanup
run_tests 4567 1234