From 6005a0546516a6fb9e97f7223a618e1d35c9dee6 Mon Sep 17 00:00:00 2001 From: Chao Song Date: Tue, 20 Apr 2021 10:54:10 +0800 Subject: [PATCH 1/2] case-lib: add support for disabling kernel check point Some test cases may want to collect kernel log from boot, this patch adds a function to support to disable kernel check point. Test case should call disable_kernel_check_point instead of setup_kernel_check_point to collect kernel log from boot. Signed-off-by: Chao Song --- case-lib/hijack.sh | 2 ++ case-lib/lib.sh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/case-lib/hijack.sh b/case-lib/hijack.sh index f38fa9a1..5fbe6950 100644 --- a/case-lib/hijack.sh +++ b/case-lib/hijack.sh @@ -53,6 +53,8 @@ function func_exit_handler() if [[ "$KERNEL_CHECKPOINT" =~ ^[0-9]{10} ]]; then journalctl_cmd --since=@"$KERNEL_CHECKPOINT" > "$LOG_ROOT/dmesg.txt" + elif [[ "$KERNEL_CHECKPOINT" == "disabled" ]]; then + journalctl_cmd > "$LOG_ROOT/dmesg.txt" else die 'Kernel check point "KERNEL_CHECKPOINT" is not properly set' fi diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 94baa569..613a3408 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -338,3 +338,8 @@ journalctl_cmd() journalctl -k -q --no-pager --utc --output=short-monotonic \ --no-hostname "$@" } + +disable_kernel_check_point() +{ + KERNEL_CHECKPOINT="disabled" +} From bf852427761e465dec355c0433332eb16964cdab Mon Sep 17 00:00:00 2001 From: Chao Song Date: Tue, 20 Apr 2021 10:53:11 +0800 Subject: [PATCH 2/2] sof-test: add a test case to check kernel boot log Signed-off-by: Chao Song --- test-case/verify-kernel-boot-log.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 test-case/verify-kernel-boot-log.sh diff --git a/test-case/verify-kernel-boot-log.sh b/test-case/verify-kernel-boot-log.sh new file mode 100755 index 00000000..ceaab759 --- /dev/null +++ b/test-case/verify-kernel-boot-log.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +## +## Case Name: verify-kernel-boot-log +## Preconditions: +## N/A +## Description: +## Check kernel boot log, and see if there is any errors +## Case step: +## 1. Disable kernel check point and check kernel log from kernel boot +## Expect result: +## No error found in kernel boot log +## + +set -e + +# source from the relative path of current folder +# shellcheck source=case-lib/lib.sh +source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh + +func_opt_parse_option "$@" +disable_kernel_check_point + +sof-kernel-log-check.sh