From e7929016918bb27263a3cb7548e9c45bb109a308 Mon Sep 17 00:00:00 2001 From: Nasato Goto <7310510@gmail.com> Date: Mon, 27 Aug 2018 19:44:15 +0900 Subject: 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". --- test/lib/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/lib') 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))) -- cgit v1.2.3