Add NodePolicy test helper
This commit is contained in:
parent
1dc147f40d
commit
41c05782b3
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue