123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673 |
- suite: container probe test
- templates:
- - common.yaml
- tests:
- - it: should create the probes correctly
- set:
- some_port: 80
- some_path: /healthz
- some_command: echo
- probe_type: exec
- image: &image
- repository: nginx
- tag: 1.19.0
- pullPolicy: IfNotPresent
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes: &probes
- liveness:
- enabled: true
- type: http
- port: "{{ .Values.some_port }}"
- path: "{{ .Values.some_path }}"
- readiness:
- enabled: true
- type: tcp
- port: 123
- startup:
- enabled: true
- type: "{{ .Values.probe_type }}"
- command:
- - "{{ .Values.some_command }}"
- - hello
- asserts:
- - documentIndex: &deploymentDoc 0
- isKind:
- of: Deployment
- - documentIndex: *deploymentDoc
- isAPIVersion:
- of: apps/v1
- - documentIndex: *deploymentDoc
- isSubset:
- path: spec.template.spec.containers[0]
- content:
- livenessProbe:
- httpGet:
- path: /healthz
- port: 80
- scheme: HTTP
- failureThreshold: 5
- initialDelaySeconds: 10
- periodSeconds: 10
- successThreshold: 1
- timeoutSeconds: 5
- readinessProbe:
- tcpSocket:
- port: 123
- failureThreshold: 5
- initialDelaySeconds: 10
- periodSeconds: 10
- successThreshold: 2
- timeoutSeconds: 5
- startupProbe:
- exec:
- command:
- - echo
- - hello
- failureThreshold: 60
- initialDelaySeconds: 10
- periodSeconds: 5
- successThreshold: 1
- timeoutSeconds: 2
- - it: should create https probe
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes: &probes
- liveness:
- enabled: true
- type: https
- port: 443
- spec:
- initialDelaySeconds: 120
- timeoutSeconds: 10
- periodSeconds: 15
- successThreshold: 1
- failureThreshold: 3
- readiness:
- enabled: true
- type: tcp
- port: 443
- spec:
- initialDelaySeconds: 50
- timeoutSeconds: 30
- periodSeconds: 8
- successThreshold: 5
- failureThreshold: 9
- startup:
- enabled: true
- type: tcp
- port: 443
- spec:
- initialDelaySeconds: 25
- timeoutSeconds: 40
- periodSeconds: 7
- successThreshold: 1
- failureThreshold: 12
- asserts:
- - documentIndex: &deploymentDoc 0
- isKind:
- of: Deployment
- - documentIndex: *deploymentDoc
- isAPIVersion:
- of: apps/v1
- - documentIndex: *deploymentDoc
- isSubset:
- path: spec.template.spec.containers[0]
- content:
- livenessProbe:
- httpGet:
- path: /
- port: 443
- scheme: HTTPS
- failureThreshold: 3
- initialDelaySeconds: 120
- periodSeconds: 15
- successThreshold: 1
- timeoutSeconds: 10
- readinessProbe:
- tcpSocket:
- port: 443
- failureThreshold: 9
- initialDelaySeconds: 50
- periodSeconds: 8
- successThreshold: 5
- timeoutSeconds: 30
- startupProbe:
- tcpSocket:
- port: 443
- failureThreshold: 12
- initialDelaySeconds: 25
- periodSeconds: 7
- successThreshold: 1
- timeoutSeconds: 40
- # Failures
- - it: should fail with invalid probe
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: false
- readiness:
- enabled: false
- startup:
- enabled: false
- invalid:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected probe to be one of [liveness, readiness, startup], but got [invalid]
- - it: should fail without probes defined
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes: {}
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected non-empty <probes>
- - it: should fail without liveness defined
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes.liveness> to be defined
- - it: should fail without readiness defined
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes.readiness> to be defined
- - it: should fail without startup defined
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: false
- readiness:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes.startup> to be defined
- - it: should fail with invalid type
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: invalid
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected probe type to be one of [http, https, tcp, grpc, exec], but got [invalid]
- - it: should fail with successThreshold more than 1 on liveness
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: 8080
- spec:
- successThreshold: 2
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes> <successThreshold> to be 1 on [liveness] probe
- - it: should fail with successThreshold more than 1 on startup
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- startup:
- enabled: true
- type: http
- port: 8080
- spec:
- successThreshold: 2
- readiness:
- enabled: false
- liveness:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes> <successThreshold> to be 1 on [startup] probe
- - it: should fail with initialDelaySeconds not a number
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: 8080
- spec:
- initialDelaySeconds: invalid
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes> <initialDelaySeconds> to be a number, but got [invalid]
- - it: should fail with failureThreshold not a number
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: 8080
- spec:
- failureThreshold: invalid
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes> <failureThreshold> to be a number, but got [invalid]
- - it: should fail with successThreshold not a number
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: 8080
- spec:
- successThreshold: invalid
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes> <successThreshold> to be a number, but got [invalid]
- - it: should fail with timeoutSeconds not a number
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: 8080
- spec:
- timeoutSeconds: invalid
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes> <timeoutSeconds> to be a number, but got [invalid]
- - it: should fail with periodSeconds not a number
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: 8080
- spec:
- periodSeconds: invalid
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes> <periodSeconds> to be a number, but got [invalid]
- - it: should fail with empty command on exec type
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: exec
- command: []
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected non-empty <probes> <command> on [exec] type
- - it: should fail with empty port on grpc type
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: grpc
- port: ""
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected non-empty <probes> <port> on [grpc] type
- - it: should fail with empty port on tcp type
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: tcp
- port: ""
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected non-empty <probes> <port> on [tcp] type
- - it: should fail with empty port on http type
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: ""
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected non-empty <probes> <port> on [http] type
- - it: should fail with invalid path on http type
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: 8080
- path: not-starting-with-slash
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected <probes> <path> to start with a forward slash [/] on <http> type
- - it: should fail with empty value in http headers
- set:
- image: *image
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- container-name1:
- enabled: true
- primary: true
- imageSelector: image
- probes:
- liveness:
- enabled: true
- type: http
- port: not-starting-with-slash
- httpHeaders:
- key:
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Container - Expected non-empty <value> on <httpHeaders>
|