From: Sami Kerola Date: Thu, 29 Aug 2013 09:56:47 +0000 (+0100) Subject: tests: check last(1) and utmpdump(1) IPv6 functionality X-Git-Tag: v2.24-rc1~301 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1342426248124fa26cfc1fdc174a677edb43272e;p=thirdparty%2Futil-linux.git tests: check last(1) and utmpdump(1) IPv6 functionality Signed-off-by: Sami Kerola --- diff --git a/tests/expected/last/ipv6 b/tests/expected/last/ipv6 new file mode 100644 index 0000000000..0fa234c1f3 --- /dev/null +++ b/tests/expected/last/ipv6 @@ -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 index 0000000000..342553bb94 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 index 0000000000..5cce1506b0 --- /dev/null +++ b/tests/expected/utmpdump/ipv6totxt @@ -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 index 0000000000..8e2b01e5c6 --- /dev/null +++ b/tests/ts/last/ipv6 @@ -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 index 0000000000..342553bb94 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 index 0000000000..342553bb94 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 index 0000000000..6de99ad1b7 --- /dev/null +++ b/tests/ts/utmpdump/ipv6tobin @@ -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 index 0000000000..fb81f39222 --- /dev/null +++ b/tests/ts/utmpdump/ipv6totxt @@ -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 index 0000000000..fb428d5e0d --- /dev/null +++ b/tests/ts/utmpdump/ipv6txt @@ -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]