summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index 6998343e1..59107b010 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -635,6 +635,12 @@ function ts_resolve_host {
elif type "nslookup" >/dev/null 2>&1; then
tmp=$(nslookup "$host" 2>/dev/null) || return 1
tmp=$(echo "$tmp"| grep -A1 "^Name:"| grep "^Address:"| cut -d" " -f2)
+ elif type "host" >/dev/null 2>&1; then
+ tmp=$(host "$host" 2>/dev/null) || return 1
+ tmp=$(echo "$tmp" | grep " has address " | cut -d " " -f4)
+ elif type "getent" >/dev/null 2>&1; then
+ tmp=$(getent ahosts "$host" 2>/dev/null) || return 1
+ tmp=$(echo "$tmp" | cut -d " " -f 1 | sort -u)
fi
# we return 1 if tmp is empty