summaryrefslogtreecommitdiffstats
path: root/sys-utils/dmesg.c
diff options
context:
space:
mode:
authorSami Kerola2015-03-23 00:05:28 +0100
committerKarel Zak2015-03-23 10:34:49 +0100
commit5fac518cefdba5c06829be187cefa3e904a7e1b3 (patch)
tree62686b68308c2ecd352d13303a19252db56629cf /sys-utils/dmesg.c
parenttests: add dmesg multiline message check (diff)
downloadkernel-qcow2-util-linux-5fac518cefdba5c06829be187cefa3e904a7e1b3.tar.gz
kernel-qcow2-util-linux-5fac518cefdba5c06829be187cefa3e904a7e1b3.tar.xz
kernel-qcow2-util-linux-5fac518cefdba5c06829be187cefa3e904a7e1b3.zip
tests: add test_dmesg that has fixed boot time
This allows testing time stamp formats. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/dmesg.c')
-rw-r--r--sys-utils/dmesg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index b56199f36..a17cc70af 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -1378,8 +1378,13 @@ int main(int argc, char *argv[])
is_timefmt(&ctl, CTIME) ||
is_timefmt(&ctl, ISO8601)) {
+#ifdef TEST_DMESG
+ ctl.boot_time.tv_sec = 1234567890;
+ ctl.boot_time.tv_usec = 123456;
+#else
if (get_boot_time(&ctl.boot_time) != 0)
ctl.time_fmt = DMESG_TIMEFTM_NONE;
+#endif
}
if (delta)