Skip to contentSkip to conversation

selftests/rdma: Skip rxe_sent_rcvd_bytes when rdma_rxe is missing

PATCH Applied Bjoern Doebel 3 participants 3 messages Sep 30 – Oct 1

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/rdma: Skip rxe_sent_rcvd_bytes when rdma_rxe is missing

On a kernel built without CONFIG_RDMA_RXE the test exits 1 instead of skipping:

# modprobe: FATAL: Module rdma_rxe not found in directory ... not ok 467 selftests: rdma: rxe_sent_rcvd_bytes.sh # exit=1

Every other test in this directory probes with modinfo and exits $KSFT_SKIP. Apply the same guard, identical to the one in the otherwise near-identical rxe_socket_with_netns.sh.

Fixes c67bd973695c3 ("selftest/rxe: Add selftests for perf")
Assisted-by kiro:claude-opus-5
---
 tools/testing/selftests/rdma/rxe_sent_rcvd_bytes.sh | 6 ++++++
 1 file changed, 6 insertions(+)
tools/testing/selftests/rdma/rxe_sent_rcvd_bytes.sh +6 -0
index 0e4fbfeebd228..89218ccfba4c1 100755
@@ -4,6 +4,8 @@
 PORT=4791
 MODS=("tun" "rdma_rxe")
 
+source "$(dirname "$0")/../kselftest/ktap_helpers.sh"
+
 exec > /dev/null
 
 # --- Helper: Cleanup Routine ---
@@ -24,6 +26,10 @@ if [[ $EUID -ne 0 ]]; then
 fi
 
 for m in "${MODS[@]}"; do
+    if ! modinfo "$m" >/dev/null 2>&1; then
+        echo "SKIP: Kernel module '$m' not found." >&2
+        exit $KSFT_SKIP
+    fi
     modprobe "$m" || { echo "Error: Failed to load $m"; exit 1; }
 done
 
Signature · 1 line
2.50.1
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 6 lines

On a kernel built without CONFIG_RDMA_RXE the test exits 1 instead of skipping:

# modprobe: FATAL: Module rdma_rxe not found in directory ... not ok 467 selftests: rdma: rxe_sent_rcvd_bytes.sh # exit=1

Quoted 8 lines

Every other test in this directory probes with modinfo and exits $KSFT_SKIP. Apply the same guard, identical to the one in the otherwise near-identical rxe_socket_with_netns.sh.

Fixes c67bd973695c3 ("selftest/rxe: Add selftests for perf")
Assisted-by kiro:claude-opus-5

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Bjoern Doebel
Quoted 11 lines · Bjoern Doebel

On a kernel built without CONFIG_RDMA_RXE the test exits 1 instead of skipping:

# modprobe: FATAL: Module rdma_rxe not found in directory ... not ok 467 selftests: rdma: rxe_sent_rcvd_bytes.sh # exit=1

Every other test in this directory probes with modinfo and exits $KSFT_SKIP. Apply the same guard, identical to the one in the otherwise near-identical rxe_socket_with_netns.sh.

[...]

Applied, thanks!

[1/1] selftests/rdma: Skip rxe_sent_rcvd_bytes when rdma_rxe is missing

      https://git.kernel.org/rdma/rdma/c/d2c08575500145

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>