Skip to content

Commit bb9e673

Browse files
authored
Merge branch 'qualcomm-linux:main' into Support-for-Display-IGT-Tests
2 parents 04cfd89 + fc99736 commit bb9e673

File tree

36 files changed

+9796
-1184
lines changed

36 files changed

+9796
-1184
lines changed

Runner/init_env

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,84 @@ if [ -z "$ROOT_DIR" ]; then
2929
fi
3030
fi
3131

32-
if [ ! -d "$ROOT_DIR/utils" ] || [ ! -f "$ROOT_DIR/utils/functestlib.sh" ]; then
33-
echo "[ERROR] Could not detect testkit root (missing utils/ or functestlib.sh)" >&2
32+
# --- Validate and export key environment paths ---
33+
if [ -z "${ROOT_DIR:-}" ] || [ ! -d "$ROOT_DIR/utils" ] || [ ! -f "$ROOT_DIR/utils/functestlib.sh" ]; then
34+
echo "[ERROR] Could not detect testkit root (missing utils/ or functestlib.sh)" >&2
3435
exit 1
3536
fi
3637

3738
export ROOT_DIR
3839
export TOOLS="$ROOT_DIR/utils"
3940
export __RUNNER_SUITES_DIR="$ROOT_DIR/suites"
4041
export __RUNNER_UTILS_BIN_DIR="$ROOT_DIR/common"
42+
43+
# --- Ensure TOOLS is usable in all shells ---
44+
case ":$PATH:" in
45+
*":$TOOLS:"*) : ;;
46+
*)
47+
PATH="$TOOLS:$PATH"
48+
export PATH
49+
;;
50+
esac
51+
52+
# --- Optional: pre-check for required tools (safe no-op for minimal builds) ---
53+
if [ -f "$TOOLS/functestlib.sh" ]; then
54+
# shellcheck disable=SC1090,SC1091
55+
. "$TOOLS/functestlib.sh" >/dev/null 2>&1 || true
56+
fi
57+
58+
###############################################################################
59+
# Stdout/stderr capture (per-test folder)
60+
#
61+
# Controls (set BEFORE sourcing this file):
62+
# RUN_STDOUT_ENABLE = 1 | 0 (default: 1)
63+
# RUN_STDOUT_TAG = <string> (default: basename of $PWD)
64+
# RUN_STDOUT_FILE = <path> (default: $PWD/<tag>_stdout_<ts>.log)
65+
#
66+
# Behavior:
67+
# - Writes the capture file into the CURRENT DIRECTORY (usually the test dir).
68+
# - No global logs/stdout directory is created/used.
69+
###############################################################################
70+
_runner_stdout_cleanup() {
71+
st=$?
72+
# restore original fds (if they were saved)
73+
exec 1>&3 2>&4
74+
if [ -n "${__TEE_PID:-}" ]; then
75+
kill "$__TEE_PID" 2>/dev/null
76+
fi
77+
if [ -n "${PIPE:-}" ]; then
78+
rm -f "$PIPE" 2>/dev/null
79+
fi
80+
exit "$st"
81+
}
82+
83+
if [ "${RUN_STDOUT_ENABLE:-1}" -eq 1 ] && [ -z "${__RUN_STDOUT_ACTIVE:-}" ]; then
84+
_tag="${RUN_STDOUT_TAG:-$(basename "$(pwd)")}"
85+
_ts="$(date +%Y%m%d-%H%M%S)"
86+
RUN_STDOUT_FILE="${RUN_STDOUT_FILE:-$(pwd)/${_tag}_stdout_${_ts}.log}"
87+
export RUN_STDOUT_FILE
88+
89+
# Save original stdout/stderr
90+
exec 3>&1 4>&2
91+
92+
if command -v tee >/dev/null 2>&1; then
93+
PIPE="$(mktemp -u "/tmp/stdout_pipe.XXXXXX")"
94+
if mkfifo "$PIPE" 2>/dev/null; then
95+
( tee -a "$RUN_STDOUT_FILE" >&3 ) < "$PIPE" &
96+
__TEE_PID=$!
97+
exec > "$PIPE" 2>&1
98+
__RUN_STDOUT_ACTIVE=1
99+
trap _runner_stdout_cleanup EXIT INT TERM
100+
else
101+
# Fallback: file-only capture
102+
exec >> "$RUN_STDOUT_FILE" 2>&1
103+
__RUN_STDOUT_ACTIVE=1
104+
trap _runner_stdout_cleanup EXIT INT TERM
105+
fi
106+
else
107+
# Fallback: file-only capture
108+
exec >> "$RUN_STDOUT_FILE" 2>&1
109+
__RUN_STDOUT_ACTIVE=1
110+
trap _runner_stdout_cleanup EXIT INT TERM
111+
fi
112+
fi

