diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2018-12-23 23:12:49 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2018-12-23 23:40:37 +0900 |
commit | 8d0a8b0ffa696a3838740fec7accc54ccfb452ab (patch) | |
tree | cc9dd2da324045dba80bb6dc1d1149ed0114c639 /pkg/server/server_test.go | |
parent | ababf3068c48d665e2d9d7816cbb521c74fc47c5 (diff) |
make the usage of type name in protobuf consistent
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'pkg/server/server_test.go')
-rw-r--r-- | pkg/server/server_test.go | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index 984cf53a..14124c79 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -978,9 +978,9 @@ func TestDoNotReactToDuplicateRTCMemberships(t *testing.T) { path := apiutil.NewPath(prefix, false, attrs, time.Now()) if _, err := s2.AddPath(ctx, &api.AddPathRequest{ - Resource: api.Resource_VRF, - VrfId: "vrf1", - Path: path, + TableType: api.TableType_VRF, + VrfId: "vrf1", + Path: path, }); err != nil { t.Fatal(err) } @@ -1077,7 +1077,7 @@ func TestAddDeletePath(t *testing.T) { listRib := func() []*api.Destination { l := make([]*api.Destination, 0) - s.ListPath(ctx, &api.ListPathRequest{Type: api.Resource_GLOBAL, Family: family}, func(d *api.Destination) { l = append(l, d) }) + s.ListPath(ctx, &api.ListPathRequest{TableType: api.TableType_GLOBAL, Family: family}, func(d *api.Destination) { l = append(l, d) }) return l } @@ -1093,29 +1093,29 @@ func TestAddDeletePath(t *testing.T) { p1 := getPath() _, err = s.AddPath(ctx, &api.AddPathRequest{ - Resource: api.Resource_GLOBAL, - Path: p1, + TableType: api.TableType_GLOBAL, + Path: p1, }) assert.Nil(t, err) assert.Equal(t, len(listRib()), 1) err = s.DeletePath(ctx, &api.DeletePathRequest{ - Resource: api.Resource_GLOBAL, - Path: p1, + TableType: api.TableType_GLOBAL, + Path: p1, }) assert.Nil(t, err) assert.Equal(t, len(listRib()), 0) // DeletePath(ListPath()) without PeerInfo _, err = s.AddPath(ctx, &api.AddPathRequest{ - Resource: api.Resource_GLOBAL, - Path: p1, + TableType: api.TableType_GLOBAL, + Path: p1, }) assert.Nil(t, err) l := listRib() assert.Equal(t, len(l), 1) err = s.DeletePath(ctx, &api.DeletePathRequest{ - Resource: api.Resource_GLOBAL, - Path: l[0].Paths[0], + TableType: api.TableType_GLOBAL, + Path: l[0].Paths[0], }) assert.Nil(t, err) assert.Equal(t, len(listRib()), 0) @@ -1126,37 +1126,37 @@ func TestAddDeletePath(t *testing.T) { // DeletePath(AddPath()) with PeerInfo _, err = s.AddPath(ctx, &api.AddPathRequest{ - Resource: api.Resource_GLOBAL, - Path: p2, + TableType: api.TableType_GLOBAL, + Path: p2, }) assert.Nil(t, err) assert.Equal(t, len(listRib()), 1) err = s.DeletePath(ctx, &api.DeletePathRequest{ - Resource: api.Resource_GLOBAL, - Path: p2, + TableType: api.TableType_GLOBAL, + Path: p2, }) assert.Nil(t, err) assert.Equal(t, len(listRib()), 0) // DeletePath(ListPath()) with PeerInfo _, err = s.AddPath(ctx, &api.AddPathRequest{ - Resource: api.Resource_GLOBAL, - Path: p2, + TableType: api.TableType_GLOBAL, + Path: p2, }) assert.Nil(t, err) l = listRib() assert.Equal(t, len(l), 1) err = s.DeletePath(ctx, &api.DeletePathRequest{ - Resource: api.Resource_GLOBAL, - Path: l[0].Paths[0], + TableType: api.TableType_GLOBAL, + Path: l[0].Paths[0], }) assert.Nil(t, err) assert.Equal(t, len(listRib()), 0) // DeletePath(AddPath()) with different PeerInfo _, err = s.AddPath(ctx, &api.AddPathRequest{ - Resource: api.Resource_GLOBAL, - Path: p2, + TableType: api.TableType_GLOBAL, + Path: p2, }) assert.Nil(t, err) assert.Equal(t, len(listRib()), 1) @@ -1164,8 +1164,8 @@ func TestAddDeletePath(t *testing.T) { p3.SourceAsn = 2 p3.SourceId = "1.1.1.2" err = s.DeletePath(ctx, &api.DeletePathRequest{ - Resource: api.Resource_GLOBAL, - Path: p3, + TableType: api.TableType_GLOBAL, + Path: p3, }) assert.Nil(t, err) assert.Equal(t, len(listRib()), 1) |