diff options
author | Klement Sekera <ksekera@cisco.com> | 2021-05-31 16:08:53 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2022-02-17 18:02:35 +0000 |
commit | b23ffd7ef216463c35b75c831e6a27e58971f4ec (patch) | |
tree | 84983bd698b2b3da6c6278e870ef978f69dbda43 /test/debug.py | |
parent | 8ccc6b350703d3390633636d2b1c2f578f37cb21 (diff) |
tests: make tests less make dependent
Implement command line argument parsing instead of passing arguments via
environment variables. Add script for running tests without having to
invoke make. Deprecate running tests via make.
Type: improvement
Change-Id: I2e3054a61a2ae25d460e9be00be7d7705fbf943e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'test/debug.py')
-rw-r--r-- | test/debug.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/test/debug.py b/test/debug.py index a911a78b47f..0ab143201c8 100644 --- a/test/debug.py +++ b/test/debug.py @@ -6,7 +6,7 @@ import sys from sanity_run_vpp import SanityTestCase from shutil import rmtree -from cpu_config import available_cpus +from config import available_cpus gdb_path = '/usr/bin/gdb' @@ -33,21 +33,12 @@ def start_vpp_in_gdb(): # but any test case class could be used ... SanityTestCase.set_debug_flags("attach") SanityTestCase.tempdir = SanityTestCase.get_tempdir() - if os.path.exists(SanityTestCase.tempdir): - if os.getenv("VPP_IN_GDB_NO_RMDIR", "0") in ["1", "y", "yes"]: - raise FileExistsError( - "Temporary directory exists and removal denied.") - print("Removing existing temp dir '%s'." % SanityTestCase.tempdir) - rmtree(SanityTestCase.tempdir) - print("Creating temp dir '%s'." % SanityTestCase.tempdir) - os.mkdir(SanityTestCase.tempdir) SanityTestCase.assign_cpus( available_cpus[:SanityTestCase.get_cpus_required()]) SanityTestCase.setUpConstants() vpp_cmdline = SanityTestCase.vpp_cmdline - if os.getenv("VPP_IN_GDB_CMDLINE", "y").lower() in ["1", "y", "yes"]: - print("Hacking cmdline to make VPP interactive.") - vpp_cmdline.insert(vpp_cmdline.index("nodaemon"), "interactive") + print("Hacking cmdline to make VPP interactive.") + vpp_cmdline.insert(vpp_cmdline.index("nodaemon"), "interactive") print("VPP cmdline is %s" % " ".join(vpp_cmdline)) print("Running GDB.") |