Runner/plans/Kernel_AU-Sanity.yaml

100644100755
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ run:
7676
- $PWD/utils/send-to-lava.sh $PWD/suites/Connectivity/Bluetooth/BT_ON_FF/BT_ON_FF.res || true
7777
- $PWD/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/run.sh || true
7878
- $PWD/utils/send-to-lava.sh $PWD/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/BT_SCAN_PAIR.res || true
79-
- $PWD/suites/Multimedia/Video/iris_v4l2_video_decode/run.sh || true
80-
- $PWD/utils/send-to-lava.sh $PWD/suites/Multimedia/Video/iris_v4l2_video_decode/iris_v4l2_video_decode.res || true
81-
- $PWD/suites/Multimedia/Video/iris_v4l2_video_encode/run.sh || true
82-
- $PWD/utils/send-to-lava.sh $PWD/suites/Multimedia/Video/iris_v4l2_video_encode/iris_v4l2_video_encode.res || true
79+
- $PWD/suites/Multimedia/Video/Video_V4L2_Runner/run.sh || true
80+
- $PWD/utils/send-to-lava.sh $PWD/suites/Multimedia/Video/Video_V4L2_Runner/Video_V4L2_Runner.res || true
8381
- $PWD/utils/result_parse.sh

Runner/plans/qcom-next-ci-premerge.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ run:
4646
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/Baseport/rngtest/rngtest.res || true
4747
- $PWD/suites/Kernel/Baseport/smmu/run.sh || true
4848
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/Baseport/smmu/smmu.res || true
49-
- $PWD/suites/Kernel/Baseport/storage/run.sh || true
50-
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/Baseport/storage/storage.res || true
49+
- $PWD/suites/Kernel/Baseport/Storage/UFS_Validation/run.sh || true
50+
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/Baseport/Storage/UFS_Validation/UFS_Validation.res || true
5151
- $PWD/suites/Kernel/Baseport/wpss_remoteproc/run.sh || true
5252
- $PWD/utils/send-to-lava.sh $PWD/suites/Kernel/Baseport/wpss_remoteproc/wpss_remoteproc.res || true
5353
- $PWD/suites/Kernel/DCVS/Freq_Scaling/run.sh || true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
metadata:
2+
format: Lava-Test Test Definition 1.0
3+
name: resource-tuner
4+
description: "Run only resource-tuner tests from qcom-linux-testkit"
5+
maintainer:
6+
- smuppand@qti.qualcomm.com
7+
os:
8+
- yocto open embedded
9+
scope:
10+
- Unit Test
11+
devices:
12+
- rb3gen2
13+
14+
run:
15+
steps:
16+
- cd Runner
17+
- $PWD/suites/Performance/resource-tuner/run.sh || true
18+
- $PWD/utils/send-to-lava.sh $PWD/suites/Performance/resource-tuner/resource-tuner.res || true
19+
- $PWD/utils/result_parse.sh

