command_test.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. suite: container command test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should create the correct command in scalar
  6. set:
  7. image: &image
  8. repository: nginx
  9. tag: 1.19.0
  10. pullPolicy: IfNotPresent
  11. workload:
  12. workload-name:
  13. enabled: true
  14. primary: true
  15. type: Deployment
  16. podSpec:
  17. containers:
  18. container-name1:
  19. enabled: true
  20. primary: true
  21. imageSelector: image
  22. probes: &probes
  23. liveness:
  24. enabled: false
  25. readiness:
  26. enabled: false
  27. startup:
  28. enabled: false
  29. command:
  30. - /bin/sh
  31. - -c
  32. - |
  33. echo "Using image {{ .Values.image.repository }}"
  34. asserts:
  35. - documentIndex: &deploymentDoc 0
  36. isKind:
  37. of: Deployment
  38. - documentIndex: *deploymentDoc
  39. isAPIVersion:
  40. of: apps/v1
  41. - documentIndex: *deploymentDoc
  42. isSubset:
  43. path: spec.template.spec.containers[0]
  44. content:
  45. command:
  46. - /bin/sh
  47. - -c
  48. - |
  49. echo "Using image nginx"
  50. - it: should create the correct single command
  51. set:
  52. image: &image
  53. repository: nginx
  54. tag: 1.19.0
  55. pullPolicy: IfNotPresent
  56. workload:
  57. workload-name:
  58. enabled: true
  59. primary: true
  60. type: Deployment
  61. podSpec:
  62. containers:
  63. container-name1:
  64. enabled: true
  65. primary: true
  66. imageSelector: image
  67. probes: *probes
  68. command: ./start.sh
  69. asserts:
  70. - documentIndex: &deploymentDoc 0
  71. isKind:
  72. of: Deployment
  73. - documentIndex: *deploymentDoc
  74. isAPIVersion:
  75. of: apps/v1
  76. - documentIndex: *deploymentDoc
  77. isSubset:
  78. path: spec.template.spec.containers[0]
  79. content:
  80. command:
  81. - ./start.sh
  82. - it: should create the correct multiple command
  83. set:
  84. image: &image
  85. repository: nginx
  86. tag: 1.19.0
  87. pullPolicy: IfNotPresent
  88. workload:
  89. workload-name:
  90. enabled: true
  91. primary: true
  92. type: Deployment
  93. podSpec:
  94. containers:
  95. container-name1:
  96. enabled: true
  97. primary: true
  98. imageSelector: image
  99. probes: *probes
  100. command:
  101. - ./print.sh
  102. - "{{ .Values.image.repository }}"
  103. asserts:
  104. - documentIndex: &deploymentDoc 0
  105. isKind:
  106. of: Deployment
  107. - documentIndex: *deploymentDoc
  108. isAPIVersion:
  109. of: apps/v1
  110. - documentIndex: *deploymentDoc
  111. isSubset:
  112. path: spec.template.spec.containers[0]
  113. content:
  114. command:
  115. - ./print.sh
  116. - nginx