Skip to content

Commit 9269faf

Browse files
committed
Fix for WPSS Remoteproc test
This commit will fix the wpss remoteproc test issue. Added the proper framework support in the test script Signed-off-by: Vamsee Narapareddi <[email protected]>
1 parent 628cf2c commit 9269faf

File tree

1 file changed

+28
-2
lines changed
  • Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc

1 file changed

+28
-2
lines changed

Runner/suites/Kernel/FunctionalArea/baseport/wpss_remoteproc/run.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,32 @@
33
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
44
# SPDX-License-Identifier: BSD-3-Clause-Clear
55

6+
# Robustly find and source init_env
7+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8+
INIT_ENV=""
9+
SEARCH="$SCRIPT_DIR"
10+
while [ "$SEARCH" != "/" ]; do
11+
if [ -f "$SEARCH/init_env" ]; then
12+
INIT_ENV="$SEARCH/init_env"
13+
break
14+
fi
15+
SEARCH=$(dirname "$SEARCH")
16+
done
17+
18+
if [ -z "$INIT_ENV" ]; then
19+
echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2
20+
exit 1
21+
fi
22+
23+
# Only source if not already loaded (idempotent)
24+
if [ -z "$__INIT_ENV_LOADED" ]; then
25+
# shellcheck disable=SC1090
26+
. "$INIT_ENV"
27+
fi
28+
# Always source functestlib.sh, using $TOOLS exported by init_env
29+
# shellcheck disable=SC1090,SC1091
30+
. "$TOOLS/functestlib.sh"
31+
632
TESTNAME="wpss_remoteproc"
733
test_path=$(find_test_case_by_name "$TESTNAME")
834
cd "$test_path" || exit 1
@@ -27,7 +53,7 @@ remoteproc_path="/sys/class/remoteproc/remoteproc${remoteproc_number}"
2753
state1=$(cat ${remoteproc_path}/state)
2854
if [ "$state1" != "running" ]; then
2955
log_fail "$TESTNAME : Test Failed"
30-
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
56+
echo "$TESTNAME FAIL" > "$res_file"
3157
exit 1
3258
fi
3359

@@ -38,7 +64,7 @@ echo stop > ${remoteproc_path}/state
3864
state3=$(cat ${remoteproc_path}/state)
3965
if [ "$state3" != "offline" ]; then
4066
log_fail "wpss stop failed"
41-
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
67+
echo "$TESTNAME FAIL" > "$res_file"
4268
exit 1
4369
else
4470
log_pass "wpss stop successful"

0 commit comments

Comments
 (0)