Commit message amended to: KERNTT-464 Add support to read log from journalctl, so that the log check test can be run on Ubuntu Core systems.
The regex must be modified. Here is an example of WARNING taken from the syslog of a Google n2d-standard-64 instance:
May 7 01:50:37 f-l-gen-s2-n2dstd64-u-boot kernel: [ 181.781750] WARNING: CPU: 58 PID: 3002 at kernel/dma/direct.c:35 report_addr+0x37/0x60
Here is the output of journalctl on this instance:
May 07 01:50:37 f-l-gen-s2-n2dstd64-u-boot kernel: WARNING: CPU: 58 PID: 3002 at kernel/dma/direct.c:35 report_addr+0x37/0x60
I have this code test on this instance by removing /var/log/syslog to force it to use journalctl output and it's failing as expected:
Running 'journalctl -k > /tmp/journalctl-syslog' Checking error message in /tmp/journalctl-syslog: Scanning for pattern "kernel:( \[ *\d+\.\d+\])? BUG:.*" PASSED, log clean. Scanning for pattern "kernel:( \[ *\d+\.\d+\])? Oops:.*" PASSED, log clean. Scanning for pattern "kernel:( \[ *\d+\.\d+\])? kernel BUG at.*" PASSED, log clean. Scanning for pattern "kernel:( \[ *\d+\.\d+\])? WARNING:.*" Pattern found. Matching lines as follows: kernel: WARNING: CPU: 58 PID: 3002 at kernel/dma/direct.c:35 report_addr+0x37/0x60
Applied and pushed, thanks!
« Back to merge proposal
Commit message amended to:
KERNTT-464
Add support to read log from journalctl, so that the log check test can
be run on Ubuntu Core systems.
The regex must be modified. Here is an example of WARNING taken from
the syslog of a Google n2d-standard-64 instance:
May 7 01:50:37 f-l-gen- s2-n2dstd64- u-boot kernel: [ 181.781750] WARNING: CPU: 58 PID: 3002 at kernel/ dma/direct. c:35 report_ addr+0x37/ 0x60
Here is the output of journalctl on this instance:
May 07 01:50:37 f-l-gen- s2-n2dstd64- u-boot kernel: WARNING: CPU: 58 PID: 3002 at kernel/ dma/direct. c:35 report_ addr+0x37/ 0x60
I have this code test on this instance by removing /var/log/syslog to
force it to use journalctl output and it's failing as expected:
Running 'journalctl -k > /tmp/journalctl -syslog' -syslog: dma/direct. c:35 report_ addr+0x37/ 0x60
Checking error message in /tmp/journalctl
Scanning for pattern "kernel:( \[ *\d+\.\d+\])? BUG:.*"
PASSED, log clean.
Scanning for pattern "kernel:( \[ *\d+\.\d+\])? Oops:.*"
PASSED, log clean.
Scanning for pattern "kernel:( \[ *\d+\.\d+\])? kernel BUG at.*"
PASSED, log clean.
Scanning for pattern "kernel:( \[ *\d+\.\d+\])? WARNING:.*"
Pattern found. Matching lines as follows:
kernel: WARNING: CPU: 58 PID: 3002 at kernel/
Applied and pushed, thanks!