Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions case-lib/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ declare -A TPLG_IGNORE_LST
# shellcheck disable=SC2034
TPLG_IGNORE_LST['pcm']='HDA Digital'

# Will be set by the lib function, don't need to set
# Catches the last line of /var/log/kern.log, which will be used by
# sof-kernel-log-check.
# KERNEL_CHECKPOINT

# If not set will be automatically set by logging_ctl function
# Test case log root
# EXAMPLE: the log for test-case/check-ipc-flood.sh will be stored at
Expand Down Expand Up @@ -63,7 +58,15 @@ SUDO_LEVEL=${SUDO_LEVEL:-}
#
# NO_BT_MODE=true

# Test interval between two test cases, the default value is 5 seconds
# in CI, which is controlled by sof-framework. In manual run, user can
# override the default value.
# SOF_TEST_INTERVAL informs sof-test of how long the external test
# runner waits between the end of one sof-test and the start of the next
# sof-test. sof-test uses this value to assign the corresponding kernel
# logs "no man's land" to the second test, which can be confusing (see
# for instance https://github.com/thesofproject/sof/issues/5032) but
# safer: it makes sure no kernel error escapes.
# See initial review in https://github.com/thesofproject/sof-test/pull/639
#
# The default value must be 5s because 5s is the inter-test delay
# waited by the internal test runner used by sof/jenkins CI and that
# test runner does not define SOF_TEST_INTERVAL (internal bug 158)
SOF_TEST_INTERVAL=${SOF_TEST_INTERVAL:-5}
9 changes: 6 additions & 3 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ fi

setup_kernel_check_point()
{
# Make the check point $SOF_TEST_INTERVAL second(s) earlier to avoid log loss.
# Note this may lead to an error caused by one test appear in the next one.
KERNEL_CHECKPOINT=$(($(date +%s) - SOF_TEST_INTERVAL))
# Make the check point $SOF_TEST_INTERVAL second(s) earlier to avoid
# log loss. Note this may lead to an error caused by one test
# appear in the next one, see comments in config.sh. Add 3 extra
# second to account for our own, sof-test delays after PASS/FAIL
# decision: time spent collecting logs etc.
KERNEL_CHECKPOINT=$(($(date +%s) - SOF_TEST_INTERVAL - 3))
}

# This function adds a fake error to dmesg (which is always saved by
Expand Down
4 changes: 3 additions & 1 deletion test-case/run-all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ main()
while getopts "l:T:xh" OPTION; do
case "$OPTION" in
l) tests_length="$OPTARG" ;;
T) time_delay="$OPTARG" ;;
T) time_delay="$OPTARG"
export SOF_TEST_INTERVAL="$OPTARG"
;;
x) exit_first=true ;;
*) usage; exit 1 ;;
esac
Expand Down