[dts] [PATCH V1] framework/tester: optimize scripts

Jiale Song songx.jiale at intel.com
Wed Jul 12 16:14:06 CEST 2023


timed out execution of Scapy "quit()" command will cause dts to end running.
method of reducing command timeout:
1. increase timeout time.
2. ensure that the "quit()" command line is executed in scapy.


Signed-off-by: Jiale Song <songx.jiale at intel.com>
---
 framework/tester.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/framework/tester.py b/framework/tester.py
index 5e6c72ad..d577c29e 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -866,7 +866,9 @@ class Tester(Crb):
         if self.scapy_sessions_li:
             for i in self.scapy_sessions_li:
                 if i.session.isalive():
-                    i.session.send_expect("quit()", "#", timeout=2)
+                    out = i.session.send_command("^C")
+                    if ">>>" in out:
+                        i.session.send_expect("quit()", "# ", timeout=5)
                     i.session.close()
             self.scapy_sessions_li.clear()
 
-- 
2.25.1



More information about the dts mailing list