From b87649301f8e43c55921ed266006ba124a66bd0d Mon Sep 17 00:00:00 2001 From: Nimi Wariboko Jr Date: Wed, 13 Nov 2019 13:32:31 -0800 Subject: [PATCH] Update tests for task name dependent roles --- gatekeeper_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gatekeeper_test.go b/gatekeeper_test.go index 94ab7a7..1ca6144 100644 --- a/gatekeeper_test.go +++ b/gatekeeper_test.go @@ -337,8 +337,11 @@ func TestRequestToken(t *testing.T) { mock.ValidTaskId = "localhost" g.config.HostCheck = true - if _, _, err := g.RequestToken("mock", mock.ValidTaskId, "{{name}}", "localhost"); err != nil { - t.Fatalf("Token request should have succeeded with {{name}}: %v", err) + if _, _, err := g.RequestToken("mock", mock.ValidTaskId, "", "localhost"); err != nil { + t.Fatalf("Token request should have succeeded: %v", err) + } + if _, _, err := g.RequestToken("mock", mock.ValidTaskId, "", "172.217.9.78"); err != ErrHostMismatch { + t.Fatalf("Token request should have failed with ErrHostMismatch: %v", err) } g.config.HostCheck = false