From b497d9ffe3f143aec2e37cbde5bbcd1fa5052e11 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Wed, 6 Aug 2025 11:46:00 -0400 Subject: [PATCH] tests: add vpp-opt-deps to vpp LD_LIBRARY_PATH - 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 --- Makefile | 8 ++++++-- test/Makefile | 13 ++++++++++++- test/config.py | 7 +++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 792d5c4bf80..a7ce9986e58 100644 --- 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 diff --git a/test/Makefile b/test/Makefile index 445087d7ff8..3949d31c511 100644 --- a/test/Makefile +++ b/test/Makefile @@ -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) diff --git a/test/config.py b/test/config.py index 2870c55df05..6819bf2cb45 100644 --- a/test/config.py +++ b/test/config.py @@ -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 -- 2.16.6