]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add dmesg multiline message check
authorSami Kerola <kerolasa@iki.fi>
Sun, 22 Mar 2015 23:05:27 +0000 (23:05 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Mar 2015 09:34:49 +0000 (10:34 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests/expected/dmesg/indentation [new file with mode: 0644]
tests/ts/dmesg/indentation [new file with mode: 0755]
tests/ts/dmesg/newlines [new file with mode: 0644]

diff --git a/tests/expected/dmesg/indentation b/tests/expected/dmesg/indentation
new file mode 100644 (file)
index 0000000..e32d87f
--- /dev/null
@@ -0,0 +1,20 @@
+[    1.000000] new
+               line
+[    2.000000] two
+               new
+               lines
+user  :crit  : [    1.000000] new
+                              line
+mail  :warn  : [    2.000000] two
+                              new
+                              lines
+[<    0.000000>] new
+                 line
+[<    1.000000>] two
+                 new
+                 lines
+new
+line
+two
+new
+lines
diff --git a/tests/ts/dmesg/indentation b/tests/ts/dmesg/indentation
new file mode 100755 (executable)
index 0000000..7419888
--- /dev/null
@@ -0,0 +1,31 @@
+#!/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="indentation"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_DMESG"
+
+$TS_CMD_DMESG -F $TS_SELF/newlines > $TS_OUTPUT 2>&1
+
+$TS_CMD_DMESG -F $TS_SELF/newlines -x >> $TS_OUTPUT 2>&1
+
+$TS_CMD_DMESG --time-format=delta --file $TS_SELF/newlines >> $TS_OUTPUT 2>&1
+
+$TS_CMD_DMESG --time-format=notime --file $TS_SELF/newlines >> $TS_OUTPUT 2>&1
+
+ts_finalize
diff --git a/tests/ts/dmesg/newlines b/tests/ts/dmesg/newlines
new file mode 100644 (file)
index 0000000..6b298c6
--- /dev/null
@@ -0,0 +1,5 @@
+<10>[    1.000000] new
+line
+<20>[    2.000000] two
+new
+lines