diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-07-22 05:02:17 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-08-03 12:09:07 +0900 |
commit | b5e49f1319c37b4da3a010e09fc370d9285bb828 (patch) | |
tree | 104ca8f3d3220993560317d7227cde4a21c88ed1 /test/lib | |
parent | 87bd4c1648e4aa6982add12d84ddf299aca1f4d7 (diff) |
server: fix advertising multiple local withdrawals with same prefix
a bug introduced by 332766189685028c4f9852e4285fb1a9025223cc
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/base.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/lib/base.py b/test/lib/base.py index 4f2e8a69..38cac97a 100644 --- a/test/lib/base.py +++ b/test/lib/base.py @@ -158,6 +158,7 @@ class Container(object): self.ip6_addrs = [] self.is_running = False self.eths = [] + self.tcpdump_running = False if self.docker_name() in get_containers(): self.remove() @@ -230,12 +231,21 @@ class Container(object): return int(local(cmd, capture=True)) return -1 - def start_tcpdump(self, interface=None, filename=None): + def start_tcpdump(self, interface=None, filename=None, expr='tcp port 179'): + if self.tcpdump_running: + raise Exception('tcpdump already running') + self.tcpdump_running = True 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) + filename = '{0}.dump'.format(interface) + self.local("tcpdump -i {0} -w {1}/{2} {3}".format(interface, self.shared_volumes[0][1], filename, expr), detach=True) + return '{0}/{1}'.format(self.shared_volumes[0][0], filename) + + def stop_tcpdump(self): + self.local("pkill tcpdump") + self.tcpdump_running = False + class BGPContainer(Container): |