diff --git a/case-lib/hijack.sh b/case-lib/hijack.sh index e47d313d..e7e32a47 100644 --- a/case-lib/hijack.sh +++ b/case-lib/hijack.sh @@ -3,6 +3,9 @@ SUDO_CMD=$(command -v sudo) # Overwrite other functions' exit to perform environment cleanup +# +# TODO: split this into smaller functions that "special" test cases can +# re-use separately instead of all this or nothing. function func_exit_handler() { local exit_status=${1:-0} diff --git a/test-case/verify-kernel-boot-log.sh b/test-case/verify-kernel-boot-log.sh index 72b2843c..d19f5ee3 100755 --- a/test-case/verify-kernel-boot-log.sh +++ b/test-case/verify-kernel-boot-log.sh @@ -18,10 +18,16 @@ set -e # shellcheck source=case-lib/lib.sh source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh -start_test -# TODO: replace start_test with this: -# trap 'print_test_result_exit $?' EXIT -# https://github.com/thesofproject/sof-test/issues/1112 +trap 'boot_log_exit_handler $?' EXIT + +boot_log_exit_handler() +{ + local exit_code=$1 + + journalctl --boot > "$LOG_ROOT"/boot_log.txt + + print_test_result_exit "$exit_code" +} main() {