mirror of
https://github.com/espressif/openthread.git
synced 2026-08-25 03:39:52 +00:00
[test] save packets as pcap file in thread-cert tests (#2965)
This commit is contained in:
@@ -108,11 +108,15 @@ class otCli:
|
||||
self.pexpect = fdpexpect.fdspawn(os.open(serialPort, os.O_RDWR|os.O_NONBLOCK|os.O_NOCTTY))
|
||||
|
||||
def __del__(self):
|
||||
if self.pexpect.isalive():
|
||||
self.destroy()
|
||||
|
||||
def destroy(self):
|
||||
if self.pexpect and self.pexpect.isalive():
|
||||
self.send_command('exit')
|
||||
self.pexpect.expect(pexpect.EOF)
|
||||
self.pexpect.terminate()
|
||||
self.pexpect.close(force=True)
|
||||
self.pexpect = None
|
||||
|
||||
def send_command(self, cmd):
|
||||
print("%d: %s" % (self.nodeid, cmd))
|
||||
|
||||
Reference in New Issue
Block a user