From 61baee1ff7ece21ac8a9a21c5d2b1237edae772d Mon Sep 17 00:00:00 2001 From: Kartik Nema Date: Thu, 14 May 2026 13:08:37 +0530 Subject: [PATCH] Modify URM Test Runner - Add support to delete any stale lock files created in previous runs - Remove log-based result mapping (parse_and_score_log) and solely rely on the return code (0 or 1). The URM Test Runner already handles the return code, which the script can rely on. Judging pass / fail based on the logs results in some false positives. - Modify test skip logic, a suite should only be skipped if it is not in the approved list, of if the required configs are not found, or if the test executable itself is absent (or is not marked executable). Skipping of one or more tests part of the testsuite, should not result in an overall SKIP qualification, it should be either PASS OR FAIL. Signed-off-by: Kartik Nema --- .../userspace-resource-manager/run.sh | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/Runner/suites/Performance/userspace-resource-manager/run.sh b/Runner/suites/Performance/userspace-resource-manager/run.sh index fb0cbe14..668b96b5 100755 --- a/Runner/suites/Performance/userspace-resource-manager/run.sh +++ b/Runner/suites/Performance/userspace-resource-manager/run.sh @@ -45,6 +45,9 @@ RES_FILE="./${TESTNAME}.res" # ---------- Lock (avoid concurrent runs on same host) ---------- LOCKFILE="/tmp/${TESTNAME}.lock" +# Delete stale lock file, if it exists +# rm "${LOCKFILE}" + if command -v flock >/dev/null 2>&1; then exec 9>"$LOCKFILE" if ! flock -n 9; then @@ -52,6 +55,7 @@ if command -v flock >/dev/null 2>&1; then echo "$TESTNAME SKIP" >"$RES_FILE" exit 0 fi + trap 'exec 9>&-' EXIT INT TERM else if ! mkdir "$LOCKFILE" 2>/dev/null; then log_warn "Another ${TESTNAME} run is active; skipping" @@ -147,16 +151,6 @@ suite_requires_base_cfgs() { done return 1 } -parse_and_score_log() { - logf="$1" - if grep -Eiq '(^|[^a-z])fail(ed)?([^a-z]|$)|Assertion failed|Terminating Suite|Segmentation fault|Backtrace' "$logf"; then - return 1 - fi - if grep -Eiq 'Run Successful|executed successfully|Ran Successfully' "$logf"; then - return 0 - fi - return 2 -} per_suite_timeout() { case "$1" in UrmComponentTests) @@ -398,13 +392,7 @@ run_one() { run_cmd_maybe_timeout "$bin" >"$tlog" 2>&1 rc=$? - parse_and_score_log "$tlog" - score=$? - if [ $score -eq 2 ] && [ $rc -eq 0 ]; then - score=0 - fi - - case $score in + case $rc in 0) log_pass "[TEST] $name PASS" echo "PASS" >"$tres" @@ -417,11 +405,11 @@ run_one() { echo "[FAIL] $name (rc=$rc)" >>"$LOGDIR/summary.txt" return 1 ;; - 2) - log_skip "[TEST] $name SKIP" - echo "SKIP" >"$tres" - echo "[SKIP] $name (rc=$rc)" >>"$LOGDIR/summary.txt" - return 2 + *) + log_fail "[TEST] $name UNKNOWN RC=$rc" + echo "FAIL" >"$tres" + echo "[FAIL] $name (unexpected rc=$rc)" >>"$LOGDIR/summary.txt" + return 1 ;; esac }