summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/server_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2019-01-08 23:18:18 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-01-09 21:24:29 +0900
commit98d8925b82766f21f49378172a3c0763054a619a (patch)
tree0183315d83f09bce8cf50bba39d0b312e306162b /pkg/server/server_test.go
parent8e0c05782dcc896032258bf1c7d0bb8ed5d3bc32 (diff)
server: fix wait time before active conneciton
also avoid unittest race. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'pkg/server/server_test.go')
-rw-r--r--pkg/server/server_test.go52
1 files changed, 1 insertions, 51 deletions
diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go
index 804842bd..54a2dd00 100644
--- a/pkg/server/server_test.go
+++ b/pkg/server/server_test.go
@@ -171,8 +171,6 @@ func TestListPolicyAssignment(t *testing.T) {
}
func TestMonitor(test *testing.T) {
- minConnectRetry = 5
-
assert := assert.New(test)
s := NewBgpServer()
go s.Serve()
@@ -222,11 +220,6 @@ func TestMonitor(test *testing.T) {
RemotePort: 10179,
},
},
- Timers: config.Timers{
- Config: config.TimersConfig{
- ConnectRetry: 5,
- },
- },
}
ch := make(chan struct{})
go t.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(peer *api.Peer) {
@@ -532,8 +525,6 @@ func TestFilterpathWithRejectPolicy(t *testing.T) {
}
func TestPeerGroup(test *testing.T) {
- minConnectRetry = 5
-
assert := assert.New(test)
log.SetLevel(log.DebugLevel)
s := NewBgpServer()
@@ -553,11 +544,6 @@ func TestPeerGroup(test *testing.T) {
PeerAs: 2,
PeerGroupName: "g",
},
- Timers: config.Timers{
- Config: config.TimersConfig{
- ConnectRetry: 5,
- },
- },
}
err = s.addPeerGroup(g)
assert.Nil(err)
@@ -572,11 +558,6 @@ func TestPeerGroup(test *testing.T) {
PassiveMode: true,
},
},
- Timers: config.Timers{
- Config: config.TimersConfig{
- ConnectRetry: 5,
- },
- },
}
configured := map[string]interface{}{
"config": map[string]interface{}{
@@ -615,11 +596,6 @@ func TestPeerGroup(test *testing.T) {
RemotePort: 10179,
},
},
- Timers: config.Timers{
- Config: config.TimersConfig{
- ConnectRetry: 5,
- },
- },
}
ch := make(chan struct{})
go t.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(peer *api.Peer) {
@@ -633,8 +609,6 @@ func TestPeerGroup(test *testing.T) {
}
func TestDynamicNeighbor(t *testing.T) {
- minConnectRetry = 5
-
assert := assert.New(t)
log.SetLevel(log.DebugLevel)
s1 := NewBgpServer()
@@ -654,11 +628,6 @@ func TestDynamicNeighbor(t *testing.T) {
PeerAs: 2,
PeerGroupName: "g",
},
- Timers: config.Timers{
- Config: config.TimersConfig{
- ConnectRetry: 5,
- },
- },
}
err = s1.addPeerGroup(g)
assert.Nil(err)
@@ -694,11 +663,6 @@ func TestDynamicNeighbor(t *testing.T) {
RemotePort: 10179,
},
},
- Timers: config.Timers{
- Config: config.TimersConfig{
- ConnectRetry: 5,
- },
- },
}
ch := make(chan struct{})
go s2.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(peer *api.Peer) {
@@ -712,8 +676,6 @@ func TestDynamicNeighbor(t *testing.T) {
}
func TestGracefulRestartTimerExpired(t *testing.T) {
- minConnectRetry = 5
-
assert := assert.New(t)
s1 := NewBgpServer()
go s1.Serve()
@@ -740,7 +702,7 @@ func TestGracefulRestartTimerExpired(t *testing.T) {
GracefulRestart: config.GracefulRestart{
Config: config.GracefulRestartConfig{
Enabled: true,
- RestartTime: 5,
+ RestartTime: minConnectRetryInterval,
},
},
}
@@ -775,11 +737,6 @@ func TestGracefulRestartTimerExpired(t *testing.T) {
RestartTime: 1,
},
},
- Timers: config.Timers{
- Config: config.TimersConfig{
- ConnectRetry: 5,
- },
- },
}
ch := make(chan struct{})
go s2.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(peer *api.Peer) {
@@ -893,11 +850,6 @@ func peerServers(t *testing.T, ctx context.Context, servers []*BgpServer, famili
RemotePort: uint16(peer.bgpConfig.Global.Config.Port),
},
},
- Timers: config.Timers{
- Config: config.TimersConfig{
- ConnectRetry: 5,
- },
- },
}
// first server to get neighbor config is passive to hopefully make handshake faster
@@ -957,8 +909,6 @@ func addVrf(t *testing.T, s *BgpServer, vrfName, rdStr string, id uint32) {
}
func TestDoNotReactToDuplicateRTCMemberships(t *testing.T) {
- minConnectRetry = 5
-
ctx := context.Background()
log.SetLevel(log.DebugLevel)