forked from jenkins-infra/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefaults_test.yaml
More file actions
87 lines (87 loc) · 2.62 KB
/
defaults_test.yaml
File metadata and controls
87 lines (87 loc) · 2.62 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
suite: default tests
templates:
- pdb.yaml
- deployment.yaml
- nginx-configmap.yaml
tests:
- it: should not generate any pdb with default values
template: pdb.yaml
asserts:
- hasDocuments:
count: 0
- it: should generate a deployment with the default values
template: deployment.yaml
asserts:
- hasDocuments:
count: 1
- isKind:
of: Deployment
- notExists:
path: spec.affinity
- equal:
path: metadata.labels["app.kubernetes.io/name"]
value: nginx-website
- equal:
path: metadata.labels["app.kubernetes.io/managed-by"]
value: Helm
- equal:
path: spec.template.spec.volumes[0].name
value: html
- equal:
path: spec.template.spec.volumes[0].emptyDir
value: {}
- notExists:
path: spec.template.spec.containers[0].resources
- notExists:
path: spec.template.metadata.annotations
- equal:
path: spec.template.spec.volumes[0].name
value: html
- isNullOrEmpty:
path: spec.template.spec.volumes[0].emptyDir
- equal:
path: spec.template.spec.containers[0].volumeMounts[0].name
value: html
- equal:
path: spec.template.spec.containers[0].volumeMounts[0].readOnly
value: true
- notExists:
path: spec.template.spec.containers[0].volumeMounts[0].subPath
- equal:
path: spec.template.spec.containers[0].volumeMounts[0].mountPath
value: /usr/share/nginx/html
- it: should create a default nginx configuration
template: nginx-configmap.yaml
asserts:
- hasDocuments:
count: 1
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: RELEASE-NAME-nginx-website
- matchRegex:
path: data["default.conf"]
pattern: '# default.conf'
- matchRegex:
path: data["default.conf"]
pattern: 'listen 80;'
- matchRegex:
path: data["default.conf"]
pattern: 'server_name localhost;'
- matchRegex:
path: data["default.conf"]
pattern: 'server_tokens off;'
- matchRegex:
path: data["default.conf"]
pattern: 'root /usr/share/nginx/html;'
- matchRegex:
path: data["default.conf"]
pattern: 'index index.html index.htm;'
- matchRegex:
path: data["default.conf"]
pattern: 'autoindex on;'
- notMatchRegex:
path: data["default.conf"]
pattern: 'try_files \$uri /index.html;'