summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/server_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2020-10-20 14:38:03 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2020-10-20 15:36:19 +0900
commit22d745fcf591c2a14204598cb2b00877c7a9e3c6 (patch)
treec049167726445fdf28e78175096369ee8f19ab33 /pkg/server/server_test.go
parent98b017d1ade751b3c2323fbdebe631e3454ebde0 (diff)
server: fix ListPolicyAssignment to handle empty policy
fix ListPolicyAssignment() return an assignment response even if the response doesn't have any policy. The assignment has default action policy so it's useful without any policy. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'pkg/server/server_test.go')
-rw-r--r--pkg/server/server_test.go6
1 files changed, 3 insertions, 3 deletions
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) {