From f505a0b7f7ff34244f4e663b99f0cc13e4d9af1b Mon Sep 17 00:00:00 2001 From: Omer Anson Date: Thu, 31 Aug 2017 11:54:42 +0300 Subject: [PATCH] Give docker bridges test-specific names We have seen in Dragonflow tempest tests that docker bridges do not always clean-up correctly, and this causes false-positive errors. This change modifies the name of the bridge to be unique for each test. This way, if a test fails to clean up, it will not affect the other tests. Change-Id: I869c6dc798cd1cc20376023481518e7a03b71fde --- .../tests/tempest/scenario/basic/base.py | 4 ++-- .../tests/tempest/scenario/ipv4/test_ipv4.py | 12 ++++++------ .../tests/tempest/scenario/ipv6/test_ipv6.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/neutron_dynamic_routing/tests/tempest/scenario/basic/base.py b/neutron_dynamic_routing/tests/tempest/scenario/basic/base.py index cad5e584..0fd1bfa6 100644 --- a/neutron_dynamic_routing/tests/tempest/scenario/basic/base.py +++ b/neutron_dynamic_routing/tests/tempest/scenario/basic/base.py @@ -68,7 +68,7 @@ class BgpSpeakerBasicTestJSONBase(base.BgpSpeakerScenarioTestJSONBase): @classmethod def resource_setup_container(cls): - cls.brdc = ctn_base.Bridge(name='br-docker', + cls.brdc = ctn_base.Bridge(name='br-docker-basic', subnet='192.168.10.0/24', start_ip='192.168.10.128', end_ip='192.168.10.254', @@ -80,7 +80,7 @@ class BgpSpeakerBasicTestJSONBase(base.BgpSpeakerScenarioTestJSONBase): # This keeps data which passes to a quagga container. cls.dr = ctn_base.BGPContainer(name='dr', asn=int(cls.L_AS.asn), router_id=cls.L_AS.router_id) - cls.dr.set_addr_info(bridge='br-docker', ipv4=cls.public_gw) + cls.dr.set_addr_info(bridge='br-docker-basic', ipv4=cls.public_gw) # quagga container cls.dockerimg = ctn_base.DockerImage() cls.q_img = cls.dockerimg.create_quagga(check_exist=True) diff --git a/neutron_dynamic_routing/tests/tempest/scenario/ipv4/test_ipv4.py b/neutron_dynamic_routing/tests/tempest/scenario/ipv4/test_ipv4.py index 8de3f534..ce6f41cc 100644 --- a/neutron_dynamic_routing/tests/tempest/scenario/ipv4/test_ipv4.py +++ b/neutron_dynamic_routing/tests/tempest/scenario/ipv4/test_ipv4.py @@ -30,7 +30,7 @@ class BgpSpeakerIpv4Test(test_base.BgpSpeakerProtoTestBase): RAS_MAX = 3 ip_version = 4 - public_gw = '192.168.10.1' + public_gw = '192.168.11.1' MyScope = base.Scope(name='my-scope') PNet = base.Net(name='', net='172.24.6.0', mask=24, cidr='172.24.6.0/24', router=None) @@ -76,10 +76,10 @@ class BgpSpeakerIpv4Test(test_base.BgpSpeakerProtoTestBase): @classmethod def resource_setup_container(cls): - cls.brdc = ctn_base.Bridge(name='br-docker', - subnet='192.168.10.0/24', - start_ip='192.168.10.128', - end_ip='192.168.10.254', + cls.brdc = ctn_base.Bridge(name='br-docker-ipv4', + subnet='192.168.11.0/24', + start_ip='192.168.11.128', + end_ip='192.168.11.254', self_ip=True, fixed_ip=cls.public_gw + '/24', br_type=base.BRIDGE_TYPE) @@ -88,7 +88,7 @@ class BgpSpeakerIpv4Test(test_base.BgpSpeakerProtoTestBase): # This keeps data which passes to a quagga container. cls.dr = ctn_base.BGPContainer(name='dr', asn=int(cls.L_AS.asn), router_id=cls.L_AS.router_id) - cls.dr.set_addr_info(bridge='br-docker', ipv4=cls.public_gw) + cls.dr.set_addr_info(bridge='br-docker-ipv4', ipv4=cls.public_gw) # quagga container cls.dockerimg = ctn_base.DockerImage() cls.q_img = cls.dockerimg.create_quagga(check_exist=True) diff --git a/neutron_dynamic_routing/tests/tempest/scenario/ipv6/test_ipv6.py b/neutron_dynamic_routing/tests/tempest/scenario/ipv6/test_ipv6.py index 30795443..a35a5a9b 100644 --- a/neutron_dynamic_routing/tests/tempest/scenario/ipv6/test_ipv6.py +++ b/neutron_dynamic_routing/tests/tempest/scenario/ipv6/test_ipv6.py @@ -76,7 +76,7 @@ class BgpSpeakerIpv6Test(test_base.BgpSpeakerProtoTestBase): @classmethod def resource_setup_container(cls): - cls.brdc = ctn_base.Bridge(name='br-docker', + cls.brdc = ctn_base.Bridge(name='br-docker-ipv6', subnet='2001:db8:a000::/64', start_ip='2001:db8:a000::8000', end_ip='2001:db8:a000::fffe', @@ -88,7 +88,7 @@ class BgpSpeakerIpv6Test(test_base.BgpSpeakerProtoTestBase): # This keeps data which passes to a quagga container. cls.dr = ctn_base.BGPContainer(name='dr', asn=int(cls.L_AS.asn), router_id=cls.L_AS.router_id) - cls.dr.set_addr_info(bridge='br-docker', ipv6=cls.public_gw) + cls.dr.set_addr_info(bridge='br-docker-ipv6', ipv6=cls.public_gw) # quagga container cls.dockerimg = ctn_base.DockerImage() cls.q_img = cls.dockerimg.create_quagga(check_exist=True)