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

verify-kernel-boot-log: add new detect_log_flood() #1125

Merged
merged 1 commit into from
Nov 7, 2023
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
29 changes: 29 additions & 0 deletions test-case/verify-kernel-boot-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ main()
[ "$(id -un)" = root ] ||
wait_is_system_running --user

detect_log_flood

ntp_check

platform=$(sof-dump-status.py -p)
Expand Down Expand Up @@ -72,6 +74,33 @@ wait_is_system_running()
die "Some services are not running correctly"
}

# Flood usually from gdm3 but keep this function generic
# https://github.com/thesofproject/sof-test/discussions/998
detect_log_flood()
{
local recent_lines
recent_lines=$(sudo journalctl -b --since='1 minute ago' | wc -l)

# Finding a good threshold is difficult because we want this test to
# work both right after boot but also long after.
#
# - A normal boot with sof debug prints roughly ~3,000 lines.
# - The gdm3 infinite crash loop #998 floods ~500 lines/second
# but only after a ~10 seconds delay.
if [ "$recent_lines" -lt 6000 ]; then
return 0
fi

sudo journalctl -b --no-pager --lines=300
printf '\n\n'
sudo journalctl -b -p 3
printf '\n\n'
sudo du -sk /var/log/* | sort -nr | head -n 10
printf '\n\n'

die 'log flood detected!'
}

ntp_check()
{
# Check this device time is NTP Synchronized
Expand Down
Loading