Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kpatch-test: add dmesg entry at start of test #1383

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
kpatch-test: add dmesg entry at start of test
If the kernel log is empty prior to running the integration tests, the
following confusing status may be reported:

  ...
  ERROR: dmesg overflow, try increasing kernel log buffer size
  SUCCESS

This occurs because the script can't find an empty dmesg entry when the
tests are complete.  Copy the upstream kernel livepatching kselftests to
fix this by logging a canary message at the beginning of the integration
tests.  This will ensure a "real" message than can be found at the end.

Fixes: de1d0c6 ("kpatch-test: don't clear dmesg during test")
Signed-off-by: Joe Lawrence <[email protected]>
  • Loading branch information
joe-lawrence committed Mar 25, 2024
commit 796872f9f3b406c0f5d1bddb9d4b449caf63a488
5 changes: 3 additions & 2 deletions test/integration/kpatch-test
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,13 @@ run_combined_test() {

# save existing dmesg so we can detect new content
save_dmesg() {
SAVED_DMESG="$(dmesg | tail -n1)"
SAVED_DMESG="kpatch-test timestamp: $(date --rfc-3339=ns)"
echo "$SAVED_DMESG" > /dev/kmsg
}

# new dmesg entries since our saved entry
new_dmesg() {
if ! dmesg | awk -v last="$SAVED_DMESG" 'p; $0 == last{p=1} END {exit !p}'; then
if ! dmesg --notime | awk -v last="$SAVED_DMESG" 'p; $0 == last{p=1} END {exit !p}'; then
error "dmesg overflow, try increasing kernel log buffer size"
fi
}
Expand Down
Loading