From 47e275bbe4327aabc641e917f738d72693eb2d81 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Tue, 21 Mar 2017 08:21:25 +0100 Subject: [PATCH] make test: support out-of-tree plugins usage: env EXTERN_PLUGINS=/path/to/plugins make test Change-Id: I8eece726dfafeff1cffd921c1e18cd3eb7eb64ed Signed-off-by: Klement Sekera --- test/Makefile | 4 ++++ test/framework.py | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/Makefile b/test/Makefile index c65eaae6bfe..6647d67b20b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -92,6 +92,8 @@ shell: verify-python-path $(PAPI_INSTALL_DONE) echo VPP_TEST_BIN=$(VPP_TEST_BIN);\ echo VPP_TEST_PLUGIN_PATH=$(VPP_TEST_PLUGIN_PATH);\ echo VPP_TEST_INSTALL_PATH=$(VPP_TEST_INSTALL_PATH);\ + echo EXTERN_TESTS=$(EXTERN_TESTS);\ + echo EXTERN_PLUGINS=$(EXTERN_PLUGINS);\ echo LD_LIBRARY_PATH=$(LD_LIBRARY_PATH);\ echo '***';\ exec - pass as unix { coredump-size } argument to vpp" @echo " e.g. COREDUMP_SIZE=4g" @echo " COREDUMP_SIZE=unlimited" + @echo " EXTERN_TESTS= - path to out-of-tree test_.py files containing test cases" + @echo " EXTERN_PLUGINS=- path to out-of-tree plugins to be loaded by vpp under test" @echo "" @echo "Creating test documentation" @echo " test-doc - generate documentation for test framework" diff --git a/test/framework.py b/test/framework.py index d7a0026412b..fe6a8a531f4 100644 --- a/test/framework.py +++ b/test/framework.py @@ -146,6 +146,14 @@ class VppTestCase(unittest.TestCase): cls.set_debug_flags(d) cls.vpp_bin = os.getenv('VPP_TEST_BIN', "vpp") cls.plugin_path = os.getenv('VPP_TEST_PLUGIN_PATH') + cls.extern_plugin_path = os.getenv('EXTERN_PLUGINS') + plugin_path = None + if cls.plugin_path is not None: + if cls.extern_plugin_path is not None: + plugin_path = "%s:%s" % ( + cls.plugin_path, cls.extern_plugin_path) + elif cls.extern_plugin_path is not None: + plugin_path = cls.extern_plugin_path debug_cli = "" if cls.step or cls.debug_gdb or cls.debug_gdbserver: debug_cli = "cli-listen localhost:5002" @@ -164,8 +172,8 @@ class VppTestCase(unittest.TestCase): "api-segment", "{", "prefix", cls.shm_prefix, "}", "plugins", "{", "plugin", "dpdk_plugin.so", "{", "disable", "}", "}"] - if cls.plugin_path is not None: - cls.vpp_cmdline.extend(["plugin_path", cls.plugin_path]) + if plugin_path is not None: + cls.vpp_cmdline.extend(["plugin_path", plugin_path]) cls.logger.info("vpp_cmdline: %s" % cls.vpp_cmdline) @classmethod -- 2.16.6