-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy pathacceptance-nonetwork.bats
More file actions
executable file
·26 lines (21 loc) · 1.25 KB
/
acceptance-nonetwork.bats
File metadata and controls
executable file
·26 lines (21 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bats
@test "Fail when parsing a valid Kubernetes config YAML file without network access" {
run bin/kubeconform fixtures/valid.yaml
[ "$status" -eq 1 ]
}
@test "Pass when parsing a valid config YAML file without network access, with cache" {
run bin/kubeconform -cache fixtures/cache/ fixtures/valid.yaml
[ "$status" -eq 0 ]
}
@test "Pass when parsing a Custom Resource and using a local schema registry with appropriate CRD" {
run bin/kubeconform -schema-location './fixtures/registry/{{ .ResourceKind }}{{ .KindSuffix }}.json' fixtures/test_crd.yaml
[ "$status" -eq 0 ]
}
@test "Pass when parsing a Custom Resource and specifying several local registries, the last one having the appropriate CRD" {
run bin/kubeconform -schema-location 'fixtures/{{ .ResourceKind }}.json' -schema-location './fixtures/registry/{{ .ResourceKind }}{{ .KindSuffix }}.json' fixtures/test_crd.yaml
[ "$status" -eq 0 ]
}
@test "Pass when using a cached schema with external references" {
run bin/kubeconform -cache fixtures/cache -summary -schema-location 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{ .NormalizedKubernetesVersion }}{{ .StrictSuffix }}/{{ .ResourceKind }}{{ .KindSuffix }}.json' fixtures/valid.yaml
[ "$status" -eq 0 ]
}