Skip to content

Commit

Permalink
Extract new grep_firmware_info_in_logs() from verify-sof-firmware-load
Browse files Browse the repository at this point in the history
Extract new function grep_firmware_info_in_logs() from
verify-sof-firmware-load.sh for re-use in other tests.

Zero functional change.

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb authored and plbossart committed Feb 16, 2022
1 parent d4c8312 commit a73fe26
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 11 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,17 @@ print_module_params()
echo "----------------------------------------"
}

# "$@" is optional, typically: --since=@"$epoch".
# shellcheck disable=SC2120
grep_firmware_info_in_logs()
{
# dump the version info and ABI info
# "head -n" makes this compatible with set -e.
journalctl_cmd "$@" | grep "Firmware info" -A1 | head -n 12
# dump the debug info
journalctl_cmd "$@" | grep "Firmware debug build" -A3 | head -n 12
}

# check if NTP Synchronized, if so return 0 otherwise return 1
check_ntp_sync()
{
Expand Down
6 changes: 2 additions & 4 deletions test-case/verify-sof-firmware-load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ cmd="journalctl_cmd"

dlogi "Checking SOF Firmware load info in kernel log"
if $cmd | grep -q " sof-audio.*Firmware.*version"; then
# dump the version info and ABI info
$cmd | grep "Firmware info" -A1 | head -n 12
# dump the debug info
$cmd | grep "Firmware debug build" -A3 | head -n 12

grep_firmware_info_in_logs
exit 0

else # failed, show some logs
Expand Down

0 comments on commit a73fe26

Please sign in to comment.