diff --git a/agent/consul/acl_test.go b/agent/consul/acl_test.go index 2646989b9a..c85e5c2a09 100644 --- a/agent/consul/acl_test.go +++ b/agent/consul/acl_test.go @@ -310,14 +310,16 @@ func testIdentityForToken(token string) (bool, structs.ACLIdentity, error) { func testPolicyForID(policyID string) (bool, *structs.ACLPolicy, error) { switch policyID { case "acl-ro": - return true, &structs.ACLPolicy{ + p := &structs.ACLPolicy{ ID: "acl-ro", Name: "acl-ro", Description: "acl-ro", Rules: `acl = "read"`, Syntax: acl.SyntaxCurrent, RaftIndex: structs.RaftIndex{CreateIndex: 1, ModifyIndex: 2}, - }, nil + } + p.SetHash(false) + return true, p, nil case "acl-wr": p := &structs.ACLPolicy{ ID: "acl-wr", @@ -330,23 +332,27 @@ func testPolicyForID(policyID string) (bool, *structs.ACLPolicy, error) { p.SetHash(false) return true, p, nil case "service-ro": - return true, &structs.ACLPolicy{ + p := &structs.ACLPolicy{ ID: "service-ro", Name: "service-ro", Description: "service-ro", Rules: `service_prefix "" { policy = "read" }`, Syntax: acl.SyntaxCurrent, RaftIndex: structs.RaftIndex{CreateIndex: 1, ModifyIndex: 2}, - }, nil + } + p.SetHash(false) + return true, p, nil case "service-wr": - return true, &structs.ACLPolicy{ + p := &structs.ACLPolicy{ ID: "service-wr", Name: "service-wr", Description: "service-wr", Rules: `service_prefix "" { policy = "write" }`, Syntax: acl.SyntaxCurrent, RaftIndex: structs.RaftIndex{CreateIndex: 1, ModifyIndex: 2}, - }, nil + } + p.SetHash(false) + return true, p, nil case "node-wr": p := &structs.ACLPolicy{ ID: "node-wr", @@ -360,7 +366,7 @@ func testPolicyForID(policyID string) (bool, *structs.ACLPolicy, error) { p.SetHash(false) return true, p, nil case "dc2-key-wr": - return true, &structs.ACLPolicy{ + p := &structs.ACLPolicy{ ID: "dc2-key-wr", Name: "dc2-key-wr", Description: "dc2-key-wr", @@ -368,7 +374,9 @@ func testPolicyForID(policyID string) (bool, *structs.ACLPolicy, error) { Syntax: acl.SyntaxCurrent, Datacenters: []string{"dc2"}, RaftIndex: structs.RaftIndex{CreateIndex: 1, ModifyIndex: 2}, - }, nil + } + p.SetHash(false) + return true, p, nil default: return testPolicyForIDEnterprise(policyID) }