Util-Linux package development
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH 2/5] tests: add dmesg multiline message check
Date: Sun, 22 Mar 2015 23:05:27 +0000	[thread overview]
Message-ID: <1427065530-10695-3-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1427065530-10695-1-git-send-email-kerolasa@iki.fi>

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 tests/expected/dmesg/indentation | 20 ++++++++++++++++++++
 tests/ts/dmesg/indentation       | 31 +++++++++++++++++++++++++++++++
 tests/ts/dmesg/newlines          |  5 +++++
 3 files changed, 56 insertions(+)
 create mode 100644 tests/expected/dmesg/indentation
 create mode 100755 tests/ts/dmesg/indentation
 create mode 100644 tests/ts/dmesg/newlines

diff --git a/tests/expected/dmesg/indentation b/tests/expected/dmesg/indentation
new file mode 100644
index 0000000..e32d87f
--- /dev/null
+++ b/tests/expected/dmesg/indentation
@@ -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
index 0000000..7419888
--- /dev/null
+++ b/tests/ts/dmesg/indentation
@@ -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
index 0000000..6b298c6
--- /dev/null
+++ b/tests/ts/dmesg/newlines
@@ -0,0 +1,5 @@
+<10>[    1.000000] new
+line
+<20>[    2.000000] two
+new
+lines
-- 
2.3.3


  parent reply	other threads:[~2015-03-22 23:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-22 23:05 [PATCH 0/5] pull: one dmesg compiler warning fix and bunch of tests Sami Kerola
2015-03-22 23:05 ` [PATCH 1/5] dmesg: fix shadow declaration Sami Kerola
2015-03-22 23:05 ` Sami Kerola [this message]
2015-03-22 23:05 ` [PATCH 3/5] tests: add test_dmesg that has fixed boot time Sami Kerola
2015-03-22 23:05 ` [PATCH 4/5] tests: check timestamp formats Sami Kerola
2015-03-22 23:05 ` [PATCH 5/5] tests: check dmesg message coloring Sami Kerola
2015-03-23 10:44 ` [PATCH 0/5] pull: one dmesg compiler warning fix and bunch of tests Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427065530-10695-3-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox