summaryrefslogtreecommitdiffhomepage
path: root/test/lib
diff options
context:
space:
mode:
authorNasato Goto <7310510@gmail.com>2018-08-27 19:44:15 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-08-28 08:49:11 +0900
commite7929016918bb27263a3cb7548e9c45bb109a308 (patch)
tree620badd7e31fcb50a81bb160bcbe90f542c36a5e /test/lib
parentacfc9ad7f9853ccd7b8a1c442f644e71434d5f9c (diff)
test: Fix bridge methos and relative scenario test
This patch fix the logic of addif methos of Bridge class. IP address information will be registerd according to the IP version of bridge. This change lead the fixing of one of scenario test, "bgp_zebra_test.py".
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/lib/base.py b/test/lib/base.py
index 6fe1a50c..22ffcdee 100644
--- a/test/lib/base.py
+++ b/test/lib/base.py
@@ -232,10 +232,13 @@ class Bridge(object):
local("docker network connect {0} {1}".format(self.name, ctn.docker_name()))
i = [x for x in Client(timeout=60, version='auto').inspect_network(self.id)['Containers'].values() if x['Name'] == ctn.docker_name()][0]
if self.subnet.version == 4:
+ eth = 'eth{0}'.format(len(ctn.ip_addrs))
addr = i['IPv4Address']
+ ctn.ip_addrs.append((eth, addr, self.name))
else:
+ eth = 'eth{0}'.format(len(ctn.ip6_addrs))
addr = i['IPv6Address']
- ctn.ip_addrs.append(('eth1', addr, self.name))
+ ctn.ip6_addrs.append((eth, addr, self.name))
def delete(self):
try_several_times(lambda: local("docker network rm {0}".format(self.name)))