aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2021-05-20 14:01:51 -0400
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2021-05-21 15:21:01 +0000
commit4ee17d859ed2f374997939511078559c26981ad0 (patch)
treec9b44351bac6113a0aea29aed21bf64cda58a449
parente2353a7f6c680ef50bc41892a4503168406b7787 (diff)
tests: add role to VCLAppWorker
- Improve readability of log output with respect to worker role Type: test Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I1a5787421b31483fa1a2558951568417dfc111d9
-rwxr-xr-xtest/framework.py5
-rwxr-xr-x[-rw-r--r--]test/test_vcl.py12
2 files changed, 9 insertions, 8 deletions
diff --git a/test/framework.py b/test/framework.py
index 0acc1603bd4..c2a2fc68430 100755
--- a/test/framework.py
+++ b/test/framework.py
@@ -1721,8 +1721,9 @@ class Worker(Thread):
self.result = os.EX_OSFILE
raise EnvironmentError(
"executable '%s' is not found or executable." % executable)
- self.logger.debug("Running executable: '{app}'"
- .format(app=' '.join(self.args)))
+ self.logger.debug("Running executable '{app}': '{cmd}'"
+ .format(app=self.app_name,
+ cmd=' '.join(self.args)))
env = os.environ.copy()
env.update(self.env)
env["CK_LOG_FILE_NAME"] = "-"
diff --git a/test/test_vcl.py b/test/test_vcl.py
index 63dd3130e7f..2688816d42a 100644..100755
--- a/test/test_vcl.py
+++ b/test/test_vcl.py
@@ -27,8 +27,8 @@ class VCLAppWorker(Worker):
""" VCL Test Application Worker """
def __init__(self, build_dir, appname, executable_args, logger, env=None,
- *args, **kwargs):
-
+ role=None, *args, **kwargs):
+ self.role = role
if env is None:
env = {}
vcl_lib_dir = "%s/vpp/lib" % build_dir
@@ -90,11 +90,11 @@ class VCLTestCase(VppTestCase):
self.env = {'VCL_VPP_API_SOCKET': self.get_api_sock_path(),
'VCL_APP_SCOPE_LOCAL': "true"}
worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
- self.logger, self.env)
+ self.logger, self.env, "server")
worker_server.start()
self.sleep(self.pre_test_sleep)
worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
- self.logger, self.env)
+ self.logger, self.env, "client")
worker_client.start()
worker_client.join(self.timeout)
try:
@@ -198,14 +198,14 @@ class VCLTestCase(VppTestCase):
'VCL_APP_NAMESPACE_SECRET': "1234"}
worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
- self.logger, self.env)
+ self.logger, self.env, "server")
worker_server.start()
self.sleep(self.pre_test_sleep)
self.env.update({'VCL_APP_NAMESPACE_ID': "2",
'VCL_APP_NAMESPACE_SECRET': "5678"})
worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
- self.logger, self.env)
+ self.logger, self.env, "client")
worker_client.start()
worker_client.join(self.timeout)