automount_sa_token_test.yaml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. suite: pod auto mount sa token test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should pass with automountServiceAccountToken disabled from "global"
  6. set:
  7. podOptions:
  8. automountServiceAccountToken: false
  9. workload:
  10. workload-name1:
  11. enabled: true
  12. primary: true
  13. type: Deployment
  14. podSpec: {}
  15. asserts:
  16. - documentIndex: &deploymentDoc 0
  17. isKind:
  18. of: Deployment
  19. - documentIndex: *deploymentDoc
  20. equal:
  21. path: spec.template.spec.automountServiceAccountToken
  22. value: false
  23. - it: should pass with automountServiceAccountToken enabled from "global"
  24. set:
  25. podOptions:
  26. automountServiceAccountToken: true
  27. workload:
  28. workload-name1:
  29. enabled: true
  30. primary: true
  31. type: Deployment
  32. podSpec: {}
  33. asserts:
  34. - documentIndex: *deploymentDoc
  35. isKind:
  36. of: Deployment
  37. - documentIndex: *deploymentDoc
  38. equal:
  39. path: spec.template.spec.automountServiceAccountToken
  40. value: true
  41. - it: should pass with disabled automountServiceAccountToken from pod
  42. set:
  43. podOptions:
  44. automountServiceAccountToken: true
  45. workload:
  46. workload-name1:
  47. enabled: true
  48. primary: true
  49. type: Deployment
  50. podSpec:
  51. automountServiceAccountToken: false
  52. asserts:
  53. - documentIndex: *deploymentDoc
  54. equal:
  55. path: spec.template.spec.automountServiceAccountToken
  56. value: false
  57. - it: should pass with enabled automountServiceAccountToken from pod
  58. set:
  59. podOptions:
  60. automountServiceAccountToken: false
  61. workload:
  62. workload-name1:
  63. enabled: true
  64. primary: true
  65. type: Deployment
  66. podSpec:
  67. automountServiceAccountToken: true
  68. asserts:
  69. - documentIndex: *deploymentDoc
  70. equal:
  71. path: spec.template.spec.automountServiceAccountToken
  72. value: true