summaryrefslogtreecommitdiffstats
path: root/tests/ts/hwclock
diff options
context:
space:
mode:
authorRuediger Meier2014-06-11 19:28:20 +0200
committerRuediger Meier2014-06-12 01:09:38 +0200
commita98de9696e1a898f925c9154e5693e73aec0779d (patch)
tree88d231109463e10c477298b527672d2dd9153867 /tests/ts/hwclock
parenttests: split last into dns and nodns subtests (diff)
downloadkernel-qcow2-util-linux-a98de9696e1a898f925c9154e5693e73aec0779d.tar.gz
kernel-qcow2-util-linux-a98de9696e1a898f925c9154e5693e73aec0779d.tar.xz
kernel-qcow2-util-linux-a98de9696e1a898f925c9154e5693e73aec0779d.zip
tests: skip some last tests if no dns support
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/hwclock')
-rwxr-xr-xtests/ts/hwclock/systohc20
1 files changed, 1 insertions, 19 deletions
diff --git a/tests/ts/hwclock/systohc b/tests/ts/hwclock/systohc
index ba97ef780..fa7868fc7 100755
--- a/tests/ts/hwclock/systohc
+++ b/tests/ts/hwclock/systohc
@@ -29,24 +29,6 @@ ts_skip_nonroot
ts_check_prog "bc"
ts_check_prog "sntp"
-function resolve_host
-{
- local host="$1"
- local tmp
-
- # currently we just resolve default records (might be "A", ipv4 only)
- if type "dig" >/dev/null 2>&1; then
- tmp=$(dig "$host" +short 2>/dev/null) || return 1
- 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)
- fi
-
- # we return 1 if tmp is empty
- test -n "$tmp" || return 1
- echo "$tmp" | sort -R | head -n 1
-}
-
function get_offset_sys_ntp
{
local ip="$@"
@@ -79,7 +61,7 @@ function check_diff_offset
# we need fixed ntp IP to get comparable offsets
-NTP_IP=$(resolve_host "$NTP_SERVER") \
+NTP_IP=$(ts_resolve_host "$NTP_SERVER") \
|| ts_skip "can't resolve hostname $NTP_SERVER"
OFFSET_A=$(get_offset_sys_ntp "$NTP_IP") \