tests: add vpp-opt-deps to vpp LD_LIBRARY_PATH 28/43528/2
authorDave Wallace <[email protected]>
Wed, 6 Aug 2025 15:46:00 +0000 (11:46 -0400)
committerFlorin Coras <[email protected]>
Fri, 8 Aug 2025 03:47:50 +0000 (03:47 +0000)
- When vpp-opt-deps is installed, add it to LD_LIBRARY_PATH
  when invoking vpp for 'make test' and 'make run' targets
  overriding the dynamically linked distro library version.

Type: test

Change-Id: Id2feb74b7232cca1c1870599c4b3d409e2d0aa59
Signed-off-by: Dave Wallace <[email protected]>
Makefile
test/Makefile
test/config.py

index 792d5c4..a7ce998 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,10 @@ MACHINE=$(shell uname -m)
 SUDO?=sudo -E
 DPDK_CONFIG?=no-pci
 
+ifeq ($(shell test -d /opt/vpp/optional/${MACHINE}/lib64 && echo yes),yes)
+VPP_OPT_DEPS_LIBRARY_PATH?=/opt/vpp/optional/${MACHINE}/lib64
+endif
+
 # we prefer clang by default
 ifeq ($(CC),cc)
   CC=clang
@@ -737,12 +741,12 @@ define run
        @echo "WARNING: STARTUP_CONF not defined or file doesn't exist."
        @echo "         Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n"
        @cd $(STARTUP_DIR) && \
-         $(SUDO) $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF)
+         $(SUDO) LD_LIBRARY_PATH=$(VPP_OPT_DEPS_LIBRARY_PATH) $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF)
 endef
 else
 define run
        @cd $(STARTUP_DIR) && \
-         $(SUDO) $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//')
+         $(SUDO) LD_LIBRARY_PATH=$(VPP_OPT_DEPS_LIBRARY_PATH) $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//')
 endef
 endif
 
index 445087d..3949d31 100644 (file)
@@ -73,6 +73,11 @@ ifeq ($(V),)
 V=0
 endif
 
+MACHINE=$(shell uname -m)
+ifeq ($(shell test -d /opt/vpp/optional/${MACHINE}/lib64 && echo yes),yes)
+VPP_OPT_DEPS_LIBRARY_PATH?=/opt/vpp/optional/${MACHINE}/lib64
+endif
+
 PYTHON_VERSION=$(shell $(PYTHON_INTERP) -c 'import sys; print(sys.version_info.major)')
 PIP_VERSION=25.0.1
 # Keep in sync with requirements.txt
@@ -266,6 +271,12 @@ else
 ARG19=
 endif
 
+ifneq ($(VPP_OPT_DEPS_LIBRARY_PATH),)
+ARG20=--vpp-opt-deps-library-path=$(VPP_OPT_DEPS_LIBRARY_PATH)
+else
+ARG20=
+endif
+
 EXC_PLUGINS_ARG=
 ifneq ($(VPP_EXCLUDED_PLUGINS),)
 # convert the comma-separated list into N invocations of the argument to exclude a plugin
@@ -274,7 +285,7 @@ endif
 
 
 
-EXTRA_ARGS=$(ARG0) $(ARG1) $(ARG2) $(ARG3) $(ARG4) $(ARG5) $(ARG6) $(ARG7) $(ARG8) $(ARG9) $(ARG10) $(ARG11) $(ARG12) $(ARG13) $(ARG14) $(ARG15) $(ARG16) $(ARG17) $(ARG18) $(ARG19)
+EXTRA_ARGS=$(ARG0) $(ARG1) $(ARG2) $(ARG3) $(ARG4) $(ARG5) $(ARG6) $(ARG7) $(ARG8) $(ARG9) $(ARG10) $(ARG11) $(ARG12) $(ARG13) $(ARG14) $(ARG15) $(ARG16) $(ARG17) $(ARG18) $(ARG19) $(ARG20)
 
 RUN_TESTS_ARGS=--failed-dir=$(FAILED_DIR) --verbose=$(V) --jobs=$(TEST_JOBS) --filter=$(TEST) --skip-filter=$(SKIP_TESTS) --retries=$(RETRIES) --venv-dir=$(VENV_PATH) --vpp-ws-dir=$(WS_ROOT) --vpp-tag=$(TAG) --rnd-seed=$(RND_SEED) --vpp-worker-count="$(VPP_WORKER_COUNT)" --keep-pcaps $(PLUGIN_PATH_ARGS) $(EXC_PLUGINS_ARG) $(TEST_PLUGIN_PATH_ARGS) $(EXTRA_ARGS)
 RUN_SCRIPT_ARGS=--python-opts=$(PYTHON_OPTS)
index 2870c55..6819bf2 100644 (file)
@@ -349,6 +349,13 @@ parser.add_argument(
     help="max cpus used by vpp",
 )
 
+parser.add_argument(
+    "--vpp-opt-deps-library-path",
+    action="store",
+    default=None,
+    help="path to vpp-opt-deps library directory",
+)
+
 variant_help_string = """\
 specify which march node variant to unit test
   e.g. --variant=skx - test the skx march variants