[V1] framework/tester: optimize scripts

Message ID 20230712141406.978846-1-songx.jiale@intel.com (mailing list archive)
State New
Headers
Series [V1] framework/tester: optimize scripts |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test success Testing OK

Commit Message

Jiale Song July 12, 2023, 2:14 p.m. UTC
  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@intel.com>
---
 framework/tester.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

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()