[PATCH v3 1/2] test: fix failing tests on FreeBSD

Bruce Richardson
2026-04-08T17:44:18Z

Many autotests were failing on FreeBSD, mostly because of the lack of
secondary process support. Skip these tests, and also fix the debug
autotest which crashes on FreeBSD if telemetry is not disabled for the
extra spawned process.

Bugzilla ID: 761
Fixes: 764bf26873b9 ("add FreeBSD support")
Fixes: 50247fe03fe0 ("test/timer: exercise new APIs in secondary process")
Fixes: 086eb64db39e ("test/pdump: add unit test for pdump library")
Fixes: b270daa43b3d ("test: support external memory")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Adam Hassick <ahassick@iol.unh.edu>
---
app/test/test_debug.c | 6 +++---
app/test/test_eal_flags.c | 26 +++++++++++++-------------
app/test/test_external_mem.c | 4 ++--
app/test/test_interrupts.c | 2 +-
app/test/test_mp_secondary.c | 4 ++--
app/test/test_pdump.c | 4 ++++
app/test/test_timer_secondary.c | 4 ++--
7 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/app/test/test_debug.c b/app/test/test_debug.c
index bfda4d1aa3..eda9c3e0e1 100644
--- a/app/test/test_debug.c
+++ b/app/test/test_debug.c
@@ -154,15 +154,15 @@ test_debug(void)
test_args[2] = "-l";
test_args[3] = core;

- if (rte_eal_has_hugepages()) {
+ if (rte_eal_has_hugepages() && RTE_EXEC_ENV_IS_LINUX) {
test_args[4] = "";
test_args[5] = "";
test_args[6] = "";
test_args[7] = "";
} else {
test_args[4] = "--no-huge";
- test_args[5] = "-m";
- test_args[6] = "2048";
+ test_args[5] = "-m2048";
+ test_args[6] = "--no-telemetry";
#ifdef RTE_ARCH_PPC_64
/* iova=pa is the default, but fails on ppc64 with --no-huge */
test_args[7] = "--iova-mode=va";
diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index b3a8d0ae6f..12280e7a39 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -10,88 +10,88 @@
#include <string.h>
#include <stdarg.h>

-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
static int
test_missing_c_flag(void)
{
- printf("missing_c_flag not supported on Windows, skipping test\n");
+ printf("missing_c_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_main_lcore_flag(void)
{
- printf("main_lcore_flag not supported on Windows, skipping test\n");
+ printf("main_lcore_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_invalid_n_flag(void)
{
- printf("invalid_n_flag not supported on Windows, skipping test\n");
+ printf("invalid_n_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_no_hpet_flag(void)
{
- printf("no_hpet_flag not supported on Windows, skipping test\n");
+ printf("no_hpet_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_no_huge_flag(void)
{
- printf("no_huge_flag not supported on Windows, skipping test\n");
+ printf("no_huge_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_allow_flag(void)
{
- printf("allow_flag not supported on Windows, skipping test\n");
+ printf("allow_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_invalid_b_flag(void)
{
- printf("invalid_b_flag not supported on Windows, skipping test\n");
+ printf("invalid_b_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_invalid_vdev_flag(void)
{
- printf("invalid_vdev_flag not supported on Windows, skipping test\n");
+ printf("invalid_vdev_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_invalid_r_flag(void)
{
- printf("invalid_r_flag not supported on Windows, skipping test\n");
+ printf("invalid_r_flag only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_memory_flags(void)
{
- printf("memory_flags not supported on Windows, skipping test\n");
+ printf("memory_flags only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_file_prefix(void)
{
- printf("file_prefix not supported on Windows, skipping test\n");
+ printf("file_prefix only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

static int
test_misc_flags(void)
{
- printf("misc_flags not supported on Windows, skipping test\n");
+ printf("misc_flags only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

diff --git a/app/test/test_external_mem.c b/app/test/test_external_mem.c
index 1c977b749b..53300983ed 100644
--- a/app/test/test_external_mem.c
+++ b/app/test/test_external_mem.c
@@ -10,11 +10,11 @@
#include <string.h>
#include <fcntl.h>

-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
static int
test_external_mem(void)
{
- printf("external_mem not supported on Windows, skipping test\n");
+ printf("external_mem only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}

diff --git a/app/test/test_interrupts.c b/app/test/test_interrupts.c
index 2eb876e65a..3a5be92cd7 100644
--- a/app/test/test_interrupts.c
+++ b/app/test/test_interrupts.c
@@ -429,7 +429,7 @@ test_interrupt(void)
int ret = -1;
struct rte_intr_handle *test_intr_handle;

- if (RTE_EXEC_ENV_IS_WINDOWS)
+ if (RTE_EXEC_ENV_IS_WINDOWS || RTE_EXEC_ENV_IS_FREEBSD)
return TEST_SKIPPED;

if (test_interrupt_init() < 0) {
diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c
index 218eacb3bf..d89419c253 100644
--- a/app/test/test_mp_secondary.c
+++ b/app/test/test_mp_secondary.c
@@ -15,11 +15,11 @@
#include <string.h>
#include <unistd.h>

-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
int
test_mp_secondary(void)
{
- printf("mp_secondary not supported on Windows, skipping test\n");
+ printf("Multiprocess support only present on Linux, skipping test\n");
return TEST_SKIPPED;
}
#else
diff --git a/app/test/test_pdump.c b/app/test/test_pdump.c
index 824caef2d4..64f1bbf21c 100644
--- a/app/test/test_pdump.c
+++ b/app/test/test_pdump.c
@@ -198,6 +198,10 @@ int
test_pdump(void)
{
int ret = 0;
+
+ if (RTE_EXEC_ENV_IS_FREEBSD)
+ return TEST_SKIPPED;
+
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
printf("IN PRIMARY PROCESS\n");
ret = run_pdump_server_tests();
diff --git a/app/test/test_timer_secondary.c b/app/test/test_timer_secondary.c
index 57ab39130d..529774f4d0 100644
--- a/app/test/test_timer_secondary.c
+++ b/app/test/test_timer_secondary.c
@@ -18,11 +18,11 @@

#include "test.h"

-#ifdef RTE_EXEC_ENV_WINDOWS
+#ifndef RTE_EXEC_ENV_LINUX
int
test_timer_secondary(void)
{
- printf("timer_secondary not supported on Windows, skipping test\n");
+ printf("timer_secondary only supported on Linux, skipping test\n");
return TEST_SKIPPED;
}
#else
--
2.51.0