1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-29 10:55:05 +00:00

add namespace_quota testrunner

This commit is contained in:
Shuting Zhao 2019-09-10 12:27:21 -07:00
parent 2e22c21164
commit e6a5b1ceb8
2 changed files with 25 additions and 3 deletions

View file

@ -100,9 +100,9 @@ func Test_validate_not_readonly_rootfilesystem(t *testing.T) {
testScenario(t, "test/scenarios/test/scenario_validate_not_readonly_rootfilesystem.yaml")
}
// func Test_validate_namespace_quota(t *testing.T) {
// testScenario(t, "test/scenarios/test/scenario_validate_namespace_quota.yaml")
// }
func Test_validate_namespace_quota(t *testing.T) {
testScenario(t, "test/scenarios/test/scenario_validate_namespace_quota.yaml")
}
func Test_validate_disallow_node_port(t *testing.T) {
testScenario(t, "test/scenarios/test/scenario_validate_disallow_node_port.yaml")

View 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