diff options
-rw-r--r-- | server/fsm.go | 2 | ||||
-rw-r--r-- | test/scenario_test/bgp_router_test.py | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/server/fsm.go b/server/fsm.go index c25fd1f3..86390354 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -208,7 +208,7 @@ func (fsm *FSM) connectLoop() error { ticker.Stop() connect := func() { - if bgp.FSMState(fsm.peerConfig.BgpNeighborCommonState.State) == bgp.BGP_FSM_ACTIVE { + if fsm.state == bgp.BGP_FSM_ACTIVE { var host string addr := fsm.peerConfig.NeighborAddress diff --git a/test/scenario_test/bgp_router_test.py b/test/scenario_test/bgp_router_test.py index 35fd940a..31792044 100644 --- a/test/scenario_test/bgp_router_test.py +++ b/test/scenario_test/bgp_router_test.py @@ -253,6 +253,19 @@ class GoBGPTestBase(unittest.TestCase): def test_14_check_adj_rib_out(self): self.test_11_check_adj_rib_out() + def test_15_check_active_connection(self): + g1 = self.gobgp + g2 = GoBGPContainer(name='g2', asn=65000, router_id='192.168.0.5', + ctn_image_name=self.gobgp.image, + log_level=parser_option.gobgp_log_level) + g2.run() + br01 = self.bridges['br01'] + br01.addif(g2) + g2.add_peer(g1, passive=True) + g1.add_peer(g2) + g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=g2) + + if __name__ == '__main__': if os.geteuid() is not 0: print "you are not root." |