simplify NXDOMAIN test
- remove premature abstraction - only do one check
This commit is contained in:
1 parent
970af56765
commit
ad34a56e56
2 files changed
+1
-14
No files matched your search
@@ -15,7 +15,6 @@ weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/s
|
|||||||
|
|
||||||
assert_dns_record $HOST1 c1 $NAME $C2
|
assert_dns_record $HOST1 c1 $NAME $C2
|
||||||
|
|
||||||
assert_dns_status $HOST1 c1 "MX seetwo.weave.local" NXDOMAIN
|
assert_raises "exec_on $HOST1 c1 dig MX seetwo.weave.local | grep -q \"status: NXDOMAIN\""
|
||||||
assert_dns_status $HOST1 c1 "AAAA seetwo.weave.local" NXDOMAIN
|
|
||||||
|
|
||||||
end_suite
|
end_suite
|
||||||
@@ -88,18 +88,6 @@ exec_on() {
|
|||||||
docker -H tcp://$host:2375 exec $container "$@"
|
docker -H tcp://$host:2375 exec $container "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
dig_on() {
|
|
||||||
host=$1
|
|
||||||
cont=$2
|
|
||||||
query=$3
|
|
||||||
docker -H tcp://$host:2375 exec $cont sh -c "dig $query"
|
|
||||||
}
|
|
||||||
|
|
||||||
# assert_dns_status <host> <container> <name> <query> <status>
|
|
||||||
assert_dns_status() {
|
|
||||||
assert_raises "dig_on \"$1\" \"$2\" \"$3\" | grep -q \"status: $4\""
|
|
||||||
}
|
|
||||||
|
|
||||||
# assert_dns_record <host> <container> <name> <ip>
|
# assert_dns_record <host> <container> <name> <ip>
|
||||||
assert_dns_record() {
|
assert_dns_record() {
|
||||||
assert "exec_on $1 $2 getent hosts $3 | tr -s ' '" "$4 $3"
|
assert "exec_on $1 $2 getent hosts $3 | tr -s ' '" "$4 $3"
|
||||||
|
|||||||
Reference in new issue
Block a user