From 64de575b9c8f62479aea4c8f8530647816552b2b Mon Sep 17 00:00:00 2001 From: ChaitanyaD48 Date: Mon, 15 Jan 2024 23:07:33 +0530 Subject: [PATCH] Add CheckAccessActor and CheckAccessHTTP tests for MONITORING role Signed-off-by: ChaitanyaD48 --- go/acl/acl_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/go/acl/acl_test.go b/go/acl/acl_test.go index 680044c1461..dfc4f7cba8a 100644 --- a/go/acl/acl_test.go +++ b/go/acl/acl_test.go @@ -57,6 +57,10 @@ func TestSimplePolicy(t *testing.T) { if err != nil { t.Errorf("got %v, want no error", err) } + err = CheckAccessActor("", MONITORING) + if err != nil { + t.Errorf("got %v, want no error", err) + } err = CheckAccessHTTP(nil, ADMIN) if err == nil || err.Error() != want { @@ -66,6 +70,10 @@ func TestSimplePolicy(t *testing.T) { if err != nil { t.Errorf("got %v, want no error", err) } + err = CheckAccessHTTP(nil, MONITORING) + if err != nil { + t.Errorf("got %v, want no error", err) + } } func TestEmptyPolicy(t *testing.T) { @@ -78,6 +86,10 @@ func TestEmptyPolicy(t *testing.T) { if err != nil { t.Errorf("got %v, want no error", err) } + err = CheckAccessActor("", MONITORING) + if err != nil { + t.Errorf("got %v, want no error", err) + } err = CheckAccessHTTP(nil, ADMIN) if err != nil { @@ -87,4 +99,8 @@ func TestEmptyPolicy(t *testing.T) { if err != nil { t.Errorf("got %v, want no error", err) } + err = CheckAccessHTTP(nil, MONITORING) + if err != nil { + t.Errorf("got %v, want no error", err) + } }