From ad34a56e5678cb27bbae35e70abb4098d4c2c2f4 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sat, 16 May 2015 02:07:57 +0100 Subject: [PATCH] simplify NXDOMAIN test - remove premature abstraction - only do one check --- test/200_dns_test.sh | 3 +-- test/config.sh | 12 ------------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/test/200_dns_test.sh b/test/200_dns_test.sh index b0717349..c2fca822 100755 --- a/test/200_dns_test.sh +++ b/test/200_dns_test.sh @@ -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_status $HOST1 c1 "MX seetwo.weave.local" NXDOMAIN -assert_dns_status $HOST1 c1 "AAAA seetwo.weave.local" NXDOMAIN +assert_raises "exec_on $HOST1 c1 dig MX seetwo.weave.local | grep -q \"status: NXDOMAIN\"" end_suite diff --git a/test/config.sh b/test/config.sh index 72fd59d1..49765726 100644 --- a/test/config.sh +++ b/test/config.sh @@ -88,18 +88,6 @@ exec_on() { 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 -assert_dns_status() { - assert_raises "dig_on \"$1\" \"$2\" \"$3\" | grep -q \"status: $4\"" -} - # assert_dns_record assert_dns_record() { assert "exec_on $1 $2 getent hosts $3 | tr -s ' '" "$4 $3"