summaryrefslogtreecommitdiffstats
path: root/tests/ts/dmesg
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
commit1272be04be0cb803eec87f602edb2e3e6f111aea (patch)
treebce17f6478cdd9f3c4ec3d751135dc42786d6a56 /tests/ts/dmesg
parentReleasing progress-linux version 2.39.3-11~progress7.99u1. (diff)
downloadutil-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.tar.xz
util-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ts/dmesg')
-rw-r--r--tests/ts/dmesg/cid-input106
-rwxr-xr-xtests/ts/dmesg/cid-json28
-rwxr-xr-xtests/ts/dmesg/cid-kmsg-colors34
-rwxr-xr-xtests/ts/dmesg/cid-kmsg-console-levels49
-rwxr-xr-xtests/ts/dmesg/cid-kmsg-decode33
-rwxr-xr-xtests/ts/dmesg/cid-kmsg-delta33
-rwxr-xr-xtests/ts/dmesg/cid-kmsg-facilities36
-rwxr-xr-xtests/ts/dmesg/cid-kmsg-indentation45
-rw-r--r--tests/ts/dmesg/cid-kmsg-inputbin0 -> 5464 bytes
-rwxr-xr-xtests/ts/dmesg/cid-kmsg-json28
-rwxr-xr-xtests/ts/dmesg/cid-kmsg-limit34
-rw-r--r--tests/ts/dmesg/cid-kmsg-newlinesbin0 -> 152 bytes
-rw-r--r--tests/ts/dmesg/input1
-rwxr-xr-xtests/ts/dmesg/json28
-rwxr-xr-xtests/ts/dmesg/kmsg-file28
-rw-r--r--tests/ts/dmesg/kmsg-inputbin0 -> 3944 bytes
-rwxr-xr-xtests/ts/dmesg/timestamp-format42
17 files changed, 525 insertions, 0 deletions
diff --git a/tests/ts/dmesg/cid-input b/tests/ts/dmesg/cid-input
new file mode 100644
index 0000000..7dbd89d
--- /dev/null
+++ b/tests/ts/dmesg/cid-input
@@ -0,0 +1,106 @@
+<0>[ 0.000000] [ T0] example[0]
+<1>[ 1.000000] [ T1] example[1]
+<2>[ 8.000000] [ T2] example[2]
+<3>[ 27.000000] [ T3] example[3]
+<4>[ 64.000000] [ T4] example[4]
+<5>[ 125.000000] [ T5] example[5]
+<6>[ 216.000000] [ T6] example[6]
+<7>[ 343.000000] [ T7] example[7]
+<8>[ 512.000000] [ T8] example[8]
+<9>[ 729.000000] [ T9] example[9]
+<10>[ 1000.000000] [ T10] example[10]
+<11>[ 1331.000000] [ T11] example[11]
+<12>[ 1728.000000] [ T12] example[12]
+<13>[ 2197.000000] [ T13] example[13]
+<14>[ 2744.000000] [ T14] example[14]
+<15>[ 3375.000000] [ T15] example[15]
+<16>[ 4096.000000] [ T16] example[16]
+<17>[ 4913.000000] [ T17] example[17]
+<18>[ 5832.000000] [ T18] example[18]
+<19>[ 6859.000000] [ T19] example[19]
+<20>[ 8000.000000] [ T20] example[20]
+<21>[ 9261.000000] [ T21] example[21]
+<22>[10648.000000] [ T22] example[22]
+<23>[12167.000000] [ T23] example[23]
+<24>[13824.000000] [ T24] example[24]
+<25>[15625.000000] [ T25] example[25]
+<26>[17576.000000] [ T26] example[26]
+<27>[19683.000000] [ T27] example[27]
+<28>[21952.000000] [ T28] example[28]
+<29>[24389.000000] [ T29] example[29]
+<30>[27000.000000] [ T10] example[30]
+<31>[29791.000000] [ T31] example[31]
+<32>[32768.000000] [ T32] example[32]
+<33>[35937.000000] [ T33] example[33]
+<34>[39304.000000] [ T34] example[34]
+<35>[42875.000000] [ T35] example[35]
+<36>[46656.000000] [ T36] example[36]
+<37>[50653.000000] [ T37] example[37]
+<38>[54872.000000] [ T38] example[38]
+<39>[59319.000000] [ T39] example[39]
+<40>[64000.000000] [ T40] example[40]
+<41>[68921.000000] [ T41] example[41]
+<42>[74088.000000] [ T42] example[42]
+<43>[79507.000000] [ T43] example[43]
+<44>[85184.000000] [ T44] example[44]
+<45>[91125.000000] [ T45] example[45]
+<46>[97336.000000] [ T46] example[46]
+<47>[103823.000000] [ T47] example[47]
+<48>[110592.000000] [ T48] example[48]
+<49>[117649.000000] [ T49] example[49]
+<50>[125000.000000] [ T50] example[50]
+<51>[132651.000000] [ T51] example[51]
+<52>[140608.000000] [ T52] example[52]
+<53>[148877.000000] [ T53] example[53]
+<54>[157464.000000] [ T54] example[54]
+<55>[166375.000000] [ T55] example[55]
+<56>[175616.000000] [ T56] example[56]
+<57>[185193.000000] [ T57] example[57]
+<58>[195112.000000] [ T58] example[58]
+<59>[205379.000000] [ T59] example[59]
+<60>[216000.000000] [ T60] example[60]
+<61>[226981.000000] [ T61] example[61]
+<62>[238328.000000] [ T62] example[62]
+<63>[250047.000000] [ T63] example[63]
+<64>[262144.000000] [ T64] example[64]
+<65>[274625.000000] [ T65] example[65]
+<66>[287496.000000] [ T66] example[66]
+<67>[300763.000000] [ T67] example[67]
+<68>[314432.000000] [ T68] example[68]
+<69>[328509.000000] [ T69] example[69]
+<70>[343000.000000] [ T70] example[70]
+<71>[357911.000000] [ T71] example[71]
+<72>[373248.000000] [ T72] example[72]
+<73>[389017.000000] [ T73] example[73]
+<74>[405224.000000] [ T74] example[74]
+<75>[421875.000000] [ T75] example[75]
+<76>[438976.000000] [ T76] example[76]
+<77>[456533.000000] [ T77] example[77]
+<78>[474552.000000] [ T78] example[78]
+<79>[493039.000000] [ T79] example[79]
+<80>[512000.000000] [ T80] example[80]
+<81>[531441.000000] [ T81] example[81]
+<82>[551368.000000] [ T82] example[82]
+<83>[571787.000000] [ T83] example[83]
+<84>[592704.000000] [ T84] example[84]
+<85>[614125.000000] [ T85] example[85]
+<86>[636056.000000] [ T86] example[86]
+<87>[658503.000000] [ T87] example[87]
+<88>[681472.000000] [ T88] example[88]
+<89>[704969.000000] [ T89] example[89]
+<90>[729000.000000] [ T90] example[90]
+<91>[753571.000000] [ T91] example[91]
+<92>[778688.000000] [ T92] example[92]
+<93>[804357.000000] [ T93] example[93]
+<94>[830584.000000] [ T94] example[94]
+<95>[857375.000000] [ T95] example[95]
+<96>[884736.000000] [ T96] example[96]
+<97>[912673.000000] [ T97] example[97]
+<98>[941192.000000] [ T98] example[98]
+<99>[970299.000000] [ T99] example[99]
+<100>[1000000.000000] [ T100] example[100]
+<101>[1030301.000000] [ T101] example[101]
+<102>[1061208.000000] [ T102] example[102]
+<103>[1092727.000000] [ T103] example[103]
+<104>[1124864.000000] [ T104] example[104]
+<150>[4557523.000000] [ T105] example[105]
diff --git a/tests/ts/dmesg/cid-json b/tests/ts/dmesg/cid-json
new file mode 100755
index 0000000..7836379
--- /dev/null
+++ b/tests/ts/dmesg/cid-json
@@ -0,0 +1,28 @@
+#!/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="cid-json"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -J -F $TS_SELF/cid-input >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-colors b/tests/ts/dmesg/cid-kmsg-colors
new file mode 100755
index 0000000..b94e8a9
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-colors
@@ -0,0 +1,34 @@
+#!/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="cid-kmsg-colors"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+ts_inhibit_custom_colorscheme
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG --color=always -K $TS_SELF/cid-kmsg-input -x >> $TS_OUTPUT 2>/dev/null
+
+# dmesg kmsg output can have varying number of caller_id padding spaces
+# normalize caller_id padding by removing leading spaces
+sed -i 's/\[ *T/\[T/g' $TS_OUTPUT
+sed -i 's/\[ *C/\[C/g' $TS_OUTPUT
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-console-levels b/tests/ts/dmesg/cid-kmsg-console-levels
new file mode 100755
index 0000000..19d8004
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-console-levels
@@ -0,0 +1,49 @@
+#!/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="cid-kmsg-levels"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+for I in {-1..8}; do
+ echo "Display console level: $I" >> $TS_OUTPUT
+ $TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-input -l $I >> $TS_OUTPUT 2>/dev/null
+done
+
+echo "Display console level: err+" >> $TS_OUTPUT
+$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-input -l err+ >> $TS_OUTPUT 2>/dev/null
+echo "Display console level: emerg+" >> $TS_OUTPUT
+$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-input -l emerg+ >> $TS_OUTPUT 2>/dev/null
+echo "Display console level: +err" >> $TS_OUTPUT
+$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-input -l +err >> $TS_OUTPUT 2>/dev/null
+echo "Display console level: +debug" >> $TS_OUTPUT
+$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-input -l +debug >> $TS_OUTPUT 2>/dev/null
+echo "Display console level: debug" >> $TS_OUTPUT
+$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-input -l debug >> $TS_OUTPUT 2>/dev/null
+echo "Display console level: + (invalid)" >> $TS_OUTPUT
+$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-input -l + 2>> $TS_OUTPUT >/dev/null
+
+# dmesg kmsg output can have varying number of caller_id padding spaces
+# normalize caller_id padding by removing leading spaces
+sed -i 's/\[ *T/\[T/g' $TS_OUTPUT
+sed -i 's/\[ *C/\[C/g' $TS_OUTPUT
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-decode b/tests/ts/dmesg/cid-kmsg-decode
new file mode 100755
index 0000000..b920997
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-decode
@@ -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="cid-kmsg-decode"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -x -K $TS_SELF/cid-kmsg-input >> $TS_OUTPUT 2>/dev/null
+
+# dmesg kmsg output can have varying number of caller_id padding spaces
+# normalize caller_id padding by removing leading spaces
+sed -i 's/\[ *T/\[T/g' $TS_OUTPUT
+sed -i 's/\[ *C/\[C/g' $TS_OUTPUT
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-delta b/tests/ts/dmesg/cid-kmsg-delta
new file mode 100755
index 0000000..1b5f572
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-delta
@@ -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="cid-kmsg-delta"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -d -K $TS_SELF/cid-kmsg-input >> $TS_OUTPUT 2>/dev/null
+
+# dmesg kmsg output can have varying number of caller_id padding spaces
+# normalize caller_id padding by removing leading spaces
+sed -i 's/\[ *T/\[T/g' $TS_OUTPUT
+sed -i 's/\[ *C/\[C/g' $TS_OUTPUT
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-facilities b/tests/ts/dmesg/cid-kmsg-facilities
new file mode 100755
index 0000000..38ca9c5
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-facilities
@@ -0,0 +1,36 @@
+#!/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="cid-kmsg-facilities"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+for I in {-1..12}; do
+ echo "Display facility list: $I" >> $TS_OUTPUT
+ $TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-input -f $I -x >> $TS_OUTPUT 2>/dev/null
+done
+
+# dmesg kmsg output can have varying number of caller_id padding spaces
+# normalize caller_id padding by removing leading spaces
+sed -i 's/\[ *T/\[T/g' $TS_OUTPUT
+sed -i 's/\[ *C/\[C/g' $TS_OUTPUT
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-indentation b/tests/ts/dmesg/cid-kmsg-indentation
new file mode 100755
index 0000000..c3f8e06
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-indentation
@@ -0,0 +1,45 @@
+#!/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="cid-kmsg-indentation"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=delta --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=notime --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=reltime --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=ctime --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+$TS_HELPER_DMESG --time-format=iso --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+# dmesg kmsg output can have varying number of caller_id padding spaces
+# normalize caller_id padding by removing leading spaces
+sed -i 's/\[ *T/\[T/g' $TS_OUTPUT
+sed -i 's/\[ *C/\[C/g' $TS_OUTPUT
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-input b/tests/ts/dmesg/cid-kmsg-input
new file mode 100644
index 0000000..2575be8
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-input
Binary files differ
diff --git a/tests/ts/dmesg/cid-kmsg-json b/tests/ts/dmesg/cid-kmsg-json
new file mode 100755
index 0000000..ad1e3e7
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-json
@@ -0,0 +1,28 @@
+#!/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="cid-kmsg-json"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -J -K $TS_SELF/cid-kmsg-input >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-limit b/tests/ts/dmesg/cid-kmsg-limit
new file mode 100755
index 0000000..06f1c8b
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-limit
@@ -0,0 +1,34 @@
+#!/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="cid-kmsg-limit"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG --since @1234567890.124 --until @1234567991 -K $TS_SELF/cid-kmsg-input \
+ >> $TS_OUTPUT 2> $TS_ERRLOG
+
+# dmesg kmsg output can have varying number of caller_id padding spaces
+# normalize caller_id padding by removing leading spaces
+sed -i 's/\[ *T/\[T/g' $TS_OUTPUT
+sed -i 's/\[ *C/\[C/g' $TS_OUTPUT
+
+ts_finalize
diff --git a/tests/ts/dmesg/cid-kmsg-newlines b/tests/ts/dmesg/cid-kmsg-newlines
new file mode 100644
index 0000000..574d217
--- /dev/null
+++ b/tests/ts/dmesg/cid-kmsg-newlines
Binary files differ
diff --git a/tests/ts/dmesg/input b/tests/ts/dmesg/input
index 98307df..bcec23e 100644
--- a/tests/ts/dmesg/input
+++ b/tests/ts/dmesg/input
@@ -103,3 +103,4 @@
<102>[1061208.000000] example[102]
<103>[1092727.000000] example[103]
<104>[1124864.000000] example[104]
+<150>[4557523.000000] example[105]
diff --git a/tests/ts/dmesg/json b/tests/ts/dmesg/json
new file mode 100755
index 0000000..09ed2b0
--- /dev/null
+++ b/tests/ts/dmesg/json
@@ -0,0 +1,28 @@
+#!/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="json"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -J -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/dmesg/kmsg-file b/tests/ts/dmesg/kmsg-file
new file mode 100755
index 0000000..a90a91e
--- /dev/null
+++ b/tests/ts/dmesg/kmsg-file
@@ -0,0 +1,28 @@
+#!/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="kmsg-file"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -J -K $TS_SELF/kmsg-input >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/dmesg/kmsg-input b/tests/ts/dmesg/kmsg-input
new file mode 100644
index 0000000..c08331d
--- /dev/null
+++ b/tests/ts/dmesg/kmsg-input
Binary files differ
diff --git a/tests/ts/dmesg/timestamp-format b/tests/ts/dmesg/timestamp-format
new file mode 100755
index 0000000..feb1ad8
--- /dev/null
+++ b/tests/ts/dmesg/timestamp-format
@@ -0,0 +1,42 @@
+#!/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="timestamp-format"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+ts_init_subtest "multiple"
+$TS_HELPER_DMESG --time-format raw --time-format ctime --time-format iso -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+ts_finalize_subtest
+
+ts_init_subtest "delta"
+$TS_HELPER_DMESG --time-format iso --time-format delta -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+ts_finalize_subtest
+
+ts_init_subtest "delta-ctime"
+$TS_HELPER_DMESG --time-format reltime --time-format delta --time-format ctime -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+ts_finalize_subtest
+
+ts_init_subtest "delta-raw"
+$TS_HELPER_DMESG --time-format raw --time-format ctime --time-format delta -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+ts_finalize_subtest
+
+ts_finalize