validation_test.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. suite: certificate validation test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should fail with name longer than 63 characters
  6. set:
  7. scaleCertificate:
  8. my-certificate-super-long-name-that-is-longer-than-63-characters:
  9. enabled: true
  10. id: 1
  11. asserts:
  12. - failedTemplate:
  13. errorMessage: Name [release-name-common-test-my-certificate-super-long-name-that-is-longer-than-63-characters] is not valid. Must start and end with an alphanumeric lowercase character. It can contain '-'. And must be at most 63 characters.
  14. - it: should fail with name starting with underscore
  15. set:
  16. scaleCertificate:
  17. _my-cert:
  18. enabled: true
  19. id: 1
  20. asserts:
  21. - failedTemplate:
  22. errorMessage: Name [release-name-common-test-_my-cert] is not valid. Must start and end with an alphanumeric lowercase character. It can contain '-'. And must be at most 63 characters.
  23. - it: should fail with labels not a dict
  24. set:
  25. scaleCertificate:
  26. my-cert:
  27. enabled: true
  28. labels: "not a dict"
  29. id: 1
  30. asserts:
  31. - failedTemplate:
  32. errorMessage: Certificate - Expected <labels> to be a dictionary, but got [string]
  33. - it: should fail with annotations not a dict
  34. set:
  35. scaleCertificate:
  36. my-cert:
  37. enabled: true
  38. annotations: "not a dict"
  39. id: 1
  40. asserts:
  41. - failedTemplate:
  42. errorMessage: Certificate - Expected <annotations> to be a dictionary, but got [string]
  43. - it: should fail without id
  44. set:
  45. scaleCertificate:
  46. my-cert:
  47. enabled: true
  48. id: ""
  49. asserts:
  50. - failedTemplate:
  51. errorMessage: Certificate - Expected non-empty <id>
  52. - it: should fail with targetSelector not a dict
  53. set:
  54. scaleCertificate:
  55. my-cert:
  56. enabled: true
  57. id: 1
  58. targetSelector: "not a dict"
  59. asserts:
  60. - failedTemplate:
  61. errorMessage: Certificate - Expected <targetSelector> to be a [map], but got [string]
  62. - it: should fail with empty ixCertificates when cert is defined
  63. set:
  64. ixCertificates: []
  65. scaleCertificate:
  66. my-cert:
  67. enabled: true
  68. id: 1
  69. asserts:
  70. - failedTemplate:
  71. errorMessage: Certificate - Expected non-empty <ixCertificates>
  72. - it: should fail with not defined id in ixCertificates when cert is defined
  73. set:
  74. ixCertificates:
  75. "2":
  76. key: value
  77. scaleCertificate:
  78. my-cert:
  79. enabled: true
  80. id: 1
  81. asserts:
  82. - failedTemplate:
  83. errorMessage: Certificate - Expected certificate with <id> ["1"] to exist in <ixCertificates>
  84. - it: should fail with with revoked cert
  85. set:
  86. ixCertificates:
  87. "1":
  88. revoked: true
  89. scaleCertificate:
  90. my-cert:
  91. enabled: true
  92. id: 1
  93. asserts:
  94. - failedTemplate:
  95. errorMessage: Certificate - Expected non-revoked certificate with <id> ["1"]
  96. - it: should fail with with expired cert
  97. set:
  98. ixCertificates:
  99. "1":
  100. expired: true
  101. scaleCertificate:
  102. my-cert:
  103. enabled: true
  104. id: 1
  105. asserts:
  106. - failedTemplate:
  107. errorMessage: Certificate - Expected non-expired certificate with <id> ["1"]
  108. - it: should fail with with empty certificate
  109. set:
  110. ixCertificates:
  111. "1":
  112. certificate: ""
  113. scaleCertificate:
  114. my-cert:
  115. enabled: true
  116. id: 1
  117. asserts:
  118. - failedTemplate:
  119. errorMessage: Certificate - Expected non-empty [certificate] in certificate with <id> ["1"] in <ixCertificates>
  120. - it: should fail with with empty privatekey
  121. set:
  122. ixCertificates:
  123. "1":
  124. certificate: some_value
  125. privatekey: ""
  126. scaleCertificate:
  127. my-cert:
  128. enabled: true
  129. id: 1
  130. asserts:
  131. - failedTemplate:
  132. errorMessage: Certificate - Expected non-empty [privatekey] in certificate with <id> ["1"] in <ixCertificates>