Runner/plans/video_pre-merge.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
metadata:
2+
format: Lava-Test Test Definition 1.0
3+
name: Video_V4L2_LocalClips
4+
description: "Run Video V4L2 runner with local clips tar and custom .ko dir; auto-args for kodiak vs lemans/monaco; run base & overlay"
5+
maintainer:
6+
- smuppand@qti.qualcomm.com
7+
os:
8+
- openembedded
9+
scope:
10+
- functional
11+
run:
12+
steps:
13+
- cd Runner
14+
- export REPO_ROOT="$PWD"
15+
- export TARGET="${TARGET:-}" # kodiak | lemans | monaco (case-insensitive)
16+
17+
- |
18+
RPATH="$REPO_ROOT/suites/Multimedia/Video/Video_V4L2_Runner/run.sh"
19+
RESFILE="$REPO_ROOT/suites/Multimedia/Video/Video_V4L2_Runner/Video_V4L2_Runner.res"
20+
21+
# Custom media bundle (local) path
22+
CLIPS_TAR="/data/vendor/iris_test_app/video_clips_iris.tar.gz"
23+
24+
# Custom downstream module location (directory containing iris_vpu.ko)
25+
KO_DIR="/data/vendor/iris_test_app"
26+
27+
# Optional: downstream firmware needed on Kodiak overlay
28+
DS_FW="/data/vendor/iris_test_app/vpu20_1v.mbn"
29+
30+
# Prefer explicit TARGET; otherwise derive from LAVA device-type
31+
if [ -n "${TARGET:-}" ]; then
32+
TL="$(printf '%s' "$TARGET" | tr '[:upper:]' '[:lower:]')"
33+
else
34+
DEVTYPE_RAW="${DEVICE_TYPE:-${LAVA_DEVICE_TYPE:-${LAVA_DEVICE_TYPE_NAME:-${DEVICE_TYPE_NAME:-}}}}"
35+
DEVTYPE="$(printf '%s' "$DEVTYPE_RAW" | tr '[:upper:]' '[:lower:]')"
36+
case "$DEVTYPE" in
37+
# monaco
38+
qcs8300-ride|qcs8300-ride-sx|iq-8275-evk) TL="monaco" ;;
39+
# lemans
40+
qcs9100-ride-r3|sa8775p-ride|iq-9075-evk|qcs9075-rb8|qcs9100-ride-sx) TL="lemans" ;;
41+
# kodiak
42+
qcs6490-rb3gen2|rb3gen2|qcs6490-rb3gen2-core-kit) TL="kodiak" ;;
43+
# fallback to autodetect in run.sh
44+
*) TL="" ;;
45+
esac
46+
fi
47+
48+
case "$TL" in
49+
kodiak|lemans|monaco) PLAT="--platform $TL" ;;
50+
*) PLAT="" ;; # autodetect
51+
esac
52+
53+
echo "DEBUG: TARGET='${TARGET:-}' DEVTYPE='${DEVTYPE:-}' -> TL='$TL' PLAT='$PLAT'"
54+
55+
# Common args (local clips; no Wi-Fi/TAR_URL needed)
56+
ARGS_COMMON="--clips-tar $CLIPS_TAR --app /data/vendor/iris_test_app/iris_v4l2_test $PLAT --retry-on-fail 2 --loglevel 15"
57+
58+
# --- BASE (upstream): NO ko args here ---
59+
ARGS_BASE="--stack base $ARGS_COMMON"
60+
61+
# --- OVERLAY (downstream): add ko args; only add FW on kodiak ---
62+
ARGS_OVERLAY="--stack overlay $ARGS_COMMON"
63+
if [ "$TL" = "kodiak" ]; then
64+
ARGS_OVERLAY="$ARGS_OVERLAY --downstream-fw $DS_FW"
65+
fi
66+
67+
echo "BASE ARGS: $ARGS_BASE"
68+
echo "OVERLAY ARGS: $ARGS_OVERLAY"
69+
70+
# Run BASE (upstream)
71+
# shellcheck disable=SC2086
72+
sh -lc "$RPATH $ARGS_BASE" || true
73+
"$REPO_ROOT/utils/send-to-lava.sh" "$RESFILE" || true
74+
75+
# Run OVERLAY (downstream)
76+
# shellcheck disable=SC2086
77+
sh -lc "$RPATH $ARGS_OVERLAY" || true
78+
"$REPO_ROOT/utils/send-to-lava.sh" "$RESFILE" || true
79+
80+
# Optional roll-up (ignored if absent)
81+
"$REPO_ROOT/utils/result_parse.sh" || true

Runner/run-test.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
99
# Set TOOLS path to utils under the script directory
1010
TOOLS="$SCRIPT_DIR/utils"
1111

