mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
add namespace_quota testrunner
This commit is contained in:
parent
2e22c21164
commit
e6a5b1ceb8
2 changed files with 25 additions and 3 deletions
|
@ -100,9 +100,9 @@ func Test_validate_not_readonly_rootfilesystem(t *testing.T) {
|
||||||
testScenario(t, "test/scenarios/test/scenario_validate_not_readonly_rootfilesystem.yaml")
|
testScenario(t, "test/scenarios/test/scenario_validate_not_readonly_rootfilesystem.yaml")
|
||||||
}
|
}
|
||||||
|
|
||||||
// func Test_validate_namespace_quota(t *testing.T) {
|
func Test_validate_namespace_quota(t *testing.T) {
|
||||||
// testScenario(t, "test/scenarios/test/scenario_validate_namespace_quota.yaml")
|
testScenario(t, "test/scenarios/test/scenario_validate_namespace_quota.yaml")
|
||||||
// }
|
}
|
||||||
|
|
||||||
func Test_validate_disallow_node_port(t *testing.T) {
|
func Test_validate_disallow_node_port(t *testing.T) {
|
||||||
testScenario(t, "test/scenarios/test/scenario_validate_disallow_node_port.yaml")
|
testScenario(t, "test/scenarios/test/scenario_validate_disallow_node_port.yaml")
|
||||||
|
|
22
test/scenarios/test/scenario_validate_namespace_quota.yaml
Normal file
22
test/scenarios/test/scenario_validate_namespace_quota.yaml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# file path relative to project root
|
||||||
|
input:
|
||||||
|
policy: examples/best_practices/policy_validate_namespace_quota.yaml
|
||||||
|
resource: examples/best_practices/resources/resource_validate_namespace_quota.yaml
|
||||||
|
expected:
|
||||||
|
generation:
|
||||||
|
generatedResources:
|
||||||
|
- name: defaultresourcequota
|
||||||
|
kind: ResourceQuota
|
||||||
|
namespace: test-namespace-quota
|
||||||
|
policyresponse:
|
||||||
|
policy: validate-namespace-quota
|
||||||
|
resource:
|
||||||
|
kind: Namespace
|
||||||
|
apiVersion: v1
|
||||||
|
namespace: ''
|
||||||
|
name: test-namespace-quota
|
||||||
|
rules:
|
||||||
|
- name: validate-namespace-quota
|
||||||
|
type: Generation
|
||||||
|
success: true
|
||||||
|
message: created resource ResourceQuota/test-namespace-quota/defaultresourcequota
|
Loading…
Add table
Reference in a new issue