hostname_test.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. suite: pod hostname test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should pass with empty hostname
  6. set:
  7. workload:
  8. workload-name1:
  9. enabled: true
  10. primary: true
  11. type: Deployment
  12. podSpec: {}
  13. asserts:
  14. - documentIndex: &deploymentDoc 0
  15. isKind:
  16. of: Deployment
  17. - documentIndex: *deploymentDoc
  18. isNull:
  19. path: spec.template.spec.hostname
  20. - it: should pass with hostname set
  21. set:
  22. workload:
  23. workload-name1:
  24. enabled: true
  25. primary: true
  26. type: Deployment
  27. podSpec:
  28. hostname: some-other-hostname
  29. asserts:
  30. - documentIndex: *deploymentDoc
  31. isKind:
  32. of: Deployment
  33. - documentIndex: *deploymentDoc
  34. equal:
  35. path: spec.template.spec.hostname
  36. value: some-other-hostname
  37. - it: should pass with hostname from "pod" with tpl
  38. set:
  39. host: some-other-hostname
  40. workload:
  41. workload-name1:
  42. enabled: true
  43. primary: true
  44. type: Deployment
  45. podSpec:
  46. hostname: "{{ .Values.host }}"
  47. asserts:
  48. - documentIndex: *deploymentDoc
  49. isKind:
  50. of: Deployment
  51. - documentIndex: *deploymentDoc
  52. equal:
  53. path: spec.template.spec.hostname
  54. value: some-other-hostname