12+
# Disable wrapper-level capture; each test will capture in its own folder
13+
export RUN_STDOUT_ENABLE=0
14+
unset RUN_STDOUT_TAG RUN_STDOUT_FILE
15+
1216
# Safely source init_env from the same directory as this script
1317
if [ -f "$SCRIPT_DIR/init_env" ]; then
1418
# shellcheck source=/dev/null
@@ -46,7 +50,11 @@ execute_test_case() {
4650
run_script="$test_path/run.sh"
4751
if [ -f "$run_script" ]; then
4852
log "Executing test case: $test_name"
49-
(cd "$test_path" && sh "./run.sh" "$@")
53+
(
54+
cd "$test_path" || exit 2
55+
# Enable per-test capture in the test folder with a clear tag
56+
RUN_STDOUT_ENABLE=1 RUN_STDOUT_TAG="$test_name" sh "./run.sh" "$@"
57+
)
5058
res_file="$test_path/$test_name.res"
5159
if [ -f "$res_file" ]; then
5260
if grep -q "SKIP" "$res_file"; then
@@ -131,7 +139,8 @@ Usage:
131139
Notes:
132140
- Extra args are forwarded only when a single <testcase_name> is specified.
133141
- 'all' runs every test and does not accept additional args.
134-
- Use -h or --help to display this message.
142+
- Each test captures stdout/stderr next to its .res file as:
143+
<testname>_stdout_<timestamp>.log
135144
EOF
136145
}
137146

Runner/suites/Connectivity/WiFi/WiFi_Dynamic_IP/run.sh

Lines changed: 75 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/sh
2-
32
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
43
# SPDX-License-Identifier: BSD-3-Clause-Clear
54

@@ -33,42 +32,106 @@ TESTNAME="WiFi_Dynamic_IP"
3332
test_path=$(find_test_case_by_name "$TESTNAME")
3433
cd "$test_path" || exit 1
3534

35+
# ---------------- CLI (SSID/PASSWORD) ----------------
36+
SSID=""
37+
PASSWORD=""
38+
39+
while [ $# -gt 0 ]; do
40+
case "$1" in
41+
--ssid)
42+
shift
43+
if [ -n "${1:-}" ]; then
44+
SSID="$1"
45+
fi
46+
;;
47+
--password)
48+
shift
49+
if [ -n "${1:-}" ]; then
50+
PASSWORD="$1"
51+
fi
52+
;;
53+
--help|-h)
54+
echo "Usage: $0 [--ssid SSID] [--password PASS]"
55+
exit 0
56+
;;
57+
*)
58+
log_warn "Unknown argument: $1"
59+
;;
60+
esac
61+
shift
62+
done
63+
3664
log_info "-------------------------------------------------------------"
3765
log_info "------------------- Starting $TESTNAME Test -----------------"
66+
log_info "Host: $(hostname 2>/dev/null || printf 'unknown')"
67+
log_info "Kernel: $(uname -r 2>/dev/null || printf 'unknown')"
68+
log_info "Date: $(date -u 2>/dev/null || printf 'unknown')"
3869

3970
# Credential extraction
40-
creds=$(get_wifi_credentials "$1" "$2") || log_skip_exit "$TESTNAME" "WiFi: SSID and/or password missing. Skipping test." wifi_cleanup ""
71+
creds=$(get_wifi_credentials "$SSID" "$PASSWORD") || \
72+
log_skip_exit "$TESTNAME" "WiFi: SSID and/or password missing. Skipping test." wifi_cleanup ""
73+
4174
SSID=$(echo "$creds" | awk '{print $1}')
4275
PASSWORD=$(echo "$creds" | awk '{print $2}')
76+
4377
log_info "Using SSID='$SSID' and PASSWORD='[hidden]'"
4478

4579
check_dependencies iw ping
4680

4781
# If not a kernel-only/minimal build, systemd is checked, else skipped automatically
48-
check_systemd_services systemd-networkd.service || log_fail_exit "$TESTNAME" "Network services check failed" wifi_cleanup ""
82+
log_info "Checking network service: systemd-networkd.service"
83+
check_systemd_services systemd-networkd.service || \
84+
log_fail_exit "$TESTNAME" "Network services check failed" wifi_cleanup ""
85+
86+
WIFI_IFACE=$(get_wifi_interface) || \
87+
log_fail_exit "$TESTNAME" "No WiFi interface found" wifi_cleanup ""
4988

50-
WIFI_IFACE=$(get_wifi_interface) || log_fail_exit "$TESTNAME" "No WiFi interface found" wifi_cleanup ""
5189
log_info "Using WiFi interface: $WIFI_IFACE"
5290

