add more sa primary util tests

This commit is contained in:
Stavros kois
2022-11-22 18:56:27 +02:00
parent e20f3daae2
commit cfedcc7319

View File

@@ -4,13 +4,11 @@ templates:
- common.yaml
tests:
- it: should pass with default values
documentIndex: &serviceAccountDoc 0
asserts:
- hasDocuments:
count: 1
- it: should fail with more than 1 primary serviceAccounts
documentIndex: *serviceAccountDoc
set:
serviceAccount:
main:
@@ -24,17 +22,22 @@ tests:
errorMessage: More than one serviceAccounts are set as primary. This is not supported.
- it: should pass with no serviceAccount set as primary
documentIndex: *serviceAccountDoc
documentIndex: &serviceAccountDoc 0
set:
serviceAccount:
main:
enabled: true
primary: false
asserts:
- hasDocuments:
count: 2
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: RELEASE-NAME-common-test
- it: should pass with main serviceAccount set as primary and other not
- it: should pass with main serviceAccount set as primary and other not (check name on main)
documentIndex: *serviceAccountDoc
set:
serviceAccount:
@@ -45,10 +48,34 @@ tests:
enabled: true
primary: false
asserts:
- hasDocuments:
count: 3
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: RELEASE-NAME-common-test
- it: should pass with different serviceAccount set as primary
- it: should pass with main serviceAccount set as primary and other not (check name on other)
documentIndex: &otherServiceAccountDoc 1
set:
serviceAccount:
main:
enabled: true
primary: true
other:
enabled: true
primary: false
asserts:
- hasDocuments:
count: 3
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: RELEASE-NAME-common-test-other
- it: should pass with different serviceAccount set as primary (check name on main)
documentIndex: *serviceAccountDoc
set:
serviceAccount:
@@ -59,5 +86,29 @@ tests:
enabled: true
primary: true
asserts:
- hasDocuments:
count: 3
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: RELEASE-NAME-common-test-main
- it: should pass with different serviceAccount set as primary (check name on other)
documentIndex: *otherServiceAccountDoc
set:
serviceAccount:
main:
enabled: true
primary: false
other:
enabled: true
primary: true
asserts:
- hasDocuments:
count: 3
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: RELEASE-NAME-common-test