|
| 1 | +suite: GatewayApis |
| 2 | + |
| 3 | +tests: |
| 4 | + - it: Route Disabled |
| 5 | + set: |
| 6 | + web: |
| 7 | + route: |
| 8 | + enabled: false |
| 9 | + template: web-route.yaml |
| 10 | + asserts: |
| 11 | + - hasDocuments: |
| 12 | + count: 0 |
| 13 | + |
| 14 | + - it: Route Exposure |
| 15 | + set: |
| 16 | + web: |
| 17 | + route: |
| 18 | + enabled: true |
| 19 | + parentRefs: |
| 20 | + - name: test-parent |
| 21 | + namespace: test-namespace |
| 22 | + group: gateway.networking.k8s.io |
| 23 | + sectionName: test-section |
| 24 | + kind: Gateway |
| 25 | + hostnames: |
| 26 | + - concourse.example.com |
| 27 | + template: web-route.yaml |
| 28 | + asserts: |
| 29 | + - equal: |
| 30 | + path: spec.hostnames[0] |
| 31 | + value: concourse.example.com |
| 32 | + - equal: |
| 33 | + path: spec.parentRefs[0].name |
| 34 | + value: test-parent |
| 35 | + - equal: |
| 36 | + path: spec.parentRefs[0].namespace |
| 37 | + value: test-namespace |
| 38 | + - equal: |
| 39 | + path: spec.parentRefs[0].group |
| 40 | + value: gateway.networking.k8s.io |
| 41 | + - equal: |
| 42 | + path: spec.parentRefs[0].sectionName |
| 43 | + value: test-section |
| 44 | + - equal: |
| 45 | + path: spec.parentRefs[0].kind |
| 46 | + value: Gateway |
| 47 | + |
| 48 | + - it: Route Extra Annotations |
| 49 | + set: |
| 50 | + web: |
| 51 | + route: |
| 52 | + enabled: true |
| 53 | + annotations: |
| 54 | + test.annotation: test-annotation |
| 55 | + parentRefs: |
| 56 | + - name: test-parent |
| 57 | + namespace: test-namespace |
| 58 | + hostnames: |
| 59 | + - concourse.example.com |
| 60 | + template: templates/web-route.yaml |
| 61 | + asserts: |
| 62 | + - equal: |
| 63 | + path: metadata.annotations["test.annotation"] |
| 64 | + value: test-annotation |
| 65 | + |
| 66 | + - it: Route Extra Labels |
| 67 | + set: |
| 68 | + web: |
| 69 | + route: |
| 70 | + enabled: true |
| 71 | + labels: |
| 72 | + test.label: test-label |
| 73 | + parentRefs: |
| 74 | + - name: test-parent |
| 75 | + namespace: test-namespace |
| 76 | + hostnames: |
| 77 | + - concourse.example.com |
| 78 | + template: web-route.yaml |
| 79 | + asserts: |
| 80 | + - equal: |
| 81 | + path: metadata.labels["test.label"] |
| 82 | + value: test-label |
| 83 | + |
| 84 | + - it: Route Service Exposure |
| 85 | + set: |
| 86 | + web: |
| 87 | + route: |
| 88 | + enabled: true |
| 89 | + parentRefs: |
| 90 | + - name: test-parent |
| 91 | + namespace: test-namespace |
| 92 | + hostnames: |
| 93 | + - concourse.example.com |
| 94 | + template: web-route.yaml |
| 95 | + asserts: |
| 96 | + - equal: |
| 97 | + path: spec.rules[0].backendRefs[0].name |
| 98 | + value: RELEASE-NAME-web |
| 99 | + - equal: |
| 100 | + path: spec.rules[0].matches[0].path.value |
| 101 | + value: / |
| 102 | + - equal: |
| 103 | + path: spec.rules[0].backendRefs[0].port |
| 104 | + value: 8080 |
| 105 | + |
| 106 | + - it: Multiple Hostnames |
| 107 | + set: |
| 108 | + web: |
| 109 | + route: |
| 110 | + enabled: true |
| 111 | + parentRefs: |
| 112 | + - name: test-parent |
| 113 | + namespace: test-namespace |
| 114 | + hostnames: |
| 115 | + - concourse.example.com |
| 116 | + - concourse.alternate.com |
| 117 | + template: web-route.yaml |
| 118 | + asserts: |
| 119 | + - equal: |
| 120 | + path: spec.hostnames[0] |
| 121 | + value: concourse.example.com |
| 122 | + - equal: |
| 123 | + path: spec.hostnames[1] |
| 124 | + value: concourse.alternate.com |
| 125 | + - lengthEqual: |
| 126 | + path: spec.hostnames |
| 127 | + count: 2 |
| 128 | + |
| 129 | + - it: Multiple ParentRefs |
| 130 | + set: |
| 131 | + web: |
| 132 | + route: |
| 133 | + enabled: true |
| 134 | + parentRefs: |
| 135 | + - name: test-parent-1 |
| 136 | + namespace: test-namespace-1 |
| 137 | + - name: test-parent-2 |
| 138 | + namespace: test-namespace-2 |
| 139 | + hostnames: |
| 140 | + - concourse.example.com |
| 141 | + template: web-route.yaml |
| 142 | + asserts: |
| 143 | + - equal: |
| 144 | + path: spec.parentRefs[0].name |
| 145 | + value: test-parent-1 |
| 146 | + - equal: |
| 147 | + path: spec.parentRefs[1].name |
| 148 | + value: test-parent-2 |
| 149 | + - lengthEqual: |
| 150 | + path: spec.parentRefs |
| 151 | + count: 2 |
0 commit comments