summaryrefslogtreecommitdiffstats
path: root/test/run.py
diff options
context:
space:
mode:
authorNaveen Joy <najoy@cisco.com>2022-10-04 14:22:05 -0700
committerDave Wallace <dwallacelf@gmail.com>2022-12-13 01:43:01 +0000
commite416893a597959509c7f667c140c271c0bb78c14 (patch)
treec294b99cfe1890415c8a14968caf358182b6a4ca /test/run.py
parentd3ccb0c2fba3e3f8b2eca7b2e1a1fe2877eb993b (diff)
tests: tapv2, tunv2 and af_packet interface tests for vpp
Tests gso/gro-coalesce features on tapv2, tunv2 and af_packet interfaces to ensure that packet transmission is enabled correctly for various MTU sizes and interface combinations in bridged and routed topologies for IPv4 and IPv6. Interface tests are dynamically generated at run time from the config file vm_test_config.py. Type: test Change-Id: I5f9d8cc80d20b4e34011fc8a87e35659bd9613bc Signed-off-by: Naveen Joy <najoy@cisco.com>
Diffstat (limited to 'test/run.py')
-rwxr-xr-xtest/run.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/test/run.py b/test/run.py
index 58112fd790c..93391a7e9cc 100755
--- a/test/run.py
+++ b/test/run.py
@@ -26,6 +26,7 @@ import sys
import time
import venv
import datetime
+import re
# Required Std. Path Variables
@@ -64,10 +65,15 @@ signal.signal(signal.SIGINT, handler)
signal.signal(signal.SIGTERM, handler)
-def show_progress(stream):
+def show_progress(stream, exclude_pattern=None):
"""
Read lines from a subprocess stdout/stderr streams and write
to sys.stdout & the logfile
+
+ arguments:
+ stream - subprocess stdout or stderr data stream
+ exclude_pattern - lines matching this reg-ex will be excluded
+ from stdout.
"""
while True:
s = stream.readline()
@@ -77,7 +83,11 @@ def show_progress(stream):
# Filter the annoying SIGTERM signal from the output when VPP is
# terminated after a test run
if "SIGTERM" not in data:
- sys.stdout.write(data)
+ if exclude_pattern is not None:
+ if bool(re.search(exclude_pattern, data)) is False:
+ sys.stdout.write(data)
+ else:
+ sys.stdout.write(data)
logging.debug(data)
sys.stdout.flush()
stream.close()
@@ -222,10 +232,13 @@ def vm_test_runner(test_name, kernel_image, test_data_dir, cpu_mask, mem, jobs="
p = Popen(
[script, test_name, kernel_image, test_data_dir, cpu_mask, mem],
stdout=PIPE,
- stderr=STDOUT,
cwd=ws_root,
)
- show_progress(p.stdout)
+ # Show only the test result without clobbering the stdout.
+ # The VM console displays VPP stderr & Linux IPv6 netdev change
+ # messages, which is logged by default and can be excluded.
+ exclude_pattern = r"vpp\[\d+\]:|ADDRCONF\(NETDEV_CHANGE\):"
+ show_progress(p.stdout, exclude_pattern)
post_vm_test_run()
@@ -304,6 +317,7 @@ def run_tests_in_venv(
f"--jobs={jobs}",
f"--log-dir={log_dir}",
f"--tmp-dir={log_dir}",
+ f"--cache-vpp-output",
]
if running_vpp:
args = args + [f"--use-running-vpp"]