From e5ecb2aef4aa7df90af2b1a8bf1bdab070d32c1d Mon Sep 17 00:00:00 2001 From: Srikanth Muppandam Date: Sat, 28 Mar 2026 20:09:42 +0530 Subject: [PATCH 1/2] display: add DRM node helper and Weston stale socket cleanup Update Runner/utils/lib_display.sh to add two reusable display helpers: - get_drm_primary_node() Returns the first available DRM primary node under /dev/dri/card* so display and IGT tests can detect primary DRM availability consistently. - weston_cleanup_stale_sockets() Removes stale Wayland socket files only when Weston is not running, using best-effort cleanup for common Weston runtime locations. These helpers improve reuse across display-related tests and remove runtime noise from Weston stop/start paths without changing normal execution flow. Signed-off-by: Srikanth Muppandam --- Runner/utils/lib_display.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Runner/utils/lib_display.sh b/Runner/utils/lib_display.sh index af683375..33adc39b 100755 --- a/Runner/utils/lib_display.sh +++ b/Runner/utils/lib_display.sh @@ -110,6 +110,42 @@ display__debugfs_mode_for_crtc_name() { ' "$st" 2>/dev/null } +# Return the first available DRM primary node (/dev/dri/card*). +# Prints the node path and returns 0 on success, 1 if no primary DRM node exists. +get_drm_primary_node() { + for node in /dev/dri/card*; do + case "$node" in + /dev/dri/card[0-9]*) + if [ -e "$node" ]; then + printf '%s\n' "$node" + return 0 + fi + ;; + esac + done + return 1 +} + +# Remove stale Wayland socket files only when Weston is not running. +# Best-effort cleanup for common Weston runtime paths; ignores missing files and permission errors. +weston_cleanup_stale_sockets() { + if weston_is_running; then + return 0 + fi + + for s in \ + /dev/socket/weston/wayland-* \ + /run/user/0/wayland-* \ + /run/user/1000/wayland-* \ + /tmp/wayland-* \ + "${XDG_RUNTIME_DIR:-/nonexistent}"/wayland-*; do + [ -S "$s" ] || continue + rm -f "$s" 2>/dev/null || true + done + + return 0 +} + drm_card_index_from_dev() { dev="$1" case "$dev" in From 2a46ee09b2d20e16d43afd29a12baf089f08c1a0 Mon Sep 17 00:00:00 2001 From: Srikanth Muppandam Date: Sat, 28 Mar 2026 20:54:12 +0530 Subject: [PATCH 2/2] display/core_auth: preserve IGT skip semantics and log DRM node Update the core_auth runner to preserve IGT skip semantics without adding a runner-side skip gate. Changes in this update: - use get_drm_primary_node() only for diagnostic logging - log the DRM primary node when present - warn and continue when no DRM primary node is found - treat IGT rc=77 as SKIP instead of FAIL - keep other non-zero return codes as FAIL Signed-off-by: Srikanth Muppandam --- .../Display/igt-gpu-tools/core_auth/run.sh | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Runner/suites/Multimedia/Display/igt-gpu-tools/core_auth/run.sh b/Runner/suites/Multimedia/Display/igt-gpu-tools/core_auth/run.sh index 690ec7cd..1824903d 100755 --- a/Runner/suites/Multimedia/Display/igt-gpu-tools/core_auth/run.sh +++ b/Runner/suites/Multimedia/Display/igt-gpu-tools/core_auth/run.sh @@ -16,13 +16,15 @@ if [ -z "$INIT_ENV" ]; then fi # Only source if not already loaded (idempotent) -if [ -z "$__INIT_ENV_LOADED" ]; then +if [ -z "${__INIT_ENV_LOADED:-}" ]; then # shellcheck disable=SC1090 . "$INIT_ENV" fi # Always source functestlib.sh, using $TOOLS exported by init_env -# shellcheck disable=SC1090,SC1091 +# shellcheck disable=SC1091 . "$TOOLS/functestlib.sh" +# shellcheck disable=SC1090,SC1091 +. "$TOOLS/lib_display.sh" TESTNAME="core_auth" result_file="./${TESTNAME}.res" @@ -91,6 +93,13 @@ fi log_info "Using core_auth binary at: $CORE_AUTH_CMD" +dri_primary="$(get_drm_primary_node 2>/dev/null || true)" +if [ -n "$dri_primary" ]; then + log_info "Using DRM primary node: $dri_primary" +else + log_warn "$TESTNAME : DRM primary node /dev/dri/card* not present, continuing and letting core_auth determine outcome" +fi + if ! weston_stop; then log_error "Failed to stop Weston" echo "$TESTNAME FAIL" > "$result_file" @@ -122,7 +131,11 @@ log_info "Subtest Results: SUCCESS=$success_count, FAIL=$fail_count, SKIP=$skip_ log_info "results will be written to \"$result_file\"" log_info "-------------------Completed $TESTNAME Testcase----------------------------" -if [ "$RC" -ne 0 ]; then +if [ "$RC" -eq 77 ] || { [ "$skip_count" -gt 0 ] && [ "$success_count" -eq 0 ] && [ "$fail_count" -eq 0 ]; }; then + log_skip "$TESTNAME : Test Skipped - All $skip_count subtest(s) were skipped" + echo "$TESTNAME SKIP" > "$result_file" + exit 0 +elif [ "$RC" -ne 0 ]; then log_fail "$TESTNAME : Test Failed (exit code: $RC)" echo "$TESTNAME FAIL" > "$result_file" exit 1 @@ -130,10 +143,6 @@ elif [ "$fail_count" -gt 0 ]; then log_fail "$TESTNAME : Test Failed - $fail_count subtest(s) failed out of $total_subtests" echo "$TESTNAME FAIL" > "$result_file" exit 1 -elif [ "$skip_count" -gt 0 ] && [ "$success_count" -eq 0 ]; then - log_skip "$TESTNAME : Test Skipped - All $skip_count subtest(s) were skipped" - echo "$TESTNAME SKIP" > "$result_file" - exit 0 else if [ "$success_count" -gt 0 ]; then if [ "$skip_count" -gt 0 ]; then