[PATCH v4 8/8] test/pdump: check secondary process result
Stephen Hemminger
stephen at networkplumber.org
Wed Dec 2 19:07:41 CET 2026
The test passed even when the secondary failed every pdump call.
process_dup() returns the raw status from wait(), which is positive
on failure, but the caller folded it in with ret |= and test_pdump()
only treats a negative value as an error.
The client secondary also never called rte_pdump_init(), so it had no
IPC handler for the requests the primary sends it.
Check the launched process for any non-zero status, and initialize
pdump in the client so the enable and disable paths are actually
exercised in the secondary.
The test needs a secondary process, which cannot attach to a primary
started with --no-huge. Mark it NOHUGE_SKIP, same as the multiprocess
test. The secondary has always died in EAL init there, but the status
handling above threw the result away so the test still reported
success.
Fixes: 086eb64db39e ("test/pdump: add unit test for pdump library")
Cc: stable at dpdk.org
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
app/test/test_pdump.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/app/test/test_pdump.c b/app/test/test_pdump.c
index f1c9bd9d7e..fa0e497c84 100644
--- a/app/test/test_pdump.c
+++ b/app/test/test_pdump.c
@@ -56,6 +56,12 @@ run_pdump_client_tests(void)
struct rte_eth_dev *eth_dev = NULL;
char poolname[] = "mbuf_pool_client";
+ ret = rte_pdump_init();
+ if (ret < 0) {
+ printf("rte_pdump_init failed\n");
+ return -1;
+ }
+
ret = test_get_mempool(&mp, poolname);
if (ret < 0)
return -1;
@@ -119,6 +125,11 @@ run_pdump_client_tests(void)
if (mp != NULL)
test_mp_free(mp);
+ if (rte_pdump_uninit() < 0) {
+ printf("rte_pdump_uninit failed\n");
+ return -1;
+ }
+
return ret;
}
@@ -192,7 +203,9 @@ run_pdump_server_tests(void)
snprintf(core_str, sizeof(core_str), "%u", rte_get_main_lcore());
ret = test_pdump_init();
- ret |= launch_p(argv1);
+ /* process_dup() returns the raw wait() status, not a negative errno */
+ if (launch_p(argv1) != 0)
+ ret = -1;
ret |= test_pdump_uninit();
return ret;
}
@@ -220,4 +233,4 @@ test_pdump(void)
return TEST_SUCCESS;
}
-REGISTER_FAST_TEST(pdump_autotest, NOHUGE_OK, ASAN_SKIP, test_pdump);
+REGISTER_FAST_TEST(pdump_autotest, NOHUGE_SKIP, ASAN_SKIP, test_pdump);
--
2.53.0
More information about the stable
mailing list