diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-10-27 20:48:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-10-28 21:25:49 +0900 |
commit | d032c3153e72ab3c01355a20098ac1b68d26cba5 (patch) | |
tree | 5123a1b7a2d1af5a7d95476efae028df0b6da535 /pkg/server/server_test.go | |
parent | 23ae91cfc1a541b7033126c284e9a2e5814836ca (diff) |
move exported functions to generate api structs from config struct in server/
NewPeerFromConfigStruct()
NewPeerGroupFromConfigStruct()
NewGlobalFromConfigStruct()
The config is an internal package so they should not be exported.
We will remove the usage of the config in server/. This is a part of
the goal.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/server/server_test.go')
-rw-r--r-- | pkg/server/server_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index f1809e26..079f452c 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -218,7 +218,7 @@ func TestMonitor(test *testing.T) { }, }, } - err = t.AddPeer(context.Background(), &api.AddPeerRequest{Peer: NewPeerFromConfigStruct(m)}) + err = t.AddPeer(context.Background(), &api.AddPeerRequest{Peer: config.NewPeerFromConfigStruct(m)}) assert.Nil(err) for { @@ -566,7 +566,7 @@ func TestPeerGroup(test *testing.T) { }, } config.RegisterConfiguredFields("127.0.0.1", configured) - err = s.AddPeer(context.Background(), &api.AddPeerRequest{Peer: NewPeerFromConfigStruct(n)}) + err = s.AddPeer(context.Background(), &api.AddPeerRequest{Peer: config.NewPeerFromConfigStruct(n)}) assert.Nil(err) t := NewBgpServer() @@ -597,7 +597,7 @@ func TestPeerGroup(test *testing.T) { }, }, } - err = t.AddPeer(context.Background(), &api.AddPeerRequest{Peer: NewPeerFromConfigStruct(m)}) + err = t.AddPeer(context.Background(), &api.AddPeerRequest{Peer: config.NewPeerFromConfigStruct(m)}) assert.Nil(err) for { @@ -669,7 +669,7 @@ func TestDynamicNeighbor(t *testing.T) { }, }, } - err = s2.AddPeer(context.Background(), &api.AddPeerRequest{Peer: NewPeerFromConfigStruct(m)}) + err = s2.AddPeer(context.Background(), &api.AddPeerRequest{Peer: config.NewPeerFromConfigStruct(m)}) assert.Nil(err) @@ -886,7 +886,7 @@ func peerServers(t *testing.T, ctx context.Context, servers []*BgpServer, famili }) } - if err := server.AddPeer(ctx, &api.AddPeerRequest{Peer: NewPeerFromConfigStruct(neighborConfig)}); err != nil { + if err := server.AddPeer(ctx, &api.AddPeerRequest{Peer: config.NewPeerFromConfigStruct(neighborConfig)}); err != nil { t.Fatal(err) } } |