summaryrefslogtreecommitdiffstats
path: root/tests/ts/dmesg
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:42:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:42:50 +0000
commit8cb83eee5a58b1fad74c34094ce3afb9e430b5a4 (patch)
treea9b2e7baeca1be40eb734371e3c8b11b02294497 /tests/ts/dmesg
parentInitial commit. (diff)
downloadutil-linux-8cb83eee5a58b1fad74c34094ce3afb9e430b5a4.tar.xz
util-linux-8cb83eee5a58b1fad74c34094ce3afb9e430b5a4.zip
Adding upstream version 2.33.1.upstream/2.33.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ts/dmesg')
-rwxr-xr-xtests/ts/dmesg/colors28
-rwxr-xr-xtests/ts/dmesg/console-levels30
-rwxr-xr-xtests/ts/dmesg/decode28
-rwxr-xr-xtests/ts/dmesg/delta28
-rwxr-xr-xtests/ts/dmesg/facilities30
-rwxr-xr-xtests/ts/dmesg/indentation40
-rw-r--r--tests/ts/dmesg/input105
-rw-r--r--tests/ts/dmesg/newlines5
8 files changed, 294 insertions, 0 deletions
diff --git a/tests/ts/dmesg/colors b/tests/ts/dmesg/colors
new file mode 100755
index 0000000..156cb1e
--- /dev/null
+++ b/tests/ts/dmesg/colors
@@ -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="colors"
+
+. $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 --color=always -F $TS_SELF/input -x >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/dmesg/console-levels b/tests/ts/dmesg/console-levels
new file mode 100755
index 0000000..f6a64e3
--- /dev/null
+++ b/tests/ts/dmesg/console-levels
@@ -0,0 +1,30 @@
+#!/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="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
+ $TS_HELPER_DMESG -F $TS_SELF/input -l $I >> $TS_OUTPUT 2>/dev/null
+done
+
+ts_finalize
diff --git a/tests/ts/dmesg/decode b/tests/ts/dmesg/decode
new file mode 100755
index 0000000..ada2eac
--- /dev/null
+++ b/tests/ts/dmesg/decode
@@ -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="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 -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/dmesg/delta b/tests/ts/dmesg/delta
new file mode 100755
index 0000000..a0983cc
--- /dev/null
+++ b/tests/ts/dmesg/delta
@@ -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="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 -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null
+
+ts_finalize
diff --git a/tests/ts/dmesg/facilities b/tests/ts/dmesg/facilities
new file mode 100755
index 0000000..d004a4f
--- /dev/null
+++ b/tests/ts/dmesg/facilities
@@ -0,0 +1,30 @@
+#!/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="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
+ $TS_HELPER_DMESG -F $TS_SELF/input -f $I >> $TS_OUTPUT 2>/dev/null
+done
+
+ts_finalize
diff --git a/tests/ts/dmesg/indentation b/tests/ts/dmesg/indentation
new file mode 100755
index 0000000..9952c65
--- /dev/null
+++ b/tests/ts/dmesg/indentation
@@ -0,0 +1,40 @@
+#!/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_HELPER_DMESG"
+
+export TZ="GMT"
+export DMESG_TEST_BOOTIME="1234567890.123456"
+
+$TS_HELPER_DMESG -F $TS_SELF/newlines > $TS_OUTPUT 2>&1
+
+$TS_HELPER_DMESG -F $TS_SELF/newlines -x >> $TS_OUTPUT 2>&1
+
+$TS_HELPER_DMESG --time-format=delta --file $TS_SELF/newlines >> $TS_OUTPUT 2>&1
+
+$TS_HELPER_DMESG --time-format=notime --file $TS_SELF/newlines >> $TS_OUTPUT 2>&1
+
+$TS_HELPER_DMESG --time-format=reltime --file $TS_SELF/newlines >> $TS_OUTPUT 2>&1
+
+$TS_HELPER_DMESG --time-format=ctime --file $TS_SELF/newlines >> $TS_OUTPUT 2>&1
+
+$TS_HELPER_DMESG --time-format=iso --file $TS_SELF/newlines >> $TS_OUTPUT 2>&1
+
+ts_finalize
diff --git a/tests/ts/dmesg/input b/tests/ts/dmesg/input
new file mode 100644
index 0000000..98307df
--- /dev/null
+++ b/tests/ts/dmesg/input
@@ -0,0 +1,105 @@
+<0>[ 0.000000] example[0]
+<1>[ 1.000000] example[1]
+<2>[ 8.000000] example[2]
+<3>[ 27.000000] example[3]
+<4>[ 64.000000] example[4]
+<5>[ 125.000000] example[5]
+<6>[ 216.000000] example[6]
+<7>[ 343.000000] example[7]
+<8>[ 512.000000] example[8]
+<9>[ 729.000000] example[9]
+<10>[ 1000.000000] example[10]
+<11>[ 1331.000000] example[11]
+<12>[ 1728.000000] example[12]
+<13>[ 2197.000000] example[13]
+<14>[ 2744.000000] example[14]
+<15>[ 3375.000000] example[15]
+<16>[ 4096.000000] example[16]
+<17>[ 4913.000000] example[17]
+<18>[ 5832.000000] example[18]
+<19>[ 6859.000000] example[19]
+<20>[ 8000.000000] example[20]
+<21>[ 9261.000000] example[21]
+<22>[10648.000000] example[22]
+<23>[12167.000000] example[23]
+<24>[13824.000000] example[24]
+<25>[15625.000000] example[25]
+<26>[17576.000000] example[26]
+<27>[19683.000000] example[27]
+<28>[21952.000000] example[28]
+<29>[24389.000000] example[29]
+<30>[27000.000000] example[30]
+<31>[29791.000000] example[31]
+<32>[32768.000000] example[32]
+<33>[35937.000000] example[33]
+<34>[39304.000000] example[34]
+<35>[42875.000000] example[35]
+<36>[46656.000000] example[36]
+<37>[50653.000000] example[37]
+<38>[54872.000000] example[38]
+<39>[59319.000000] example[39]
+<40>[64000.000000] example[40]
+<41>[68921.000000] example[41]
+<42>[74088.000000] example[42]
+<43>[79507.000000] example[43]
+<44>[85184.000000] example[44]
+<45>[91125.000000] example[45]
+<46>[97336.000000] example[46]
+<47>[103823.000000] example[47]
+<48>[110592.000000] example[48]
+<49>[117649.000000] example[49]
+<50>[125000.000000] example[50]
+<51>[132651.000000] example[51]
+<52>[140608.000000] example[52]
+<53>[148877.000000] example[53]
+<54>[157464.000000] example[54]
+<55>[166375.000000] example[55]
+<56>[175616.000000] example[56]
+<57>[185193.000000] example[57]
+<58>[195112.000000] example[58]
+<59>[205379.000000] example[59]
+<60>[216000.000000] example[60]
+<61>[226981.000000] example[61]
+<62>[238328.000000] example[62]
+<63>[250047.000000] example[63]
+<64>[262144.000000] example[64]
+<65>[274625.000000] example[65]
+<66>[287496.000000] example[66]
+<67>[300763.000000] example[67]
+<68>[314432.000000] example[68]
+<69>[328509.000000] example[69]
+<70>[343000.000000] example[70]
+<71>[357911.000000] example[71]
+<72>[373248.000000] example[72]
+<73>[389017.000000] example[73]
+<74>[405224.000000] example[74]
+<75>[421875.000000] example[75]
+<76>[438976.000000] example[76]
+<77>[456533.000000] example[77]
+<78>[474552.000000] example[78]
+<79>[493039.000000] example[79]
+<80>[512000.000000] example[80]
+<81>[531441.000000] example[81]
+<82>[551368.000000] example[82]
+<83>[571787.000000] example[83]
+<84>[592704.000000] example[84]
+<85>[614125.000000] example[85]
+<86>[636056.000000] example[86]
+<87>[658503.000000] example[87]
+<88>[681472.000000] example[88]
+<89>[704969.000000] example[89]
+<90>[729000.000000] example[90]
+<91>[753571.000000] example[91]
+<92>[778688.000000] example[92]
+<93>[804357.000000] example[93]
+<94>[830584.000000] example[94]
+<95>[857375.000000] example[95]
+<96>[884736.000000] example[96]
+<97>[912673.000000] example[97]
+<98>[941192.000000] example[98]
+<99>[970299.000000] example[99]
+<100>[1000000.000000] example[100]
+<101>[1030301.000000] example[101]
+<102>[1061208.000000] example[102]
+<103>[1092727.000000] example[103]
+<104>[1124864.000000] example[104]
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