Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make start_test() optional: part 1 #1170

Merged
merged 4 commits into from
Apr 20, 2024
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
10 changes: 8 additions & 2 deletions case-lib/hijack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

SUDO_CMD=$(command -v sudo)

trap 'func_exit_handler $?' EXIT
# Overwrite other functions' exit to perform environment cleanup
function func_exit_handler()
{
Expand Down Expand Up @@ -179,6 +178,13 @@ function func_exit_handler()
fi
}

print_test_result_exit $exit_status
}

print_test_result_exit()
{
local exit_status="$1"

# We must always print some 'Test Result' otherwise some callers
# will time out. These strings must match (at least) Jenkins'
# expectations, see internal sof-framework/clsTestCase.py
Expand All @@ -198,7 +204,7 @@ function func_exit_handler()
;;
esac

builtin exit $exit_status
builtin exit "$exit_status"
}

SUDO_LEVEL=""
Expand Down
3 changes: 3 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ start_test()
return 0
}

# func_exit_handler() is in hijack.sh
trap 'func_exit_handler $?' EXIT

if test -z "$MAX_WAIT_FW_LOADING"; then
local _pltf; _pltf=$("$SCRIPT_HOME/tools/sof-dump-status.py" -p)
case "$_pltf" in
Expand Down
13 changes: 10 additions & 3 deletions test-case/check-kmod-load-unload-after-playback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ if [ ${OPT_VAL['p']} -eq 1 ];then
func_lib_disable_pulseaudio
fi

"$case_dir"/check-playback.sh -l 1 -t $tplg -d $pb_duration ||
playback_subtest()
{
# Disable logging with -s because subtests don't invoke func_exit_handler() which
# can leave loggers behind (and hang rmmod)
# Also, we don't want two (concurrent!?) sets of logs for the same test.
"$case_dir"/check-playback.sh -l 1 -t $tplg -d $pb_duration -s ||
die "aplay check failed"
}

playback_subtest

for counter in $(seq 1 $loop_cnt)
do
Expand Down Expand Up @@ -91,6 +99,5 @@ do
fi
done

"$case_dir"/check-playback.sh -l 1 -t $tplg -d $pb_duration ||
die "aplay check failed"
playback_subtest
done
Loading