]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: check last(1) and utmpdump(1) IPv6 functionality
authorSami Kerola <kerolasa@iki.fi>
Thu, 29 Aug 2013 09:56:47 +0000 (10:56 +0100)
committerSami Kerola <kerolasa@iki.fi>
Thu, 29 Aug 2013 17:14:10 +0000 (18:14 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests/expected/last/ipv6 [new file with mode: 0644]
tests/expected/utmpdump/ipv6tobin [new file with mode: 0644]
tests/expected/utmpdump/ipv6totxt [new file with mode: 0644]
tests/ts/last/ipv6 [new file with mode: 0755]
tests/ts/last/ipv6-input [new file with mode: 0644]
tests/ts/utmpdump/ipv6bin [new file with mode: 0644]
tests/ts/utmpdump/ipv6tobin [new file with mode: 0755]
tests/ts/utmpdump/ipv6totxt [new file with mode: 0755]
tests/ts/utmpdump/ipv6txt [new file with mode: 0644]

diff --git a/tests/expected/last/ipv6 b/tests/expected/last/ipv6
new file mode 100644 (file)
index 0000000..0fa234c
--- /dev/null
@@ -0,0 +1,20 @@
+~~~ dns short ~~~
+IPv6     root         a.root-servers.n Wed Aug 28 20:30 - 20:40  (00:10)
+
+ipv6-input begins Wed Aug 28 20:30:40 2013
+~~~ dns long ~~~
+IPv6     root         a.root-servers.net Wed Aug 28 20:30 - 20:40  (00:10)
+
+ipv6-input begins Wed Aug 28 20:30:40 2013
+~~~ dns host last ~~~
+IPv6     root         Wed Aug 28 20:30 - 20:40  (00:10)     a.root-servers.net
+
+ipv6-input 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)
+
+ipv6-input 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
+
+ipv6-input begins Wed Aug 28 20:30:40 2013
diff --git a/tests/expected/utmpdump/ipv6tobin b/tests/expected/utmpdump/ipv6tobin
new file mode 100644 (file)
index 0000000..342553b
Binary files /dev/null and b/tests/expected/utmpdump/ipv6tobin differ
diff --git a/tests/expected/utmpdump/ipv6totxt b/tests/expected/utmpdump/ipv6totxt
new file mode 100644 (file)
index 0000000..5cce150
--- /dev/null
@@ -0,0 +1,2 @@
+[7] [00010] [ipv6] [IPv6    ] [root        ] [dns-server          ] [2001:503:ba3e::2:30] [Wed Aug 28 20:30:40 2013 GMT]
+[8] [00011] [ipv6] [IPv6    ] [root        ] [dns-server          ] [2001:503:ba3e::2:30] [Wed Aug 28 20:40:50 2013 GMT]
diff --git a/tests/ts/last/ipv6 b/tests/ts/last/ipv6
new file mode 100755 (executable)
index 0000000..8e2b01e
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="last ipv6"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+export LANG=C
+export TZ=GMT
+
+>| $TS_OUTPUT
+
+ts_log "~~~ dns short ~~~"
+$TS_CMD_LAST -f $TS_SELF/ipv6-input -d >> $TS_OUTPUT 2>/dev/null
+
+ts_log "~~~ dns long ~~~"
+$TS_CMD_LAST -f $TS_SELF/ipv6-input -d -w >> $TS_OUTPUT 2>/dev/null
+
+ts_log "~~~ dns host last ~~~"
+$TS_CMD_LAST -f $TS_SELF/ipv6-input -d -a >> $TS_OUTPUT 2>/dev/null
+
+ts_log "~~~ show ip ~~~"
+$TS_CMD_LAST -f $TS_SELF/ipv6-input -i >> $TS_OUTPUT 2>/dev/null
+
+ts_log "~~~ show ip last ~~~"
+$TS_CMD_LAST -f $TS_SELF/ipv6-input -i -a >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/last/ipv6-input b/tests/ts/last/ipv6-input
new file mode 100644 (file)
index 0000000..342553b
Binary files /dev/null and b/tests/ts/last/ipv6-input differ
diff --git a/tests/ts/utmpdump/ipv6bin b/tests/ts/utmpdump/ipv6bin
new file mode 100644 (file)
index 0000000..342553b
Binary files /dev/null and b/tests/ts/utmpdump/ipv6bin differ
diff --git a/tests/ts/utmpdump/ipv6tobin b/tests/ts/utmpdump/ipv6tobin
new file mode 100755 (executable)
index 0000000..6de99ad
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="IPv6 to binary"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+export LANG=C
+export TZ=GMT
+$TS_CMD_UTMPDUMP -r $TS_SELF/ipv6txt >| $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/utmpdump/ipv6totxt b/tests/ts/utmpdump/ipv6totxt
new file mode 100755 (executable)
index 0000000..fb81f39
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="IPv6 to text"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+export LANG=C
+export TZ=GMT
+$TS_CMD_UTMPDUMP $TS_SELF/ipv6bin >| $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/utmpdump/ipv6txt b/tests/ts/utmpdump/ipv6txt
new file mode 100644 (file)
index 0000000..fb428d5
--- /dev/null
@@ -0,0 +1,2 @@
+[7] [00010] [ipv6] [IPv6    ] [root        ] [dns-server          ] [2001:503:ba3e::2:30     ] [Wed Aug 28 20:30:40 2013 BST]
+[8] [00011] [ipv6] [IPv6    ] [root        ] [dns-server          ] [2001:503:ba3e::2:30     ] [Wed Aug 28 20:40:50 2013 BST]