tests/remote: Add monitor.py

Add monitor support. This supports monitors added to the current
interfaces. This also support standalone monitor with multi interfaces
support. This allows to get logs from different channels at the same
time to one pcap file.

Example of t3-monitor added to config.py file.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
Janusz Dziedzic 2016-04-29 07:07:34 +02:00 committed by Jouni Malinen
parent 5865186e31
commit ede4719718
3 changed files with 189 additions and 0 deletions

View file

@ -31,6 +31,9 @@ class Host():
self.host = host
self.name = name
self.user = user
self.monitors = []
self.monitor_thread = None
self.logs = []
self.ifname = ifname
self.port = port
if self.name == "" and host != None:
@ -88,3 +91,10 @@ class Host():
logger.debug(self.name + " wait_execute_complete(" + wait_str + "): ")
if t.isAlive():
t.join(wait)
def get_logs(self, local_log_dir=None):
for log in self.logs:
if local_log_dir:
self.local_execute(["scp", self.user + "@[" + self.host + "]:" + log, local_log_dir])
self.execute(["rm", log])
del self.logs[:]