def setUpClass(cls): gobgp_ctn_image_name = parser_option.gobgp_image base.TEST_PREFIX = parser_option.test_prefix g1 = GoBGPContainer(name='g1', asn=65000, router_id='192.168.0.1', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) g2 = GoBGPContainer(name='g2', asn=65000, router_id='192.168.0.2', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) g3 = GoBGPContainer(name='g3', asn=65000, router_id='192.168.0.3', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) e1 = ExaBGPContainer(name='e1', asn=65000, router_id='192.168.0.4') ctns = [g1, g2, g3, e1] initial_wait_time = max(ctn.run() for ctn in ctns) time.sleep(initial_wait_time) g1.add_peer(e1, addpath=True) e1.add_peer(g1, addpath=True) g1.add_peer(g2, addpath=False, is_rr_client=True) g2.add_peer(g1, addpath=False) g1.add_peer(g3, addpath=True, is_rr_client=True) g3.add_peer(g1, addpath=True) cls.g1 = g1 cls.g2 = g2 cls.g3 = g3 cls.e1 = e1
def setUpClass(cls): gobgp_ctn_image_name = parser_option.gobgp_image base.TEST_PREFIX = parser_option.test_prefix g1 = GoBGPContainer(name='g1', asn=65000, router_id='192.168.0.1', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) g2 = GoBGPContainer(name='g2', asn=65000, router_id='192.168.0.2', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) g3 = GoBGPContainer(name='g3', asn=65000, router_id='192.168.0.3', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) e1 = ExaBGPContainer(name='e1', asn=65000, router_id='192.168.0.4') ctns = [g1, g2, g3, e1] initial_wait_time = max(ctn.run() for ctn in ctns) time.sleep(initial_wait_time) g1.add_peer(e1, addpath=True) e1.add_peer(g1, addpath=True) g1.add_peer(g2, addpath=False, is_rr_client=True) g2.add_peer(g1, addpath=False) g1.add_peer(g3, addpath=True, is_rr_client=True) g3.add_peer(g1, addpath=True) cls.g1 = g1 cls.g2 = g2 cls.g3 = g3 cls.e1 = e1
def test_11_add_ibgp_peer(self): q = ExaBGPContainer(name='q5', asn=65000, router_id='192.168.0.6') time.sleep(q.run()) self.quaggas['q5'] = q self.gobgp.add_peer(q) q.add_peer(self.gobgp) self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q)
def test_11_add_ibgp_peer(self): q = ExaBGPContainer(name='q5', asn=65000, router_id='192.168.0.6') time.sleep(q.run()) self.quaggas['q5'] = q self.gobgp.add_peer(q) q.add_peer(self.gobgp) self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q)
def test_02_add_neighbor(self): e2 = ExaBGPContainer(name='e2', asn=65001, router_id='192.168.0.4') time.sleep(e2.run()) self.gobgp.add_peer(e2, is_rs_client=True) e2.add_peer(self.gobgp) self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=e2) self.clients[e2.name] = e2
def test_02_add_neighbor(self): e2 = ExaBGPContainer(name='e2', asn=65001, router_id='192.168.0.4') time.sleep(e2.run()) self.gobgp.add_peer(e2, is_rs_client=True) e2.add_peer(self.gobgp) self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=e2) self.clients[e2.name] = e2
def test_03_add_peer(self): q = ExaBGPContainer(name='q4', asn=65004, router_id='192.168.0.5') q.add_route('10.10.0.0/24') time.sleep(q.run()) self.gobgp.add_peer(q) q.add_peer(self.gobgp) self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q) self.quaggas['q4'] = q for q in self.quaggas.itervalues(): self.assertTrue(len(self.gobgp.get_adj_rib_out(q)) == 0)
def test_03_add_peer(self): q = ExaBGPContainer(name='q4', asn=65004, router_id='192.168.0.5') time.sleep(q.run()) self.gobgp.add_peer(q) q.add_peer(self.gobgp) q.add_route('10.10.0.0/24') self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q) self.quaggas['q4'] = q for q in self.quaggas.values(): self.assertEqual(len(self.gobgp.get_adj_rib_out(q)), 0)
def test_19_check_grpc_add_neighbor(self): g1 = self.gobgp e1 = ExaBGPContainer(name='e1', asn=65000, router_id='192.168.0.7') time.sleep(e1.run()) e1.add_peer(g1) self.quaggas['e1'] = e1 n = e1.peers[g1]['local_addr'].split('/')[0] g1.local('gobgp n add {0} as 65000'.format(n)) g1.add_peer(e1, reload_config=False) g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=e1)
def test_19_check_grpc_add_neighbor(self): g1 = self.gobgp e1 = ExaBGPContainer(name='e1', asn=65000, router_id='192.168.0.7') time.sleep(e1.run()) e1.add_peer(g1) self.quaggas['e1'] = e1 n = e1.peers[g1]['local_addr'].split('/')[0] g1.local('gobgp n add {0} as 65000'.format(n)) g1.add_peer(e1, reload_config=False) g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=e1)
def setUpClass(cls): gobgp_ctn_image_name = parser_option.gobgp_image base.TEST_PREFIX = parser_option.test_prefix g1 = GoBGPContainer(name='g1', asn=65000, router_id='192.168.0.1', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) e1 = ExaBGPContainer(name='e1', asn=65001, router_id='192.168.0.2') ctns = [g1, e1] initial_wait_time = max(ctn.run() for ctn in ctns) time.sleep(initial_wait_time) g1.add_peer(e1, treat_as_withdraw=True) e1.add_peer(g1) cls.g1 = g1 cls.e1 = e1
def setUpClass(cls): gobgp_ctn_image_name = parser_option.gobgp_image base.TEST_PREFIX = parser_option.test_prefix g1 = GoBGPContainer(name='g1', asn=65000, router_id='192.168.0.1', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) e1 = ExaBGPContainer(name='e1', asn=65001, router_id='192.168.0.2') ctns = [g1, e1] initial_wait_time = max(ctn.run() for ctn in ctns) time.sleep(initial_wait_time) g1.add_peer(e1, treat_as_withdraw=True) e1.add_peer(g1) cls.g1 = g1 cls.e1 = e1
def setUpClass(cls): gobgp_ctn_image_name = parser_option.gobgp_image base.TEST_PREFIX = parser_option.test_prefix g1 = GoBGPContainer(name='g1', asn=65000, router_id='192.168.0.1', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) g2 = GoBGPContainer(name='g2', asn=65000, router_id='192.168.0.2', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) e1 = ExaBGPContainer(name='e1', asn=65000, router_id='192.168.0.3') ctns = [g1, g2, e1] e1.add_route(route='192.168.100.0/24', identifier=10, aspath=[100, 200, 300]) e1.add_route(route='192.168.100.0/24', identifier=20, aspath=[100, 200]) e1.add_route(route='192.168.100.0/24', identifier=30, aspath=[100]) initial_wait_time = max(ctn.run() for ctn in ctns) time.sleep(initial_wait_time) g1.add_peer(e1, addpath=True) e1.add_peer(g1, addpath=True) g1.add_peer(g2, addpath=False, is_rr_client=True) g2.add_peer(g1, addpath=False) cls.g1 = g1 cls.g2 = g2 cls.e1 = e1