pv_name_test.yaml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. suite: pv name test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should generate correct name
  6. set:
  7. persistence:
  8. my-volume1:
  9. enabled: true
  10. type: nfs-pv-pvc
  11. server: my-server
  12. share: /some/path
  13. my-volume2:
  14. enabled: true
  15. type: smb-pv-pvc
  16. server: my-server
  17. share: some/path
  18. username: my-user
  19. password: my-password
  20. asserts:
  21. - documentIndex: &pvDoc 0
  22. isKind:
  23. of: PersistentVolume
  24. - documentIndex: *pvDoc
  25. isAPIVersion:
  26. of: v1
  27. - documentIndex: *pvDoc
  28. equal:
  29. path: metadata.name
  30. value: release-name-common-test-my-volume1-1740507301
  31. - documentIndex: &pvcDoc 1
  32. isKind:
  33. of: PersistentVolumeClaim
  34. - documentIndex: *pvcDoc
  35. isAPIVersion:
  36. of: v1
  37. - documentIndex: *pvcDoc
  38. equal:
  39. path: metadata.name
  40. value: release-name-common-test-my-volume1-1740507301
  41. - documentIndex: &secretDoc 2
  42. isKind:
  43. of: Secret
  44. - documentIndex: *secretDoc
  45. isAPIVersion:
  46. of: v1
  47. - documentIndex: *secretDoc
  48. equal:
  49. path: metadata.name
  50. value: release-name-common-test-my-volume2-1627523190
  51. - documentIndex: &pvDoc 3
  52. isKind:
  53. of: PersistentVolume
  54. - documentIndex: *pvDoc
  55. isAPIVersion:
  56. of: v1
  57. - documentIndex: *pvDoc
  58. equal:
  59. path: metadata.name
  60. value: release-name-common-test-my-volume2-1627523190
  61. - documentIndex: &otherPvcDoc 4
  62. isKind:
  63. of: PersistentVolumeClaim
  64. - documentIndex: *otherPvcDoc
  65. isAPIVersion:
  66. of: v1
  67. - documentIndex: *otherPvcDoc
  68. equal:
  69. path: metadata.name
  70. value: release-name-common-test-my-volume2-1627523190