From c2d4b6992c563bd992c08f9cd78df11a4c12eaf7 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 11 May 2016 08:49:36 +0000 Subject: test: add start_tcpdump() Signed-off-by: ISHIDA Wataru --- test/lib/base.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/lib/base.py') diff --git a/test/lib/base.py b/test/lib/base.py index d64afdae..d31ec14b 100644 --- a/test/lib/base.py +++ b/test/lib/base.py @@ -224,6 +224,12 @@ class Container(object): return int(local(cmd, capture=True)) return -1 + def start_tcpdump(self, interface=None, filename=None): + if not interface: + interface = "eth0" + if not filename: + filename = "{0}/{1}.dump".format(self.shared_volumes[0][1], interface) + self.local("tcpdump -i {0} -w {1}".format(interface, filename), detach=True) class BGPContainer(Container): -- cgit v1.2.3