From: Pierre Pfister Date: Fri, 7 Oct 2016 15:30:03 +0000 (+0100) Subject: Test Infra: Add plugin support X-Git-Tag: v17.01-rc0~114 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=cd8e318a7656c84ab1ff02090bf1616ca7513fdc;p=vpp.git Test Infra: Add plugin support This patch adds plugin path to vpp commandline arguments when 'make test' is run. Hence, test cases can test plugins. Change-Id: Ib90efa1f62e03b45b84533c49c7a5d040aa8cddf Signed-off-by: Pierre Pfister --- diff --git a/Makefile b/Makefile index 3db644e037d..4b7170d27ff 100644 --- a/Makefile +++ b/Makefile @@ -192,6 +192,7 @@ define test @make -C test \ VPP_TEST_BIN=$(BR)/install-$(1)-native/vpp/bin/vpp \ VPP_TEST_API_TEST_BIN=$(BR)/install-$(1)-native/vpp-api-test/bin/vpp_api_test \ + VPP_TEST_PLUGIN_PATH=$(BR)/install-$(1)-native/plugins/lib64/vpp_plugins \ V=$(V) TEST=$(TEST) endef @@ -199,14 +200,14 @@ test: ifeq ($(OS_ID),ubuntu) @sudo -E apt-get $(CONFIRM) $(FORCE) install python-dev python-scapy endif - @make -C $(BR) PLATFORM=vpp_lite TAG=vpp_lite vpp-install vpp-api-test-install + @make -C $(BR) PLATFORM=vpp_lite TAG=vpp_lite plugins-install vpp-install vpp-api-test-install $(call test,vpp_lite) test-debug: ifeq ($(OS_ID),ubuntu) @sudo -E apt-get $(CONFIRM) $(FORCE) install python-dev python-scapy endif - @make -C $(BR) PLATFORM=vpp_lite TAG=vpp_lite_debug vpp-install vpp-api-test-install + @make -C $(BR) PLATFORM=vpp_lite TAG=vpp_lite_debug plugins-install vpp-install vpp-api-test-install $(call test,vpp_lite_debug) retest: diff --git a/test/framework.py b/test/framework.py index 0ee266ec843..8bfb55132b2 100644 --- a/test/framework.py +++ b/test/framework.py @@ -58,10 +58,14 @@ class VppTestCase(unittest.TestCase): @classmethod def setUpConstants(cls): cls.vpp_bin = os.getenv('VPP_TEST_BIN', "vpp") + cls.plugin_path = os.getenv('VPP_TEST_PLUGIN_PATH') cls.vpp_api_test_bin = os.getenv("VPP_TEST_API_TEST_BIN", "vpp-api-test") cls.vpp_cmdline = [cls.vpp_bin, "unix", "nodaemon", "api-segment", "{", "prefix", "unittest", "}"] + if cls.plugin_path is not None: + cls.vpp_cmdline.extend(["plugin_path", cls.plugin_path]) + cls.vpp_api_test_cmdline = [cls.vpp_api_test_bin, "chroot", "prefix", "unittest"] try: