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
15 changes: 15 additions & 0 deletions Runner/config/pkg_command_map.conf
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,21 @@ opkg:Sensors:sns_test=qcom-sensors-api qcom-sensors-core qcom-sensors-registry q
debian:package-set:fastrpc=fastrpc-support fastrpc-tests
ubuntu:package-set:fastrpc=fastrpc-support fastrpc-tests

# ---------------------------------------------------------------------------
# Qualcomm userspace-resource-manager package set.
#
# Used by tests that explicitly call:
# pkg_ensure_required_package_set_present urm
#
# The runner only checks that the required package-set definition exists.
# No qcom-distro/rpm mapping is currently provided for this package set, and
# absent mappings are intentionally ignored by the runner. As a result, Yocto
# remains a no-op unless a supported mapping is added in the future.
# ---------------------------------------------------------------------------

debian:package-set:urm=userspace-resource-manager userspace-resource-manager-tests
ubuntu:package-set:urm=userspace-resource-manager userspace-resource-manager-tests

# ---------------------------------------------------------------------------
# Qualcomm Graphics / Adreno optional overlay package set.
#
Expand Down
50 changes: 49 additions & 1 deletion Runner/suites/Performance/userspace-resource-manager/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if [ -z "${__INIT_ENV_LOADED:-}" ]; then
. "$INIT_ENV"
__INIT_ENV_LOADED=1
fi

# shellcheck disable=SC1090,SC1091
. "$TOOLS/functestlib.sh"

Expand All @@ -43,6 +44,13 @@ test_path="$(find_test_case_by_name "$TESTNAME")"
cd "$test_path" || exit 1
RES_FILE="./${TESTNAME}.res"

# Optional generic package-set recovery.
Comment thread
kartnema marked this conversation as resolved.
# This must be a clean no-op when no package-set mapping exists for the active OS/provider.
if [ -f "$TOOLS/lib_pkg_provider.sh" ]; then
# shellcheck disable=SC1091
. "$TOOLS/lib_pkg_provider.sh"
fi

log_info "=== Checking Dependencies ==="
if ! check_dependencies awk grep pgrep date printf; then
log_skip "$TESTNAME SKIP – base tools missing"
Expand Down Expand Up @@ -133,7 +141,7 @@ while [ $# -gt 0 ]; do
shift
done

# ---------- Helpers ----------
# ---------- Whitelist helpers (needed before package recovery) ----------
approved_tests() {
printf '%s\n' "$APPROVED_TESTS" | awk 'NF'
}
Expand All @@ -150,6 +158,46 @@ is_approved() {
done
return 1
}

# ---------- Ensure packages ----------
# Run only when at least one approved test will actually execute:
# --all => always recover
# --bin NAME => recover only when NAME is non-empty and approved
# This prevents a typo or missing --bin value from triggering network access,
# package installation and post-install actions before the runner skips the
# unapproved test.
# Guard with command -v so the calls are safe even when lib_pkg_provider.sh
# was not sourced or the OS/provider has no mapping.
pkg_recovery_needed=0
if [ "$RUN_MODE" = "all" ]; then
pkg_recovery_needed=1
elif [ "$RUN_MODE" = "one" ]; then
if [ -n "$ONE_BIN" ] && is_approved "$ONE_BIN"; then
pkg_recovery_needed=1
else
log_error "[PKG] --bin value '${ONE_BIN}' is not in the approved set; aborting"
echo "$TESTNAME FAIL" >"$RES_FILE"
exit 1
fi
fi
if [ "$pkg_recovery_needed" -eq 1 ]; then
if command -v pkg_lookup_package_set >/dev/null 2>&1 && \
command -v pkg_ensure_required_package_set_present >/dev/null 2>&1; then
if pkg_lookup_package_set urm >/dev/null 2>&1; then
if ! pkg_ensure_required_package_set_present urm; then
log_skip "$TESTNAME SKIP - failed to ensure required package set: urm"
echo "$TESTNAME SKIP" >"$RES_FILE"
exit 0
fi
else
log_info "No URM package-set mapping for this OS/provider; using image-provided assets"
fi
else
log_info "pkg_lookup_package_set / pkg_ensure_required_package_set_present not available; using image-provided assets"
fi
fi

# ---------- Helpers ----------
suite_requires_base_cfgs() {
name="$1"
for s in $SUITES_REQUIRE_BASE_CFGS; do
Expand Down
Loading