summaryrefslogtreecommitdiffstats
path: root/tests/ts/utmp/utmpdump-tobin
diff options
context:
space:
mode:
authorRuediger Meier2014-06-11 17:47:34 +0200
committerRuediger Meier2014-06-11 23:08:49 +0200
commit02229b5519ac77dec26d829c6be14e826d4611bc (patch)
treef5b100eb43d400e30026484adabd0232edcc635b /tests/ts/utmp/utmpdump-tobin
parentutmpdump: fix localtime() error handling (diff)
downloadkernel-qcow2-util-linux-02229b5519ac77dec26d829c6be14e826d4611bc.tar.gz
kernel-qcow2-util-linux-02229b5519ac77dec26d829c6be14e826d4611bc.tar.xz
kernel-qcow2-util-linux-02229b5519ac77dec26d829c6be14e826d4611bc.zip
tests: merge last/ and utmpdump/ into new utmp/ dir
We want to prepare and simplify utmp sepcific fixes. Beside all this renaming we also update/add some text data to have it more consistent. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/utmp/utmpdump-tobin')
-rwxr-xr-xtests/ts/utmp/utmpdump-tobin33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/ts/utmp/utmpdump-tobin b/tests/ts/utmp/utmpdump-tobin
new file mode 100755
index 000000000..9caa8df0b
--- /dev/null
+++ b/tests/ts/utmp/utmpdump-tobin
@@ -0,0 +1,33 @@
+#!/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="${0%/*}/../.."
+TS_DESC="to binary"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_UTMPDUMP"
+
+BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order)
+
+export LANG=C
+export TZ=GMT
+OUTFILE=${TS_OUTDIR}/${TS_TESTNAME}.file
+$TS_CMD_UTMPDUMP -r $TS_SELF/txt-b >| $OUTFILE 2>/dev/null
+if diff -q $TS_SELF/wtmp-b.$BYTE_ORDER $OUTFILE; then
+ echo "no diff"
+fi > $TS_OUTPUT 2>&1
+
+ts_finalize