X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fdebug.py;h=d77fd87f3e5a6764479a5eeff49672f8920cefb0;hb=73f23a806de8be8aa0cba60c3975ca3dcf92d3a5;hp=a911a78b47fe532e6debb00df4730c98a1c86663;hpb=1dc146efae42171c5aa23dab2918e130046ab62c;p=vpp.git diff --git a/test/debug.py b/test/debug.py index a911a78b47f..d77fd87f3e5 100644 --- a/test/debug.py +++ b/test/debug.py @@ -6,9 +6,9 @@ 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' +gdb_path = "/usr/bin/gdb" def spawn_gdb(binary_path, core_path): @@ -24,8 +24,9 @@ def spawn_gdb(binary_path, core_path): if gdb.isalive(): raise Exception("GDB refused to die...") else: - sys.stderr.write("Debugger '%s' does not exist or is not " - "an executable..\n" % gdb_path) + sys.stderr.write( + "Debugger '%s' does not exist or is not an executable..\n" % gdb_path + ) def start_vpp_in_gdb(): @@ -33,21 +34,11 @@ 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.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.") @@ -63,5 +54,6 @@ def start_vpp_in_gdb(): if gdb.isalive(): raise Exception("GDB refused to die...") else: - sys.stderr.write("Debugger '%s' does not exist or is not " - "an executable..\n" % gdb_path) + sys.stderr.write( + "Debugger '%s' does not exist or is not an executable..\n" % gdb_path + )