diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 478420e0..4103dcf8 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -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() { diff --git a/test-case/verify-sof-firmware-load.sh b/test-case/verify-sof-firmware-load.sh index e330ef75..e18d8287 100755 --- a/test-case/verify-sof-firmware-load.sh +++ b/test-case/verify-sof-firmware-load.sh @@ -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