123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- suite: certificate validation test
- templates:
- - common.yaml
- tests:
- - it: should fail with name longer than 63 characters
- set:
- scaleCertificate:
- my-certificate-super-long-name-that-is-longer-than-63-characters:
- enabled: true
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Name [release-name-common-test-my-certificate-super-long-name-that-is-longer-than-63-characters] is not valid. Must start and end with an alphanumeric lowercase character. It can contain '-'. And must be at most 63 characters.
- - it: should fail with name starting with underscore
- set:
- scaleCertificate:
- _my-cert:
- enabled: true
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Name [release-name-common-test-_my-cert] is not valid. Must start and end with an alphanumeric lowercase character. It can contain '-'. And must be at most 63 characters.
- - it: should fail with labels not a dict
- set:
- scaleCertificate:
- my-cert:
- enabled: true
- labels: "not a dict"
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected <labels> to be a dictionary, but got [string]
- - it: should fail with annotations not a dict
- set:
- scaleCertificate:
- my-cert:
- enabled: true
- annotations: "not a dict"
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected <annotations> to be a dictionary, but got [string]
- - it: should fail without id
- set:
- scaleCertificate:
- my-cert:
- enabled: true
- id: ""
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected non-empty <id>
- - it: should fail with targetSelector not a dict
- set:
- scaleCertificate:
- my-cert:
- enabled: true
- id: 1
- targetSelector: "not a dict"
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected <targetSelector> to be a [map], but got [string]
- - it: should fail with empty ixCertificates when cert is defined
- set:
- ixCertificates: []
- scaleCertificate:
- my-cert:
- enabled: true
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected non-empty <ixCertificates>
- - it: should fail with not defined id in ixCertificates when cert is defined
- set:
- ixCertificates:
- "2":
- key: value
- scaleCertificate:
- my-cert:
- enabled: true
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected certificate with <id> ["1"] to exist in <ixCertificates>
- - it: should fail with with revoked cert
- set:
- ixCertificates:
- "1":
- revoked: true
- scaleCertificate:
- my-cert:
- enabled: true
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected non-revoked certificate with <id> ["1"]
- - it: should fail with with expired cert
- set:
- ixCertificates:
- "1":
- expired: true
- scaleCertificate:
- my-cert:
- enabled: true
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected non-expired certificate with <id> ["1"]
- - it: should fail with with empty certificate
- set:
- ixCertificates:
- "1":
- certificate: ""
- scaleCertificate:
- my-cert:
- enabled: true
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected non-empty [certificate] in certificate with <id> ["1"] in <ixCertificates>
- - it: should fail with with empty privatekey
- set:
- ixCertificates:
- "1":
- certificate: some_value
- privatekey: ""
- scaleCertificate:
- my-cert:
- enabled: true
- id: 1
- asserts:
- - failedTemplate:
- errorMessage: Certificate - Expected non-empty [privatekey] in certificate with <id> ["1"] in <ixCertificates>
|