From 41c05782b324322357d3a056ee80ddbee0ea5177 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Thu, 14 Sep 2017 20:33:12 -0700 Subject: [PATCH] Add NodePolicy test helper --- nomad/acl_testutil_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nomad/acl_testutil_test.go b/nomad/acl_testutil_test.go index 4cf5a9627..705290126 100644 --- a/nomad/acl_testutil_test.go +++ b/nomad/acl_testutil_test.go @@ -24,6 +24,11 @@ func NamespacePolicy(namespace string, policy string, capabilities []string) str return policyHCL } +// NodePolicy is a helper for generating the hcl for a given node policy. +func NodePolicy(policy string) string { + return fmt.Sprintf("node {\n\tpolicy = %q\n}\n", policy) +} + // CreatePolicy creates a policy with the given name and rule. func CreatePolicy(t *testing.T, state *state.StateStore, index uint64, name, rule string) { t.Helper()