[V2] framework/tester closing scapy session raise exception
diff mbox series

Message ID 20201026153513.137685-1-thinhtr@linux.vnet.ibm.com
State Accepted
Headers show
Series
  • [V2] framework/tester closing scapy session raise exception
Related show

Commit Message

Thinh Tran Oct. 26, 2020, 3:35 p.m. UTC
v1:
  Sending control "^c" during  closing the scapy sessions raised the time-
  out exception for expecting scapy prompt ">>> " return causing the failure
  during setup.
  Simply sending "quit" to exit scapy gratefully instead.

  v2: 
  Sending "quit()" function insteadt of "quit"

Signed-off-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
---
 framework/tester.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Tu, Lijuan Oct. 27, 2020, 9:07 a.m. UTC | #1
>   v1:
>   Sending control "^c" during  closing the scapy sessions raised the time-
>   out exception for expecting scapy prompt ">>> " return causing the failure
>   during setup.
>   Simply sending "quit" to exit scapy gratefully instead.
> 
>   v2:
>   Sending "quit()" function insteadt of "quit"
> 
> Signed-off-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>

Applied with comments changed.

Patch
diff mbox series

diff --git a/framework/tester.py b/framework/tester.py
index ca179b2..c515123 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -868,8 +868,7 @@  class Tester(Crb):
         if self.scapy_sessions_li:
             for i in self.scapy_sessions_li:
                 if i.session.isalive():
-                    i.session.send_expect("^c", ">>> ", timeout=2)
-                    i.session.send_expect("^d", "#", timeout=2)
+                    i.session.send_expect("quit()", "#", timeout=2)
                     i.session.close()
             self.scapy_sessions_li.clear()