Commit 4b3e3b44 by gitlawr Committed by Craig Jellick

Add unit tests for harbor chart

parent 7e3b437e
suite: Test Enable/Disable Addons
templates:
- clair-cm.yaml
- clair-dpl.yaml
- clair-svc.yaml
- notary-cm.yaml
- notary-server.yaml
- notary-signer.yaml
- notary-svc.yaml
- core-secret.yaml
tests:
- it: should enable clair and notary by default
asserts:
- template: clair/clair-cm.yaml
hasDocuments:
count: 1
- template: clair/clair-dpl.yaml
hasDocuments:
count: 1
- template: clair/clair-svc.yaml
hasDocuments:
count: 1
- template: notary/notary-cm.yaml
hasDocuments:
count: 1
- template: notary/notary-server.yaml
hasDocuments:
count: 1
- template: notary/notary-signer.yaml
hasDocuments:
count: 1
- template: notary/notary-svc.yaml
hasDocuments:
count: 2
- it: should disable clair
set:
clair:
enabled: false
asserts:
- template: clair/clair-cm.yaml
hasDocuments:
count: 0
- template: clair/clair-dpl.yaml
hasDocuments:
count: 0
- template: clair/clair-svc.yaml
hasDocuments:
count: 0
- it: should disable notary
set:
notary:
enabled: false
asserts:
- template: notary/notary-cm.yaml
hasDocuments:
count: 0
- template: notary/notary-server.yaml
hasDocuments:
count: 0
- template: notary/notary-signer.yaml
hasDocuments:
count: 0
- template: notary/notary-svc.yaml
hasDocuments:
count: 0
suite: Test Global Options
templates:
- registry-cm.yaml
- registry-dpl.yaml
- registry-secret.yaml
- jobservice-secrets.yaml
- core-secret.yaml
tests:
- it: has no system default registry set
set:
registry:
registry:
image:
repository: test/registry-photon
tag: mytag
asserts:
- template: registry/registry-dpl.yaml
equal:
path: spec.template.spec.containers[0].image
value: test/registry-photon:mytag
- it: should use system default registry
set:
global:
systemDefaultRegistry: reg.myorg.com
registry:
registry:
image:
repository: test/registry-photon
tag: mytag
asserts:
- template: registry/registry-dpl.yaml
equal:
path: spec.template.spec.containers[0].image
value: reg.myorg.com/test/registry-photon:mytag
suite: Test Ingress
templates:
- ingress.yaml
tests:
- it: should set ingress host
set:
expose:
ingress:
host: test.myorg.com
asserts:
- template: ingress/ingress.yaml
equal:
path: spec.tls[0].hosts[0]
value: test.myorg.com
- template: ingress/ingress.yaml
equal:
path: spec.rules[0].host
value: test.myorg.com
- it: should use tls-rancher-ingress secret
set:
expose:
ingress:
host: test.myorg.com
globalRegistryMode: true
asserts:
- template: ingress/ingress.yaml
equal:
path: spec.tls[0].secretName
value: tls-rancher-ingress
suite: Test Registry Configmap
templates:
- registry-cm.yaml
- registry-dpl.yaml
- registry-secret.yaml
- jobservice-secrets.yaml
- core-secret.yaml
tests:
- it: should use filesystem storage backend by default
asserts:
- template: registry/registry-cm.yaml
matchRegex:
path: data.config\.yml
pattern: "filesystem:"
- it: should use s3 storage backend
set:
imageChartStorage:
type: s3
s3:
region: us-west-2
bucket: mybucket
accesskey: myaccesskey
secretkey: mysecretkey
asserts:
- template: registry/registry-cm.yaml
matchRegex:
path: data.config\.yml
pattern: "(?s)s3:.*region: us-west-2.*bucket: mybucket"
- template: registry/registry-secret.yaml
equal:
path: data.REGISTRY_STORAGE_S3_ACCESSKEY
value: bXlhY2Nlc3NrZXk=
- template: registry/registry-secret.yaml
equal:
path: data.REGISTRY_STORAGE_S3_SECRETKEY
value: bXlzZWNyZXRrZXk=
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment