Fix the test_debug unit test on FreeBSD by:
* passing no-telemetry to the additional process calls
* ensuring that we always use the no-huge and no-shconf params
* removing the dependency on procfs to get the exe and using argv[0]
instead
Bugzilla ID: 761 (partial fix)
Fixes: 764bf26873b9 ("add FreeBSD support")
Cc: [email protected]
Signed-off-by: Bruce Richardson <[email protected]>
---
app/test/process.h | 11 ++++++++---
app/test/test_debug.c | 6 +++---
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/app/test/process.h b/app/test/process.h
index df43966a2a..46b69ce330 100644
--- a/app/test/process.h
+++ b/app/test/process.h
@@ -96,7 +96,7 @@ process_dup(const char *const argv[], int numargs, const char
*env_value)
int driver_path_num;
int argv_num;
int i, status;
- char path[32];
+ char *path;
#ifdef RTE_LIB_PDUMP
#ifdef RTE_NET_RING
rte_thread_t thread;
@@ -188,8 +188,13 @@ process_dup(const char *const argv[], int numargs, const
char *env_value)
/* set the environment variable */
if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0)
rte_panic("Cannot export environment variable\n");
-
- strlcpy(path, "/proc/" self "/" exe, sizeof(path));
+#ifdef RTE_EXEC_ENV_LINUX
+ char path_buf[32];
+ strlcpy(path_buf, "/proc/" self "/" exe, sizeof(path_buf));
+ path = path_buf;
+#else
+ path = argv_cpy[0];
+#endif
if (execv(path, argv_cpy) < 0) {
if (errno == ENOENT) {
printf("Could not find '%s', is procfs
mounted?\n",
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";
--
2.51.0