validation_test.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. suite: init container data test (upgrade)
  2. templates:
  3. - common.yaml
  4. tests:
  5. # Failures
  6. - it: should fail with empty type on init container
  7. set:
  8. image:
  9. repository: nginx
  10. tag: 1.19.0
  11. pullPolicy: IfNotPresent
  12. workload:
  13. workload-name:
  14. enabled: true
  15. primary: true
  16. type: Deployment
  17. podSpec:
  18. containers:
  19. container-name1:
  20. enabled: true
  21. primary: true
  22. imageSelector: image
  23. probes:
  24. liveness:
  25. enabled: false
  26. readiness:
  27. enabled: false
  28. startup:
  29. enabled: false
  30. initContainers:
  31. container-name1:
  32. enabled: true
  33. type: ""
  34. asserts:
  35. - failedTemplate:
  36. errorMessage: InitContainer - Expected non-empty <type>
  37. - it: should fail with invalid type on init container
  38. set:
  39. image:
  40. repository: nginx
  41. tag: 1.19.0
  42. pullPolicy: IfNotPresent
  43. workload:
  44. workload-name:
  45. enabled: true
  46. primary: true
  47. type: Deployment
  48. podSpec:
  49. containers:
  50. container-name1:
  51. enabled: true
  52. primary: true
  53. imageSelector: image
  54. probes:
  55. liveness:
  56. enabled: false
  57. readiness:
  58. enabled: false
  59. startup:
  60. enabled: false
  61. initContainers:
  62. container-name1:
  63. enabled: true
  64. type: invalid
  65. asserts:
  66. - failedTemplate:
  67. errorMessage: InitContainer - Expected <type> to be one of [init, install, upgrade], but got [invalid]