File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -21,5 +21,16 @@ services:
2121 - ./src/test/resources/bind/named.conf:/etc/bind/named.conf:ro
2222 - ./src/test/resources/bind/example.com.db:/tmp/example.com.db
2323
24+ sut :
25+ build : ./src/test/resources/sut
26+ command : /run-tests.sh
27+ depends_on :
28+ - app
29+ - bind
30+ networks :
31+ - containers
32+ volumes :
33+ - ./run-tests.sh:/run-tests.sh:ro
34+
2435networks :
2536 containers:
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ function test_record()
6+ {
7+ address=$( dig @bind +short $1 myhost.example.com)
8+
9+ if [[ ${address} != $2 ]]; then
10+ echo " Expected $2 but got ${address} "
11+ exit 1
12+ fi
13+ }
14+
15+ curl -s " http://app/?hostname=myhost.example.com&myip=1.2.3.4" -u myuser:mypassword
16+ test_record A " 1.2.3.4"
17+ test_record AAAA " "
18+
19+ curl -s " http://app/?hostname=myhost.example.com&myipv6=f410:a02c:a197:2bdf:b9b:e5ac:5c85:f5bd" -u myuser:mypassword
20+ test_record A " 1.2.3.4"
21+ test_record AAAA " f410:a02c:a197:2bdf:b9b:e5ac:5c85:f5bd"
22+
23+ curl -s " http://app/?hostname=myhost.example.com&myip=10.20.30.40&myipv6=cbf0:84cb:61a5:139f:ba91:358c:15c5:aca4" -u myuser:mypassword
24+ test_record A " 10.20.30.40"
25+ test_record AAAA " cbf0:84cb:61a5:139f:ba91:358c:15c5:aca4"
Original file line number Diff line number Diff line change 1+ FROM debian
2+
3+ RUN apt-get update && \
4+ apt-get install -y curl dnsutils
You can’t perform that action at this time.
0 commit comments