From 94a7d45232eb2501b1a952b571cd6a140f5f6c7d Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 13 Oct 2017 09:56:56 -0700 Subject: [PATCH] Fix Request.SecretID -> Request.AuthToken --- nomad/node_endpoint_test.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/nomad/node_endpoint_test.go b/nomad/node_endpoint_test.go index b8508e2a3..de91f4141 100644 --- a/nomad/node_endpoint_test.go +++ b/nomad/node_endpoint_test.go @@ -1172,11 +1172,14 @@ func TestClientEndpoint_GetAllocs_ACL(t *testing.T) { invalidToken := mock.CreatePolicyAndToken(t, state, 1004, "test-invalid", mock.NamespacePolicy(structs.DefaultNamespace, "", []string{acl.NamespaceCapabilityReadJob})) - // Lookup the node without a token and expect failure req := &structs.NodeSpecificRequest{ - NodeID: node.ID, - QueryOptions: structs.QueryOptions{Region: "global"}, + NodeID: node.ID, + QueryOptions: structs.QueryOptions{ + Region: "global", + }, } + + // Lookup the node without a token and expect failure { var resp structs.NodeAllocsResponse err := msgpackrpc.CallWithCodec(codec, "Node.GetAllocs", req, &resp) @@ -1185,7 +1188,7 @@ func TestClientEndpoint_GetAllocs_ACL(t *testing.T) { } // Try with a valid token for the default namespace - req.SecretID = validDefaultToken.SecretID + req.AuthToken = validDefaultToken.SecretID { var resp structs.NodeAllocsResponse assert.Nil(msgpackrpc.CallWithCodec(codec, "Node.GetAllocs", req, &resp), "RPC") @@ -1194,7 +1197,7 @@ func TestClientEndpoint_GetAllocs_ACL(t *testing.T) { } // Try with a valid token for a namespace with no allocs on this node - req.SecretID = validNoNSToken.SecretID + req.AuthToken = validNoNSToken.SecretID { var resp structs.NodeAllocsResponse assert.Nil(msgpackrpc.CallWithCodec(codec, "Node.GetAllocs", req, &resp), "RPC") @@ -1202,7 +1205,7 @@ func TestClientEndpoint_GetAllocs_ACL(t *testing.T) { } // Try with a invalid token - req.SecretID = invalidToken.SecretID + req.AuthToken = invalidToken.SecretID { var resp structs.NodeAllocsResponse err := msgpackrpc.CallWithCodec(codec, "Node.GetAllocs", req, &resp) @@ -1211,7 +1214,7 @@ func TestClientEndpoint_GetAllocs_ACL(t *testing.T) { } // Try with a root token - req.SecretID = root.SecretID + req.AuthToken = root.SecretID { var resp structs.NodeAllocsResponse assert.Nil(msgpackrpc.CallWithCodec(codec, "Node.GetAllocs", req, &resp), "RPC")