summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pkg/server/server.go3
-rw-r--r--pkg/server/server_test.go6
2 files changed, 3 insertions, 6 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go
index 1b49880d..ef8bd3c8 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -3492,9 +3492,6 @@ func (s *BgpServer) ListPolicyAssignment(ctx context.Context, r *api.ListPolicyA
if err != nil {
return err
}
- if len(policies) == 0 {
- continue
- }
t := &table.PolicyAssignment{
Name: name,
Type: dir,
diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go
index 34e9be1f..6f70f38a 100644
--- a/pkg/server/server_test.go
+++ b/pkg/server/server_test.go
@@ -194,19 +194,19 @@ func TestListPolicyAssignment(t *testing.T) {
Name: table.GLOBAL_RIB_NAME,
}, func(p *api.PolicyAssignment) { ps = append(ps, p) })
assert.Nil(err)
- assert.Equal(len(ps), 0)
+ assert.Equal(2, len(ps))
ps = []*api.PolicyAssignment{}
err = s.ListPolicyAssignment(context.Background(), &api.ListPolicyAssignmentRequest{}, func(p *api.PolicyAssignment) { ps = append(ps, p) })
assert.Nil(err)
- assert.Equal(len(ps), 3)
+ assert.Equal(8, len(ps))
ps = []*api.PolicyAssignment{}
err = s.ListPolicyAssignment(context.Background(), &api.ListPolicyAssignmentRequest{
Direction: api.PolicyDirection_EXPORT,
}, func(p *api.PolicyAssignment) { ps = append(ps, p) })
assert.Nil(err)
- assert.Equal(len(ps), 0)
+ assert.Equal(4, len(ps))
}
func TestListPathEnableFiltered(test *testing.T) {