diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 0fa1e6ad7..3d84e53b9 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -177,6 +177,20 @@ find_ldc_file() printf '%s' "$ldcFile" } +# -B 2 shows the header line when the first etrace message is an ERROR +# -A 1 shows whether the ERROR is last or not. +check_logger_error() +{ + test -r "$1" || { + dloge "logfile NOT FOUND: '$1'" + return 1 + } + + if grep -B 2 -A 1 -E '[[:blank:]]ERRO?R?[[:blank:]]' "$1"; then + return 1 + fi +} + SOF_LOG_COLLECT=0 # This function starts a logger in the background using '&' # diff --git a/test-case/check-sof-logger.sh b/test-case/check-sof-logger.sh index db3d42d38..3440e6060 100755 --- a/test-case/check-sof-logger.sh +++ b/test-case/check-sof-logger.sh @@ -94,6 +94,7 @@ run_loggers() if is_zephyr; then dlogi "Skipping etrace for now because it's totally different with Zephyr" + sudo touch "$etrace_stderr_file" "$etrace_file" return 0 fi @@ -224,8 +225,31 @@ main() } done + local platf; platf=$(sof-dump-status.py -p) + local ERROR_scan=true + local OK=true + + case "$platf" in + byt|bdw) + dlogw 'not looking for ERROR on BYT/BDW because of known DMA issues #4333 and others' + ERROR_scan=false + ;; + esac + + if $ERROR_scan; then + for f in "${stdout_files[@]}"; do + local tracef="$LOG_ROOT/logger.$f.txt" + check_logger_error "$tracef" || { + OK=false; printf '\n' + } + done; fi + # Show all outputs even when everything went OK - print_logs_exit 0 + if $OK; then + print_logs_exit 0 + else + print_logs_exit 1 "^^ ERROR(s) found in firmware logs ^^" + fi } main "$@"