summaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-10-16 04:20:13 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-01 09:28:06 +0000
commit812ed39f9da336310e815c361ab5a9f118657d94 (patch)
tree9d8cddc917acbb65b3dc401d880d5eb2a7f392c6 /test/framework.py
parent14edd97c20735ffd1c24000a7df78e154ac61478 (diff)
VPP Object Model (VOM)
The VOM is a C++ library for use by clients/agents of VPP for programming state. It uses the binary APIs to do so. Various other common client side functions are also provided. Please see om.hpp for a more detailed description. Change-Id: Ib756bfe99817093815a9e26ccf464aa5583fc523 Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Co-authored-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/framework.py b/test/framework.py
index 6446265773d..0c85bfbfcf5 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -1051,3 +1051,33 @@ class VppTestRunner(unittest.TextTestRunner):
if not running_extended_tests():
print("Not running extended tests (some tests will be skipped)")
return super(VppTestRunner, self).run(filtered)
+
+
+class Worker(Thread):
+ def __init__(self, args, logger):
+ self.logger = logger
+ self.args = args
+ self.result = None
+ super(Worker, self).__init__()
+
+ def run(self):
+ executable = self.args[0]
+ self.logger.debug("Running executable w/args `%s'" % self.args)
+ env = os.environ.copy()
+ env["CK_LOG_FILE_NAME"] = "-"
+ self.process = subprocess.Popen(
+ self.args, shell=False, env=env, preexec_fn=os.setpgrp,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out, err = self.process.communicate()
+ self.logger.debug("Finished running `%s'" % executable)
+ self.logger.info("Return code is `%s'" % self.process.returncode)
+ self.logger.info(single_line_delim)
+ self.logger.info("Executable `%s' wrote to stdout:" % executable)
+ self.logger.info(single_line_delim)
+ self.logger.info(out)
+ self.logger.info(single_line_delim)
+ self.logger.info("Executable `%s' wrote to stderr:" % executable)
+ self.logger.info(single_line_delim)
+ self.logger.error(err)
+ self.logger.info(single_line_delim)
+ self.result = self.process.returncode