selftest: packetdrill: Set ktap_set_plan properly for single protocol test.

The cited commit forgot to update the ktap_set_plan call.

ktap_set_plan sets the number of tests (KSFT_NUM_TESTS), which must
match the number of executed tests (KTAP_CNT_PASS + KTAP_CNT_SKIP +
KTAP_CNT_XFAIL) in ktap_finished.

Otherwise, the selftest exit()s with 1.

Let's adjust KSFT_NUM_TESTS based on supported protocols.

While at it, misalignment is fixed up.

Fixes: a5c10aa3d1 ("selftests/net: packetdrill: Support single protocol test.")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250927213022.1850048-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Kuniyuki Iwashima 2025-09-27 21:29:39 +00:00 committed by Jakub Kicinski
parent 4ed9db2dc5
commit 70dd4775db

View File

@ -48,11 +48,11 @@ elif [[ ! "$ip_versions" =~ ^ipv[46]$ ]]; then
fi
ktap_print_header
ktap_set_plan 2
ktap_set_plan $(echo $ip_versions | wc -w)
for ip_version in $ip_versions; do
unshare -n packetdrill ${ip_args[$ip_version]} ${optargs[@]} $script > /dev/null \
&& ktap_test_pass $ip_version || $failfunc $ip_version
&& ktap_test_pass $ip_version || $failfunc $ip_version
done
ktap_finished