summaryrefslogtreecommitdiffstats
path: root/test/run_tests.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-03-16 12:52:12 +0100
committerOle Tr�an <otroan@employees.org>2021-04-12 10:11:36 +0000
commite263685ac82454c39eee6e2a2146dd1e02d61de8 (patch)
tree54110ae98ed5618a057859019d518ed35e76423a /test/run_tests.py
parent3ff6ffce032544b4ffc3e42b5e069243681ae751 (diff)
tests: support attaching to existing vpp
Introduce a new option DEBUG=attach to run a test against existing already running vpp. A new target 'make test-start-gdb' will spawn VPP in gdb for this purpose. Customization options explained in test-help. Type: improvement Change-Id: Ia160a85b33da3b2df292d44bb95729af9dd9da96 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/run_tests.py')
-rw-r--r--test/run_tests.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/run_tests.py b/test/run_tests.py
index 59c9d83d512..008828c1e86 100644
--- a/test/run_tests.py
+++ b/test/run_tests.py
@@ -19,7 +19,7 @@ import framework
from framework import VppTestRunner, running_extended_tests, VppTestCase, \
get_testcase_doc_name, get_test_description, PASS, FAIL, ERROR, SKIP, \
TEST_RUN
-from debug import spawn_gdb
+from debug import spawn_gdb, start_vpp_in_gdb
from log import get_parallel_logger, double_line_delim, RED, YELLOW, GREEN, \
colorize, single_line_delim
from discover_tests import discover_tests
@@ -779,11 +779,15 @@ if __name__ == '__main__':
retries = parse_digit_env("RETRIES", 0)
- debug = os.getenv("DEBUG", "n").lower() in ["gdb", "gdbserver"]
+ debug = os.getenv("DEBUG", "n").lower() in ["gdb", "gdbserver", "attach"]
debug_core = os.getenv("DEBUG", "").lower() == "core"
compress_core = framework.BoolEnvironmentVariable("CORE_COMPRESS")
+ if os.getenv("VPP_IN_GDB", "n").lower() in ["1", "y", "yes"]:
+ start_vpp_in_gdb()
+ exit()
+
step = framework.BoolEnvironmentVariable("STEP")
force_foreground = framework.BoolEnvironmentVariable("FORCE_FOREGROUND")
@@ -815,8 +819,9 @@ if __name__ == '__main__':
if run_interactive and concurrent_tests > 1:
raise NotImplementedError(
- 'Running tests interactively (DEBUG is gdb or gdbserver or STEP '
- 'is set) in parallel (TEST_JOBS is more than 1) is not supported')
+ 'Running tests interactively (DEBUG is gdb[server] or ATTACH or '
+ 'STEP is set) in parallel (TEST_JOBS is more than 1) is not '
+ 'supported')
parser = argparse.ArgumentParser(description="VPP unit tests")
parser.add_argument("-f", "--failfast", action='store_true',