Skip to content

Commit fceeee0

Browse files
committed
lib: wait for fw loaded before starting any test
This is going to check whether the sof-test can be started after boot/reboot. If FW LOADING is not a prerequisite for the test, this can be skipped, by defining NO_POLL_FW_LOADING=true Another benefit with this change, if FW is not loaded it will be failed instead of TIMEOUT. Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
1 parent c5f6870 commit fceeee0

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

case-lib/config.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,13 @@ FALLBACK_TO_PROC=${FALLBACK_TO_PROC:-false}
9090

9191
# Skip the storage checks if they aren't required
9292
ENABLE_STORAGE_CHECKS=${ENABLE_STORAGE_CHECKS:-0}
93+
94+
# start_test in lib.sh will check whether FW is loaded before every test case.
95+
# If FW LOADING is not a prerequisite for the test, or if you just want to skip
96+
# the check, then define NO_POLL_FW_LOADING to true.
97+
# NO_POLL_FW_LOADING=true
98+
99+
# Set MAX Polling time to check FW Loading. If FW is already loaded, it will
100+
# return immediately. Default value is set to 60 seconds, because i915 driver
101+
# timeout is 60 seconds.
102+
MAX_WAIT_FW_LOADING=${MAX_WAIT_FW_LOADING:-70}

case-lib/lib.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ start_test()
7777
return 0
7878
}
7979

80+
# Check for whether SOF fW is loaded or not before starting any test
81+
# without --since=@"$KERNEL_CHECKPOINT", it will be scan for current boot
82+
# fw loaded -> sof module removed case can't be detected.
83+
# Mainly it is going to check whether the sof-test can be started after boot/reboot
84+
if [ -z "$NO_POLL_FW_LOADING" ]; then
85+
if poll_wait_for 1 "$MAX_WAIT_FW_LOADING" sof_firmware_boot_complete; then
86+
dlogi "Good to start the test, FW is loaded!"
87+
else
88+
die "FW is not loaded for $MAX_WAIT_FW_LOADING"
89+
fi
90+
fi
91+
8092
export SOF_TEST_TOP_PID="$$"
8193
local prefix; prefix="ktime=$(ktime) sof-test PID=${SOF_TEST_TOP_PID}"
8294
local ftemp; ftemp=$(mktemp --tmpdir sof-test-XXXXX)

0 commit comments

Comments
 (0)