diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/framework.py | 20 | ||||
-rwxr-xr-x | test/test_vcl.py | 24 |
2 files changed, 23 insertions, 21 deletions
diff --git a/test/framework.py b/test/framework.py index 731c5e18043..aa533f7b641 100755 --- a/test/framework.py +++ b/test/framework.py @@ -415,18 +415,7 @@ class VppTestCase(CPUInterface, unittest.TestCase): c = os.getenv("CACHE_OUTPUT", "1") cls.cache_vpp_output = False if c.lower() in ("n", "no", "0") else True cls.vpp_bin = os.getenv('VPP_BIN', "vpp") - cls.plugin_path = os.getenv('VPP_PLUGIN_PATH') - cls.test_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) - else: - plugin_path = cls.plugin_path - elif cls.extern_plugin_path is not None: - plugin_path = cls.extern_plugin_path + extern_plugin_path = os.getenv('EXTERN_PLUGINS') debug_cli = "" if cls.step or cls.debug_gdb or cls.debug_gdbserver: debug_cli = "cli-listen localhost:5002" @@ -454,6 +443,9 @@ class VppTestCase(CPUInterface, unittest.TestCase): "api-trace", "{", "on", "}", "api-segment", "{", "prefix", cls.get_api_segment_prefix(), "}", "cpu", "{", "main-core", str(cls.cpus[0]), ] + if extern_plugin_path is not None: + cls.extra_vpp_plugin_config.append( + "add-path %s" % extern_plugin_path) if cls.get_vpp_worker_count(): cls.vpp_cmdline.extend([ "corelist-workers", ",".join([str(x) for x in cls.cpus[1:]])]) @@ -473,10 +465,6 @@ class VppTestCase(CPUInterface, unittest.TestCase): if cls.extra_vpp_punt_config is not None: cls.vpp_cmdline.extend(cls.extra_vpp_punt_config) - if plugin_path is not None: - cls.vpp_cmdline.extend(["plugin_path", plugin_path]) - if cls.test_plugin_path is not None: - cls.vpp_cmdline.extend(["test_plugin_path", cls.test_plugin_path]) if not cls.debug_attach: cls.logger.info("vpp_cmdline args: %s" % cls.vpp_cmdline) diff --git a/test/test_vcl.py b/test/test_vcl.py index 68322651eb8..50d36d5317d 100755 --- a/test/test_vcl.py +++ b/test/test_vcl.py @@ -5,6 +5,7 @@ import unittest import os import subprocess import signal +import glob from framework import VppTestCase, VppTestRunner, running_extended_tests, \ Worker from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath, FibPathProto @@ -26,20 +27,33 @@ _have_iperf3 = have_app(iperf3) class VCLAppWorker(Worker): """ VCL Test Application Worker """ + libname = "libvcl_ldpreload.so" + + class LibraryNotFound(Exception): + pass + def __init__(self, build_dir, appname, executable_args, logger, env=None, role=None, *args, **kwargs): self.role = role + vpp_install_path = os.getenv('VPP_INSTALL_PATH') + + vcl_ldpreload_glob = "{}/**/{}".format(vpp_install_path, self.libname) + vcl_ldpreload_so = glob.glob(vcl_ldpreload_glob, recursive=True) + + if len(vcl_ldpreload_so) < 1: + raise LibraryNotFound("cannot locate library: {}".format( + self.libname)) + + vcl_ldpreload_so = vcl_ldpreload_so[0] + if env is None: env = {} - vcl_lib_dir = "%s/vpp/lib" % build_dir if "iperf" in appname: app = appname - env.update({'LD_PRELOAD': - "%s/libvcl_ldpreload.so" % vcl_lib_dir}) + env.update({'LD_PRELOAD': vcl_ldpreload_so}) elif "sock" in appname: app = "%s/vpp/bin/%s" % (build_dir, appname) - env.update({'LD_PRELOAD': - "%s/libvcl_ldpreload.so" % vcl_lib_dir}) + env.update({'LD_PRELOAD': vcl_ldpreload_so}) else: app = "%s/vpp/bin/%s" % (build_dir, appname) self.args = [app] + executable_args |