-
Notifications
You must be signed in to change notification settings - Fork 10
/
runTests.sh
executable file
·63 lines (50 loc) · 2.16 KB
/
runTests.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
62
63
#!/bin/bash
set -e
echo Testing $1 ...
echo Building image ...
docker build -t $1 servers/$1
echo Starting server ...
docker run -d --name=server --env-file servers/$1/env.list --network=testnet $1
# echo Starting idp ...
# docker run --rm -d --name=idp --network=testnet node-solid-server
if [[ "$1" == community-solid-server ]]; then
until docker run --rm --network=testnet webid-provider curl -kI http://server:3000 2> /dev/null > /dev/null
do
echo Waiting for server to start, this can take up to a minute ...
docker ps -a
docker logs server || true
sleep 1
done
else
until docker run --rm --network=testnet webid-provider curl -kI https://server 2> /dev/null > /dev/null
do
echo Waiting for server to start, this can take up to a minute ...
docker ps -a
docker logs server || true
sleep 1
done
fi
if [[ "$1" == nextcloud-server ]]; then
echo Running init script for Nextcloud server ...
docker exec -u www-data -it server sh /init.sh
docker exec -u root -it server service apache2 reload
fi
if [[ "$1" == community-solid-server ]]; then
echo no cookie for community-solid-server
else
echo Getting cookie...
export COOKIE="`docker run --rm --cap-add=SYS_ADMIN --network=testnet --name cookie -e SERVER_TYPE=$1 --env-file servers/$1/env.list cookie`"
fi
# echo Running rdf-fixtures tester ...
# docker run --rm --network=testnet rdf-fixtures > reports/$1-rdf-fixtures.txt
echo Running webid-provider tester with cookie $COOKIE...
docker run --rm --network=testnet --name tester --env COOKIE="$COOKIE" --env-file servers/$1/env.list webid-provider 2> reports/$1-webid-provider.txt
echo Running solid-crud tester with cookie $COOKIE...
docker run --rm --network=testnet --name tester --env COOKIE="$COOKIE" --env-file servers/$1/env.list solid-crud 2> reports/$1-solid-crud.txt
# echo Running web-access-control tester with cookie $COOKIE...
# docker run --rm --network=testnet --name tester --env COOKIE="$COOKIE" --env-file servers/$1/env.list web-access-control 2> reports/$1-web-access-control.txt
echo Stopping server and idp...
docker stop server
# docker stop idp
echo Removing server...
docker rm server