summaryrefslogtreecommitdiffstats
path: root/tests/ts/utmp
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/utmp
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/utmp')
-rwxr-xr-xtests/ts/utmp/last5
-rwxr-xr-xtests/ts/utmp/last-ipv65
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/ts/utmp/last b/tests/ts/utmp/last
index 19de4ab28..64b9b8c20 100755
--- a/tests/ts/utmp/last
+++ b/tests/ts/utmp/last
@@ -37,7 +37,10 @@ else
|| ts_skip "can't create test data"
fi
+# there is no better way yet to skip a subtest
+if ts_resolve_host "a.root-servers.net" >/dev/null; then
ts_init_subtest "dns"
+
ts_log "~~~ dns short ~~~"
$TS_CMD_LAST -f $WTMP_FILE -d root >> $TS_OUTPUT 2>/dev/null
@@ -46,7 +49,9 @@ $TS_CMD_LAST -f $WTMP_FILE -w -d root >> $TS_OUTPUT 2>/dev/null
ts_log "~~~ dns host last ~~~"
$TS_CMD_LAST -f $WTMP_FILE -a -d root >> $TS_OUTPUT 2>/dev/null
+
ts_finalize_subtest
+fi
ts_init_subtest "nodns"
ts_log "~~~ basic output ~~~"
diff --git a/tests/ts/utmp/last-ipv6 b/tests/ts/utmp/last-ipv6
index 17e65e7bf..d4a96457e 100755
--- a/tests/ts/utmp/last-ipv6
+++ b/tests/ts/utmp/last-ipv6
@@ -37,7 +37,10 @@ else
|| ts_skip "can't create test data"
fi
+# there is no better way yet to skip a subtest
+if ts_resolve_host "a.root-servers.net" >/dev/null; then
ts_init_subtest "dns"
+
ts_log "~~~ dns short ~~~"
$TS_CMD_LAST -f $WTMP_FILE -d >> $TS_OUTPUT 2>/dev/null
@@ -46,7 +49,9 @@ $TS_CMD_LAST -f $WTMP_FILE -d -w >> $TS_OUTPUT 2>/dev/null
ts_log "~~~ dns host last ~~~"
$TS_CMD_LAST -f $WTMP_FILE -d -a >> $TS_OUTPUT 2>/dev/null
+
ts_finalize_subtest
+fi
ts_init_subtest "nodns"
ts_log "~~~ show ip ~~~"