-
Notifications
You must be signed in to change notification settings - Fork 19
/
docker-compose.test.yml
50 lines (41 loc) · 1.66 KB
/
docker-compose.test.yml
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
version: "2"
services:
server:
image: localhost:5000/sut
build:
context: .
dockerfile: Dockerfile
command: -config /config/dnscrypt-proxy.toml -loglevel 0
sut:
image: alpine:3.20@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
depends_on:
- server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /test
entrypoint:
- /bin/sh
- -c
command:
- |
set -ex
apk add --no-cache bind-tools docker-cli docker-cli-compose
server_ip="$$(dig +short server | tail -n 1)"
while read id
do
if docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $${id} | grep -q "$${server_ip}"
then
server_id="$${id}"
break
fi
done < <(docker ps --format '{{.ID}}')
docker exec $${server_id} dnscrypt-proxy -version
sleep 5
docker exec $${server_id} dnsprobe -timeout=10s dnssec.works 127.0.0.1:5053
! docker exec $${server_id} dnsprobe foo.local 127.0.0.1:5053
! docker exec $${server_id} dnsprobe bar.local 127.0.0.1:5053
dig @server -p 5053 dnssec.works +dnssec +multi | tee /dev/stderr | grep -wq NOERROR
! dig @server -p 5053 fail01.dnssec.works +dnssec +multi | tee /dev/stderr | grep -wq NOERROR
! dig @server -p 5053 fail02.dnssec.works +dnssec +multi | tee /dev/stderr | grep -wq NOERROR
! dig @server -p 5053 fail03.dnssec.works +dnssec +multi | tee /dev/stderr | grep -wq NOERROR
! dig @server -p 5053 fail04.dnssec.works +dnssec +multi | tee /dev/stderr | grep -wq NOERROR