Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Update tests for task name dependent roles
Browse files Browse the repository at this point in the history
  • Loading branch information
nemosupremo committed Nov 13, 2019
1 parent 394edbb commit b876493
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gatekeeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b876493

Please sign in to comment.