]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add utmpdump(1) check
authorSami Kerola <kerolasa@iki.fi>
Sat, 19 Jan 2013 00:08:52 +0000 (00:08 +0000)
committerKarel Zak <kzak@redhat.com>
Thu, 24 Jan 2013 15:49:27 +0000 (16:49 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests/commands.sh
tests/expected/utmpdump/to-binary [new file with mode: 0644]
tests/expected/utmpdump/to-text [new file with mode: 0644]
tests/ts/utmpdump/binary [new file with mode: 0644]
tests/ts/utmpdump/text [new file with mode: 0644]
tests/ts/utmpdump/to-binary [new file with mode: 0755]
tests/ts/utmpdump/to-text [new file with mode: 0755]

index f1643a685f07addc06e7ee57172837eccf9998e5..73725c9f8959716dec39c3306645a7efeb31ddad 100644 (file)
@@ -64,3 +64,5 @@ TS_CMD_FINDMNT=${TS_CMD_FINDMNT-"$top_builddir/findmnt"}
 TS_CMD_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk"}
 
 TS_CMD_HEXDUMP=${TS_CMD_HEXDUMP-"$top_builddir/hexdump"}
+
+TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"$top_builddir/utmpdump"}
diff --git a/tests/expected/utmpdump/to-binary b/tests/expected/utmpdump/to-binary
new file mode 100644 (file)
index 0000000..45d35bb
Binary files /dev/null and b/tests/expected/utmpdump/to-binary differ
diff --git a/tests/expected/utmpdump/to-text b/tests/expected/utmpdump/to-text
new file mode 100644 (file)
index 0000000..02fb22d
--- /dev/null
@@ -0,0 +1,10 @@
+[7] [17058] [ts/1] [kerolasa] [pts/1       ] [:0.0                ] [0.0.0.0        ] [Wed Jan 16 23:44:09 2013 GMT]
+[7] [22098] [ts/2] [kerolasa] [pts/2       ] [:0.0                ] [0.0.0.0        ] [Wed Jan 16 23:49:17 2013 GMT]
+[7] [24915] [ts/3] [kerolasa] [pts/3       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 12:23:33 2013 GMT]
+[8] [24915] [ts/3] [kerolasa] [pts/3       ] [                    ] [0.0.0.0        ] [Thu Jan 17 12:24:49 2013 GMT]
+[7] [30629] [ts/3] [kerolasa] [pts/3       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 13:12:39 2013 GMT]
+[8] [30629] [ts/3] [kerolasa] [pts/3       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:19 2013 GMT]
+[8] [22098] [ts/2] [kerolasa] [pts/2       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:48 2013 GMT]
+[8] [17058] [ts/1] [kerolasa] [pts/1       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:48 2013 GMT]
+[7] [31545] [ts/1] [kerolasa] [pts/1       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 20:17:21 2013 GMT]
+[7] [28496] [ts/2] [kerolasa] [pts/2       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 21:09:39 2013 GMT]
diff --git a/tests/ts/utmpdump/binary b/tests/ts/utmpdump/binary
new file mode 100644 (file)
index 0000000..45d35bb
Binary files /dev/null and b/tests/ts/utmpdump/binary differ
diff --git a/tests/ts/utmpdump/text b/tests/ts/utmpdump/text
new file mode 100644 (file)
index 0000000..02fb22d
--- /dev/null
@@ -0,0 +1,10 @@
+[7] [17058] [ts/1] [kerolasa] [pts/1       ] [:0.0                ] [0.0.0.0        ] [Wed Jan 16 23:44:09 2013 GMT]
+[7] [22098] [ts/2] [kerolasa] [pts/2       ] [:0.0                ] [0.0.0.0        ] [Wed Jan 16 23:49:17 2013 GMT]
+[7] [24915] [ts/3] [kerolasa] [pts/3       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 12:23:33 2013 GMT]
+[8] [24915] [ts/3] [kerolasa] [pts/3       ] [                    ] [0.0.0.0        ] [Thu Jan 17 12:24:49 2013 GMT]
+[7] [30629] [ts/3] [kerolasa] [pts/3       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 13:12:39 2013 GMT]
+[8] [30629] [ts/3] [kerolasa] [pts/3       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:19 2013 GMT]
+[8] [22098] [ts/2] [kerolasa] [pts/2       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:48 2013 GMT]
+[8] [17058] [ts/1] [kerolasa] [pts/1       ] [                    ] [0.0.0.0        ] [Thu Jan 17 13:42:48 2013 GMT]
+[7] [31545] [ts/1] [kerolasa] [pts/1       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 20:17:21 2013 GMT]
+[7] [28496] [ts/2] [kerolasa] [pts/2       ] [:0.0                ] [0.0.0.0        ] [Thu Jan 17 21:09:39 2013 GMT]
diff --git a/tests/ts/utmpdump/to-binary b/tests/ts/utmpdump/to-binary
new file mode 100755 (executable)
index 0000000..25acbf6
--- /dev/null
@@ -0,0 +1,23 @@
+#!/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="to-binary"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_UTMPDUMP -r $TS_SELF/text >| $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/utmpdump/to-text b/tests/ts/utmpdump/to-text
new file mode 100755 (executable)
index 0000000..f454e5f
--- /dev/null
@@ -0,0 +1,23 @@
+#!/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="to-text"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_UTMPDUMP $TS_SELF/binary >| $TS_OUTPUT 2>/dev/null
+
+ts_finalize