Add NodePolicy test helper

This commit is contained in:
Michael Schurter 2017-09-14 20:33:12 -07:00
parent 1dc147f40d
commit 41c05782b3

View file

@ -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()