91+
# Prepare a ping log file for command output (appended across retries)
92+
PING_LOG="./wifi_ping_${WIFI_IFACE}.log"
93+
: > "$PING_LOG"
94+
log_info "Ping output will be logged to: $PING_LOG"
95+
5396
# nmcli with retry
97+
log_info "Attempting connection via nmcli…"
5498
if wifi_connect_nmcli "$WIFI_IFACE" "$SSID" "$PASSWORD"; then
5599
IP=$(wifi_get_ip "$WIFI_IFACE")
56-
[ -z "$IP" ] && log_fail_exit "$TESTNAME" "No IP after nmcli" wifi_cleanup "$WIFI_IFACE"
57-
if retry_command "ping -I \"$WIFI_IFACE\" -c 3 -W 2 8.8.8.8 >/dev/null 2>&1" 3 3; then
58-
log_pass_exit "$TESTNAME" "Internet connectivity verified via ping" wifi_cleanup "$WIFI_IFACE"
100+
101+
if [ -z "$IP" ]; then
102+
log_fail_exit "$TESTNAME" "No IP after nmcli" wifi_cleanup "$WIFI_IFACE"
103+
fi
104+
105+
log_info "Acquired IP via nmcli: $IP"
106+
107+
PING_CMD="ping -I \"$WIFI_IFACE\" -c 3 -W 2 8.8.8.8 2>&1 | tee -a \"$PING_LOG\""
108+
log_info "Connectivity check command: $PING_CMD"
109+
110+
if retry_command "$PING_CMD" 3 3; then
111+
log_pass_exit "$TESTNAME" "Internet connectivity verified via ping (iface=$WIFI_IFACE ip=$IP)" wifi_cleanup "$WIFI_IFACE"
59112
else
60-
log_fail_exit "$TESTNAME" "Ping test failed after nmcli connection" wifi_cleanup "$WIFI_IFACE"
113+
log_fail_exit "$TESTNAME" "Ping test failed after nmcli connection (iface=$WIFI_IFACE ip=$IP). See $PING_LOG" wifi_cleanup "$WIFI_IFACE"
61114
fi
62115
fi
63116

64117
# wpa_supplicant+udhcpc with retry
118+
log_info "Attempting connection via wpa_supplicant + udhcpc…"
65119
if wifi_connect_wpa_supplicant "$WIFI_IFACE" "$SSID" "$PASSWORD"; then
66120
IP=$(wifi_get_ip "$WIFI_IFACE")
67-
[ -z "$IP" ] && log_fail_exit "$TESTNAME" "No IP after wpa_supplicant" wifi_cleanup "$WIFI_IFACE"
68-
if retry_command "ping -I \"$WIFI_IFACE\" -c 3 -W 2 8.8.8.8 >/dev/null 2>&1" 3 3; then
69-
log_pass_exit "$TESTNAME" "Internet connectivity verified via ping" wifi_cleanup "$WIFI_IFACE"
121+
122+
if [ -z "$IP" ]; then
123+
log_fail_exit "$TESTNAME" "No IP after wpa_supplicant" wifi_cleanup "$WIFI_IFACE"
124+
fi
125+
126+
log_info "Acquired IP via wpa_supplicant: $IP"
127+
128+
PING_CMD="ping -I \"$WIFI_IFACE\" -c 3 -W 2 8.8.8.8 2>&1 | tee -a \"$PING_LOG\""
129+
log_info "Connectivity check command: $PING_CMD"
130+
131+
if retry_command "$PING_CMD" 3 3; then
132+
log_pass_exit "$TESTNAME" "Internet connectivity verified via ping (iface=$WIFI_IFACE ip=$IP)" wifi_cleanup "$WIFI_IFACE"
70133
else
71-
log_fail_exit "$TESTNAME" "Ping test failed after wpa_supplicant connection" wifi_cleanup "$WIFI_IFACE"
134+
log_fail_exit "$TESTNAME" "Ping test failed after wpa_supplicant connection (iface=$WIFI_IFACE ip=$IP). See $PING_LOG" wifi_cleanup "$WIFI_IFACE"
72135
fi
73136
fi
74137

0 commit comments

Comments
 (0)