From: Ruediger Meier Date: Wed, 11 Jun 2014 17:22:41 +0000 (+0200) Subject: tests: split last into dns and nodns subtests X-Git-Tag: v2.25-rc1~28^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa57e908dad47fea5d7115148ec591c729ae44c6;p=thirdparty%2Futil-linux.git tests: split last into dns and nodns subtests Signed-off-by: Ruediger Meier --- diff --git a/tests/expected/utmp/last-dns b/tests/expected/utmp/last-dns new file mode 100644 index 0000000000..34012c7f12 --- /dev/null +++ b/tests/expected/utmp/last-dns @@ -0,0 +1,12 @@ +~~~ dns short ~~~ +IPv4 root a.root-servers.n Wed Aug 28 13:00 - 14:00 (01:00) + +wtmp-a begins Wed Aug 28 03:00:00 2013 +~~~ dns long ~~~ +IPv4 root a.root-servers.net Wed Aug 28 13:00 - 14:00 (01:00) + +wtmp-a begins Wed Aug 28 03:00:00 2013 +~~~ dns host last ~~~ +IPv4 root Wed Aug 28 13:00 - 14:00 (01:00) a.root-servers.net + +wtmp-a begins Wed Aug 28 03:00:00 2013 diff --git a/tests/expected/utmp/last-ipv6 b/tests/expected/utmp/last-ipv6-dns similarity index 59% rename from tests/expected/utmp/last-ipv6 rename to tests/expected/utmp/last-ipv6-dns index 5be77298a1..aa53a6451d 100644 --- a/tests/expected/utmp/last-ipv6 +++ b/tests/expected/utmp/last-ipv6-dns @@ -10,11 +10,3 @@ wtmp-ipv6 begins Wed Aug 28 20:30:40 2013 IPv6 root Wed Aug 28 20:30 - 20:40 (00:10) a.root-servers.net wtmp-ipv6 begins Wed Aug 28 20:30:40 2013 -~~~ show ip ~~~ -IPv6 root 2001:503:ba3e::2 Wed Aug 28 20:30 - 20:40 (00:10) - -wtmp-ipv6 begins Wed Aug 28 20:30:40 2013 -~~~ show ip last ~~~ -IPv6 root Wed Aug 28 20:30 - 20:40 (00:10) 2001:503:ba3e::2:30 - -wtmp-ipv6 begins Wed Aug 28 20:30:40 2013 diff --git a/tests/expected/utmp/last-ipv6-nodns b/tests/expected/utmp/last-ipv6-nodns new file mode 100644 index 0000000000..65d422a452 --- /dev/null +++ b/tests/expected/utmp/last-ipv6-nodns @@ -0,0 +1,8 @@ +~~~ show ip ~~~ +IPv6 root 2001:503:ba3e::2 Wed Aug 28 20:30 - 20:40 (00:10) + +wtmp-ipv6 begins Wed Aug 28 20:30:40 2013 +~~~ show ip last ~~~ +IPv6 root Wed Aug 28 20:30 - 20:40 (00:10) 2001:503:ba3e::2:30 + +wtmp-ipv6 begins Wed Aug 28 20:30:40 2013 diff --git a/tests/expected/utmp/last b/tests/expected/utmp/last-nodns similarity index 95% rename from tests/expected/utmp/last rename to tests/expected/utmp/last-nodns index 2958152bc3..cb7cfde09b 100644 --- a/tests/expected/utmp/last +++ b/tests/expected/utmp/last-nodns @@ -33,18 +33,6 @@ login foo six Wed Aug 28 06:00 - 07:00 (01:00) user_pro foo seven Wed Aug 28 05:00 - 06:00 (01:00) accounti foo nine Wed Aug 28 03:00 - 04:00 (01:00) -wtmp-a begins Wed Aug 28 03:00:00 2013 -~~~ dns short ~~~ -IPv4 root a.root-servers.n Wed Aug 28 13:00 - 14:00 (01:00) - -wtmp-a begins Wed Aug 28 03:00:00 2013 -~~~ dns long ~~~ -IPv4 root a.root-servers.net Wed Aug 28 13:00 - 14:00 (01:00) - -wtmp-a begins Wed Aug 28 03:00:00 2013 -~~~ dns host last ~~~ -IPv4 root Wed Aug 28 13:00 - 14:00 (01:00) a.root-servers.net - wtmp-a begins Wed Aug 28 03:00:00 2013 ~~~ show ip ~~~ torvalds linux 128.214.205.14 Mon Aug 26 00:57 gone - no logout diff --git a/tests/ts/utmp/last b/tests/ts/utmp/last index 1d813b85fc..19de4ab289 100755 --- a/tests/ts/utmp/last +++ b/tests/ts/utmp/last @@ -37,14 +37,7 @@ else || ts_skip "can't create test data" fi ->| $TS_OUTPUT - -ts_log "~~~ basic output ~~~" -$TS_CMD_LAST -f $WTMP_FILE >> $TS_OUTPUT 2>/dev/null - -ts_log "~~~ include system ~~~" -$TS_CMD_LAST -f $WTMP_FILE -x >> $TS_OUTPUT 2>/dev/null - +ts_init_subtest "dns" ts_log "~~~ dns short ~~~" $TS_CMD_LAST -f $WTMP_FILE -d root >> $TS_OUTPUT 2>/dev/null @@ -53,6 +46,14 @@ $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 + +ts_init_subtest "nodns" +ts_log "~~~ basic output ~~~" +$TS_CMD_LAST -f $WTMP_FILE >> $TS_OUTPUT 2>/dev/null + +ts_log "~~~ include system ~~~" +$TS_CMD_LAST -f $WTMP_FILE -x >> $TS_OUTPUT 2>/dev/null ts_log "~~~ show ip ~~~" $TS_CMD_LAST -f $WTMP_FILE -i torvalds >> $TS_OUTPUT 2>/dev/null @@ -77,6 +78,7 @@ $TS_CMD_LAST -f $WTMP_FILE -s "2013-08-28 02:20" -t "2013-08-28 08:20" >> $TS_OU ts_log "~~~ present ~~~" $TS_CMD_LAST -f $WTMP_FILE -p "2013-08-28 11:20" >> $TS_OUTPUT 2>/dev/null +ts_finalize_subtest rm -f $WTMP_FILE diff --git a/tests/ts/utmp/last-ipv6 b/tests/ts/utmp/last-ipv6 index 89b0e83289..17e65e7bfc 100755 --- a/tests/ts/utmp/last-ipv6 +++ b/tests/ts/utmp/last-ipv6 @@ -37,8 +37,7 @@ else || ts_skip "can't create test data" fi ->| $TS_OUTPUT - +ts_init_subtest "dns" ts_log "~~~ dns short ~~~" $TS_CMD_LAST -f $WTMP_FILE -d >> $TS_OUTPUT 2>/dev/null @@ -47,12 +46,15 @@ $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 +ts_init_subtest "nodns" ts_log "~~~ show ip ~~~" $TS_CMD_LAST -f $WTMP_FILE -i >> $TS_OUTPUT 2>/dev/null ts_log "~~~ show ip last ~~~" $TS_CMD_LAST -f $WTMP_FILE -i -a >> $TS_OUTPUT 2>/dev/null +ts_finalize_subtest rm -f $WTMP_FILE