summaryrefslogtreecommitdiff
path: root/dts/framework/remote_session/testpmd_shell.py
diff options
context:
space:
mode:
authorJeremy Spewock <[email protected]>2024-07-11 12:34:10 -0400
committerThomas Monjalon <[email protected]>2024-07-23 23:59:18 +0200
commit92439dc9ac51529de448f4484864e2ef7b1bc07c (patch)
treee5678429c8d3481354bbfa9469d2579a4baa447c /dts/framework/remote_session/testpmd_shell.py
parent2b648cd4e4f87cffb54d814dbacf860c014d4713 (diff)
dts: improve starting and stopping interactive shells
The InteractiveShell class currently relies on being cleaned up and shutdown at the time of garbage collection, but this cleanup of the class does no verification that the session is still running prior to cleanup. So, if a user were to call this method themselves prior to garbage collection, it would be called twice and throw an exception when the desired behavior is to do nothing since the session is already cleaned up. This is solved by using a weakref and a finalize class which achieves the same result of calling the method at garbage collection, but also ensures that it is called exactly once. Additionally, this fixes issues regarding starting a primary DPDK application while another is still cleaning up via a retry when starting interactive shells. It also adds catch for attempting to send a command to an interactive shell that is not running to create a more descriptive error message. Signed-off-by: Jeremy Spewock <[email protected]> Reviewed-by: Luca Vizzarro <[email protected]> Reviewed-by: Patrick Robb <[email protected]> Reviewed-by: Juraj Linkeš <[email protected]> Tested-by: Dean Marx <[email protected]>
Diffstat (limited to 'dts/framework/remote_session/testpmd_shell.py')
-rw-r--r--dts/framework/remote_session/testpmd_shell.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index f54a745185..eda6eb320f 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -807,5 +807,5 @@ class TestPmdShell(DPDKShell):
def _close(self) -> None:
"""Overrides :meth:`~.interactive_shell.close`."""
self.stop()
- self.send_command("quit", "")
+ self.send_command("quit", "Bye...")
return super()._close()