fix silent failure in assert_dns_record test

If the name cannot be resolved, getent fails, which in turn causes
assert_dns_record to just return with a non-zero status at that point,
which causes the whole test to just terminate with a non-zero status,
but no indication whatsoever what had gone wrong.
This commit is contained in:
Matthias Radestock committed 2015-06-09 19:08:59 +01:00
1 parent ca133d6d9b
commit bd364f787e
1 file changed
+1 -2
+1 -2
View File
@@ -124,8 +124,7 @@ assert_dns_record() {
exp_ips_regex=$(echo "$@" | sed -r 's/ /\\\|/g')
[ -z "$DEBUG" ] || greyly echo "Checking whether $name exists at $host:$container"
got_ip=$(exec_on $host $container getent hosts $name)
assert_raises "echo '$got_ip' | grep -q '$exp_ips_regex'"
assert_raises "exec_on $host $container getent hosts $name | grep -q '$exp_ips_regex'"
[ -z "$DEBUG" ] || greyly echo "Checking whether the IPs '$@' exists at $host:$container"
for ip in "$@" ; do