diff --git a/test/210_dns_multicast_test.sh b/test/210_dns_multicast_test.sh index bb83cec7..9629c12f 100755 --- a/test/210_dns_multicast_test.sh +++ b/test/210_dns_multicast_test.sh @@ -25,7 +25,6 @@ weave_on $HOST1 run --with-dns $C1/24 --name=c1 -t aanand/docker-dnsutils /bin/s assert_dns_record $HOST1 c1 $NAME $C2 -ok=$(exec_on $HOST1 c1 getent hosts 8.8.8.8) -assert_raises "echo $ok | grep google" +assert_raises "exec_on $HOST1 c1 getent hosts 8.8.8.8 | grep google" end_suite diff --git a/test/300_fallback_dns_test.sh b/test/300_fallback_dns_test.sh index bcaf5f9a..8e665efb 100755 --- a/test/300_fallback_dns_test.sh +++ b/test/300_fallback_dns_test.sh @@ -10,10 +10,7 @@ docker_on $HOST1 rm -f c1 || true weave_on $HOST1 run --with-dns 10.2.1.5/24 --name=c1 -t aanand/docker-dnsutils /bin/sh -ok=$(exec_on $HOST1 c1 host -t mx weave.works) -assert_raises "echo $ok | grep google" - -ok=$(exec_on $HOST1 c1 getent hosts 8.8.8.8) -assert_raises "echo $ok | grep google" +assert_raises "exec_on $HOST1 c1 host -t mx weave.works | grep google" +assert_raises "exec_on $HOST1 c1 getent hosts 8.8.8.8 | grep google" end_suite diff --git a/test/400_weave_local_test.sh b/test/400_weave_local_test.sh index 2658a160..0b198951 100755 --- a/test/400_weave_local_test.sh +++ b/test/400_weave_local_test.sh @@ -11,8 +11,8 @@ assert_raises "docker_on $HOST1 ps | grep weave" 0 docker_on $HOST1 rm -f c1 || true run_on $HOST1 sudo ./weave --local run 10.2.6.5/24 -ti --name=c1 ubuntu -ok=$(exec_on $HOST1 c1 ifconfig | grep ethwe) -assert "test -n \"$ok\" && echo pass" "pass" + +assert_raises "exec_on $HOST1 c1 ifconfig | grep ethwe" docker_on $HOST1 rm -f c1 || true diff --git a/test/config.sh b/test/config.sh index e4950b1e..02656018 100644 --- a/test/config.sh +++ b/test/config.sh @@ -90,10 +90,8 @@ exec_on() { # assert_dns_record assert_dns_record() { - ok=$(exec_on $1 $2 getent hosts $3) - assert "echo $ok" "$4 $3" - ok=$(exec_on $1 $2 getent hosts $4) - assert "echo $ok" "$4 $3" + assert "exec_on $1 $2 getent hosts $3 | tr -s ' '" "$4 $3" + assert "exec_on $1 $2 getent hosts $4 | tr -s ' '" "$4 $3" } start_suite() {