]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: split last into dns and nodns subtests
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 11 Jun 2014 17:22:41 +0000 (19:22 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 11 Jun 2014 23:09:35 +0000 (01:09 +0200)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/expected/utmp/last-dns [new file with mode: 0644]
tests/expected/utmp/last-ipv6-dns [moved from tests/expected/utmp/last-ipv6 with 59% similarity]
tests/expected/utmp/last-ipv6-nodns [new file with mode: 0644]
tests/expected/utmp/last-nodns [moved from tests/expected/utmp/last with 95% similarity]
tests/ts/utmp/last
tests/ts/utmp/last-ipv6

diff --git a/tests/expected/utmp/last-dns b/tests/expected/utmp/last-dns
new file mode 100644 (file)
index 0000000..34012c7
--- /dev/null
@@ -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
similarity index 59%
rename from tests/expected/utmp/last-ipv6
rename to tests/expected/utmp/last-ipv6-dns
index 5be77298a166c5aed217dfd38ce5a3fe5c2b0b06..aa53a6451d4dff0d974f08fbaeff12a3c797e86d 100644 (file)
@@ -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 (file)
index 0000000..65d422a
--- /dev/null
@@ -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
similarity index 95%
rename from tests/expected/utmp/last
rename to tests/expected/utmp/last-nodns
index 2958152bc320309ceacf06dd447aa9ba4057e4e4..cb7cfde09b73c6f65178e0cb2b412c31e27d01c2 100644 (file)
@@ -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
index 1d813b85fc51664ba9465498e60df6c66639f06c..19de4ab289a0244ae03ef58015275de0516f6d8d 100755 (executable)
@@ -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
 
index 89b0e83289daa637661b9e3c6d051c0603aadcc7..17e65e7bfccd10e6145ac17a342dbb72612b65c1 100755 (executable)
@@ -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