From 87bd4c1648e4aa6982add12d84ddf299aca1f4d7 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 2 Aug 2016 05:25:59 +0000 Subject: test: deconfigure deleted peer for later tests Depending on Docker version, Docker re-allocates deleted container's IP address to new container. If both deleted and new container run a BGP daemon and are peering to other containers, other containers who think they are connecting to deleted container's BGP daemon wrongly connect to new container's BGP daemon (because IP address is same) To avoid this issue, let's deconfigure deleted peer before going to next test. Signed-off-by: ISHIDA Wataru --- test/scenario_test/bgp_router_test.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/scenario_test/bgp_router_test.py') diff --git a/test/scenario_test/bgp_router_test.py b/test/scenario_test/bgp_router_test.py index 8292f6d0..a528c36d 100644 --- a/test/scenario_test/bgp_router_test.py +++ b/test/scenario_test/bgp_router_test.py @@ -145,9 +145,12 @@ class GoBGPTestBase(unittest.TestCase): self.test_04_check_quagga_global_rib() def test_07_stop_one_quagga(self): + g1 = self.gobgp q4 = self.quaggas['q4'] q4.stop() self.gobgp.wait_for(expected_state=BGP_FSM_ACTIVE, peer=q4) + + g1.del_peer(q4) del self.quaggas['q4'] # check gobgp properly send withdrawal message with q4's route @@ -285,6 +288,7 @@ class GoBGPTestBase(unittest.TestCase): self.assertTrue(med['metric'] == 2000) def test_17_check_shutdown(self): + g1 = self.gobgp q1 = self.quaggas['q1'] q2 = self.quaggas['q2'] q3 = self.quaggas['q3'] @@ -302,7 +306,6 @@ class GoBGPTestBase(unittest.TestCase): self.assertTrue(paths[0]['nexthop'] in n_addrs) q3.stop() - del self.quaggas['q3'] time.sleep(3) @@ -310,6 +313,9 @@ class GoBGPTestBase(unittest.TestCase): self.assertTrue(len(paths) == 1) self.assertTrue(paths[0]['nexthop'] in n_addrs) + g1.del_peer(q3) + del self.quaggas['q3'] + def test_18_check_withdrawal(self): g1 = self.gobgp q1 = self.quaggas['q1'] -- cgit v1.2.3