Improve debug-cli in test framework
Opening debug-cli only makes sense if there is time for user to use it, so either the run must be debugged or stepped. Only open the debug-cli in these cases. Change-Id: Ied276071797a549880d730cda43c59230a412efe Signed-off-by: Klement Sekera <ksekera@cisco.com>
This commit is contained in:

committed by
Damjan Marion

parent
446e1f577b
commit
01bbbe91fa
@ -113,8 +113,10 @@ class VppTestCase(unittest.TestCase):
|
|||||||
cls.set_debug_flags(d)
|
cls.set_debug_flags(d)
|
||||||
cls.vpp_bin = os.getenv('VPP_TEST_BIN', "vpp")
|
cls.vpp_bin = os.getenv('VPP_TEST_BIN', "vpp")
|
||||||
cls.plugin_path = os.getenv('VPP_TEST_PLUGIN_PATH')
|
cls.plugin_path = os.getenv('VPP_TEST_PLUGIN_PATH')
|
||||||
cls.vpp_cmdline = [cls.vpp_bin, "unix", "{", "nodaemon",
|
debug_cli = ""
|
||||||
"cli-listen localhost:5002", "}",
|
if cls.step or cls.debug_gdb or cls.debug_gdbserver:
|
||||||
|
debug_cli = "cli-listen localhost:5002"
|
||||||
|
cls.vpp_cmdline = [cls.vpp_bin, "unix", "{", "nodaemon", debug_cli, "}",
|
||||||
"api-segment", "{", "prefix", cls.shm_prefix, "}"]
|
"api-segment", "{", "prefix", cls.shm_prefix, "}"]
|
||||||
if cls.plugin_path is not None:
|
if cls.plugin_path is not None:
|
||||||
cls.vpp_cmdline.extend(["plugin_path", cls.plugin_path])
|
cls.vpp_cmdline.extend(["plugin_path", cls.plugin_path])
|
||||||
|
@ -73,7 +73,7 @@ class PollHook(Hook):
|
|||||||
raise Exception("GDB refused to die...")
|
raise Exception("GDB refused to die...")
|
||||||
|
|
||||||
def on_crash(self, core_path):
|
def on_crash(self, core_path):
|
||||||
if self.testcase.interactive:
|
if self.testcase.debug_core:
|
||||||
gdb_path = '/usr/bin/gdb'
|
gdb_path = '/usr/bin/gdb'
|
||||||
if os.path.isfile(gdb_path) and os.access(gdb_path, os.X_OK):
|
if os.path.isfile(gdb_path) and os.access(gdb_path, os.X_OK):
|
||||||
# automatically attach gdb
|
# automatically attach gdb
|
||||||
|
Reference in New Issue
Block a user