volume_ixVolume_test.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. suite: pod ixVolume volume test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should pass with ixVolume volume
  6. set:
  7. workload:
  8. workload-name1:
  9. enabled: true
  10. primary: true
  11. type: Deployment
  12. podSpec: {}
  13. ixVolumes:
  14. - /mnt/pool/ix-applications/ix-app
  15. persistence:
  16. ix-vol:
  17. enabled: true
  18. type: ixVolume
  19. datasetName: ix-app
  20. asserts:
  21. - documentIndex: &deploymentDoc 0
  22. isKind:
  23. of: Deployment
  24. - documentIndex: *deploymentDoc
  25. contains:
  26. path: spec.template.spec.volumes
  27. content:
  28. name: ix-vol
  29. hostPath:
  30. path: /mnt/pool/ix-applications/ix-app
  31. - it: should pass with hostPath volume and type
  32. set:
  33. some_dataset: ix-app
  34. some_type: DirectoryOrCreate
  35. workload:
  36. workload-name1:
  37. enabled: true
  38. primary: true
  39. type: Deployment
  40. podSpec: {}
  41. ixVolumes:
  42. - /mnt/pool/ix-applications/ix-app
  43. persistence:
  44. ix-vol:
  45. enabled: true
  46. type: ixVolume
  47. datasetName: "{{ .Values.some_dataset }}"
  48. hostPathType: "{{ .Values.some_type }}"
  49. asserts:
  50. - documentIndex: *deploymentDoc
  51. isKind:
  52. of: Deployment
  53. - documentIndex: *deploymentDoc
  54. contains:
  55. path: spec.template.spec.volumes
  56. content:
  57. name: ix-vol
  58. hostPath:
  59. path: /mnt/pool/ix-applications/ix-app
  60. type: DirectoryOrCreate
  61. # Failures
  62. - it: should fail without datasetName
  63. set:
  64. workload:
  65. some-workload:
  66. enabled: true
  67. primary: true
  68. type: Deployment
  69. podSpec: {}
  70. persistence:
  71. volume1:
  72. enabled: true
  73. type: ixVolume
  74. datasetname: ""
  75. asserts:
  76. - failedTemplate:
  77. errorMessage: Persistence - Expected non-empty <datasetName> on <ixVolume> type
  78. - it: should fail with empty ixVolumes
  79. set:
  80. workload:
  81. some-workload:
  82. enabled: true
  83. primary: true
  84. type: Deployment
  85. podSpec: {}
  86. ixVolumes: []
  87. persistence:
  88. volume1:
  89. enabled: true
  90. type: ixVolume
  91. datasetName: ix-app
  92. asserts:
  93. - failedTemplate:
  94. errorMessage: Persistence - Expected non-empty <ixVolumes> in values on <ixVolume> type
  95. - it: should fail with empty ixVolumes
  96. set:
  97. workload:
  98. some-workload:
  99. enabled: true
  100. primary: true
  101. type: Deployment
  102. podSpec: {}
  103. ixVolumes:
  104. - /mnt/pool/ix-applications/ix-wrong-app
  105. - /mnt/pool/ix-applications/ix-other-app
  106. persistence:
  107. volume1:
  108. enabled: true
  109. type: ixVolume
  110. datasetName: ix-app
  111. asserts:
  112. - failedTemplate:
  113. errorMessage: Persistence - Expected <datasetName> [ix-app] to exist on <ixVolumes> list, but list contained [/mnt/pool/ix-applications/ix-wrong-app, /mnt/pool/ix-applications/ix-other-app] on <ixVolume> type
  114. - it: should fail with invalid hostPathType
  115. set:
  116. workload:
  117. some-workload:
  118. enabled: true
  119. primary: true
  120. type: Deployment
  121. podSpec: {}
  122. ixVolumes:
  123. - /mnt/pool/ix-applications/ix-app
  124. persistence:
  125. volume1:
  126. enabled: true
  127. type: ixVolume
  128. datasetName: ix-app
  129. hostPathType: invalid
  130. asserts:
  131. - failedTemplate:
  132. errorMessage: Persistence - Expected <hostPathType> to be one of [DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice, BlockDevice], but got [invalid]