Dong Ma | 0a05b5c | 2024-11-24 13:27:29 +0800 | [diff] [blame] | 1 | suite: nfs |
| 2 | tests: |
| 3 | - it: should support a single nfs backend with a single share |
| 4 | templates: |
| 5 | - templates/configmap-etc.yaml |
| 6 | - templates/deployment-volume.yaml |
| 7 | set: |
| 8 | conf: |
| 9 | backends: |
| 10 | nfs: |
| 11 | nfs_shares_config: test_content_1 |
| 12 | asserts: |
| 13 | - template: templates/configmap-etc.yaml |
| 14 | equal: |
| 15 | path: data.nfs-nfs |
| 16 | decodeBase64: true |
| 17 | value: test_content_1 |
| 18 | - template: templates/deployment-volume.yaml |
| 19 | documentIndex: 3 |
| 20 | equal: |
| 21 | path: spec.template.spec.containers[?(@.name=='cinder-volume')].volumeMounts[?(@.subPath=='nfs-nfs')] |
| 22 | value: |
| 23 | name: cinder-etc |
| 24 | mountPath: /etc/cinder/nfs/nfs |
| 25 | readOnly: true |
| 26 | subPath: nfs-nfs |
| 27 | |
| 28 | - it: should support a single nfs backend with multiple shares |
| 29 | templates: |
| 30 | - templates/configmap-etc.yaml |
| 31 | - templates/deployment-volume.yaml |
| 32 | set: |
| 33 | conf: |
| 34 | backends: |
| 35 | nfs: |
| 36 | nfs_shares_config: |
| 37 | - test_content_1 |
| 38 | - test_content_2 |
| 39 | asserts: |
| 40 | - template: templates/configmap-etc.yaml |
| 41 | equal: |
| 42 | path: data.nfs-nfs |
| 43 | decodeBase64: true |
| 44 | value: |- |
| 45 | test_content_1 |
| 46 | test_content_2 |
| 47 | - template: templates/deployment-volume.yaml |
| 48 | documentIndex: 3 |
| 49 | equal: |
| 50 | path: spec.template.spec.containers[?(@.name=='cinder-volume')].volumeMounts[?(@.subPath=='nfs-nfs')] |
| 51 | value: |
| 52 | name: cinder-etc |
| 53 | mountPath: /etc/cinder/nfs/nfs |
| 54 | readOnly: true |
| 55 | subPath: nfs-nfs |
| 56 | |
| 57 | - it: should support multiple nfs backends |
| 58 | templates: |
| 59 | - templates/configmap-etc.yaml |
| 60 | - templates/deployment-volume.yaml |
| 61 | set: |
| 62 | conf: |
| 63 | backends: |
| 64 | nfs1: |
| 65 | nfs_shares_config: test_content_1 |
| 66 | nfs2: |
| 67 | nfs_shares_config: test_content_2 |
| 68 | asserts: |
| 69 | - template: templates/configmap-etc.yaml |
| 70 | equal: |
| 71 | path: data.nfs-nfs1 |
| 72 | decodeBase64: true |
| 73 | value: test_content_1 |
| 74 | - template: templates/configmap-etc.yaml |
| 75 | equal: |
| 76 | path: data.nfs-nfs2 |
| 77 | decodeBase64: true |
| 78 | value: test_content_2 |
| 79 | - template: templates/deployment-volume.yaml |
| 80 | documentIndex: 3 |
| 81 | equal: |
| 82 | path: spec.template.spec.containers[?(@.name=='cinder-volume')].volumeMounts[?(@.subPath=='nfs-nfs1')] |
| 83 | value: |
| 84 | name: cinder-etc |
| 85 | mountPath: /etc/cinder/nfs/nfs1 |
| 86 | readOnly: true |
| 87 | subPath: nfs-nfs1 |
| 88 | - template: templates/deployment-volume.yaml |
| 89 | documentIndex: 3 |
| 90 | equal: |
| 91 | path: spec.template.spec.containers[?(@.name=='cinder-volume')].volumeMounts[?(@.subPath=='nfs-nfs2')] |
| 92 | value: |
| 93 | name: cinder-etc |
| 94 | mountPath: /etc/cinder/nfs/nfs2 |
| 95 | readOnly: true |
| 96 | subPath: nfs-nfs2 |