summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-04 19:43:53 -0500
committerDave Wallace <dwallacelf@gmail.com>2020-01-14 19:33:23 +0000
commit48bdbcd8f9d573138c43f994ddfff946d8a9d9b5 (patch)
tree51bd7c72590aca03069b4c799535500d193b9877 /src
parent57584d99dd8a8524db90c67c88525d58879d9b8e (diff)
tests: fix worker thread initialization
from threading.thread __init__: This constructor should always be called with keyword arguments. If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread. Type: test Change-Id: Ifa89202e97053a4baf19e9a0ca0913430d5087a3 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/quic/test/test_quic.py11
-rw-r--r--src/vcl/test/test_vcl.py11
2 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/quic/test/test_quic.py b/src/plugins/quic/test/test_quic.py
index 152fa5ecd4a..4534c8e1720 100644
--- a/src/plugins/quic/test/test_quic.py
+++ b/src/plugins/quic/test/test_quic.py
@@ -14,14 +14,17 @@ class QUICAppWorker(Worker):
""" QUIC Test Application Worker """
process = None
- def __init__(self, build_dir, appname, args, logger, role, testcase,
- env={}):
+ def __init__(self, build_dir, appname, executable_args, logger, role,
+ testcase, env=None, *args, **kwargs):
+ if env is None:
+ env = {}
app = "%s/vpp/bin/%s" % (build_dir, appname)
- self.args = [app] + args
+ self.args = [app] + executable_args
self.role = role
self.wait_for_gdb = 'wait-for-gdb'
self.testcase = testcase
- super(QUICAppWorker, self).__init__(self.args, logger, env)
+ super(QUICAppWorker, self).__init__(self.args, logger, env,
+ *args, **kwargs)
def run(self):
super(QUICAppWorker, self).run()
diff --git a/src/vcl/test/test_vcl.py b/src/vcl/test/test_vcl.py
index 804e7457555..d7a44ed7d1e 100644
--- a/src/vcl/test/test_vcl.py
+++ b/src/vcl/test/test_vcl.py
@@ -26,7 +26,11 @@ _have_iperf3 = have_app(iperf3)
class VCLAppWorker(Worker):
""" VCL Test Application Worker """
- def __init__(self, build_dir, appname, args, logger, env={}):
+ def __init__(self, build_dir, appname, executable_args, logger, env=None,
+ *args, **kwargs):
+
+ if env is None:
+ env = {}
vcl_lib_dir = "%s/vpp/lib" % build_dir
if "iperf" in appname:
app = appname
@@ -38,8 +42,9 @@ class VCLAppWorker(Worker):
"%s/libvcl_ldpreload.so" % vcl_lib_dir})
else:
app = "%s/vpp/bin/%s" % (build_dir, appname)
- self.args = [app] + args
- super(VCLAppWorker, self).__init__(self.args, logger, env)
+ self.args = [app] + executable_args
+ super(VCLAppWorker, self).__init__(self.args, logger, env,
+ *args, **kwargs)
class VCLTestCase(VppTestCase):