| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# This file is part of util-linux. |
| 4 |
# |
| 5 |
# This file is free software; you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation; either version 2 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# This file is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
|
| 15 |
TS_TOPDIR="${0%/*}/../.." |
| 16 |
TS_DESC="cid-kmsg-indentation" |
| 17 |
|
| 18 |
. "$TS_TOPDIR"/functions.sh |
| 19 |
ts_init "$*" |
| 20 |
|
| 21 |
ts_check_test_command "$TS_HELPER_DMESG" |
| 22 |
|
| 23 |
export TZ="GMT" |
| 24 |
export DMESG_TEST_BOOTIME="1234567890.123456" |
| 25 |
|
| 26 |
$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 27 |
|
| 28 |
$TS_HELPER_DMESG -K $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 29 |
|
| 30 |
$TS_HELPER_DMESG --time-format=delta --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 31 |
|
| 32 |
$TS_HELPER_DMESG --time-format=notime --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 33 |
|
| 34 |
$TS_HELPER_DMESG --time-format=reltime --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 35 |
|
| 36 |
$TS_HELPER_DMESG --time-format=ctime --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 37 |
|
| 38 |
$TS_HELPER_DMESG --time-format=iso --kmsg-file $TS_SELF/cid-kmsg-newlines >> $TS_OUTPUT 2>> $TS_ERRLOG |
| 39 |
|
| 40 |
# dmesg kmsg output can have varying number of caller_id padding spaces |
| 41 |
# normalize caller_id padding by removing leading spaces |
| 42 |
sed -i 's/\[ *T/\[T/g' $TS_OUTPUT |
| 43 |
sed -i 's/\[ *C/\[C/g' $TS_OUTPUT |
| 44 |
|
| 45 |
ts_finalize |