aboutsummaryrefslogtreecommitdiffstats
path: root/archive/nbi/tests/deployment_test.yaml
blob: fe9d0d297725185c6eb8d783286f21b00ecf89de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
---
suite: test deployment behavior
templates:
  - deployment.yaml
tests:
  - it: "should render with default values (global)"
    asserts:
      - isKind:
          of: Deployment
      - equal:
          path: metadata.name
          value: RELEASE-NAME-nbi
      - equal:
          path: metadata.namespace
          value: NAMESPACE
      - matchRegex:
          path: metadata.labels.app
          pattern: nbi
      - matchRegex:
          path: spec.template.metadata.labels.app
          pattern: nbi
      - equal:
          path: spec.template.metadata.name
          value: RELEASE-NAME-nbi
      - equal:
          path: spec.replicas
          value: 1
      - isNull:
          path: spec.template.spec.nodeSelector
      - isNull:
          path: spec.template.spec.affinity

  - it: "should render with default value (container)"
    asserts:
      - equal:
          path: spec.template.spec.containers[0].name
          value: nbi
      - equal:
          path: spec.template.spec.containers[0].image
          value: nexus3.onap.org:10001/onap/externalapi/nbi:5.0.1
      - equal:
          path: spec.template.spec.containers[0].imagePullPolicy
          value: IfNotPresent
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATASOURCE_URL
            value: jdbc:mariadb://mariadb-galera:3306/nbi
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATASOURCE_USERNAME
            value: rene
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATASOURCE_PASSWORD
            valueFrom:
              secretKeyRef:
                name: RELEASE-NAME-nbi-config
                key: db-user-password
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATA_MONGODB_HOST
            value: nbi-mongohost.NAMESPACE
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATA_MONGODB_PORT
            value: "27017"
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATA_MONGODB_DATABASE
            value: ServiceOrderDB
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: ONAP_LCPCLOUDREGIONID
            value: RegionOne
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: ONAP_TENANTID
            value: 31047205ce114b60833b23e400d6a535
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: ONAP_CLOUDOWNER
            value: CloudOwner
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: NBI_URL
            value: http://nbi.NAMESPACE:8080/nbi/api/v4
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SDC_HOST
            value: http://sdc-be.NAMESPACE:8080
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SDC_HEADER_ECOMPINSTANCEID
            value: OOM
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SDC_HEADER_AUTHORIZATION
            value: Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: AAI_HOST
            value: http://aai.NAMESPACE:80
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: AAI_HEADER_AUTHORIZATION
            value: Basic QUFJOkFBSQ==
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SO_HOST
            value: http://so.NAMESPACE:8080
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: DMAAP_HOST
            value: http://message-router.NAMESPACE:3904
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: LOGGING_LEVEL_ORG_ONAP_NBI
            value: INFO
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: MSB_ENABLED
            value: "true"
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: MSB_DISCOVERY_HOST
            value: msb-discovery.NAMESPACE
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: MSB_DISCOVERY_PORT
            value: "10081"
      - equal:
          path: spec.template.spec.containers[0].livenessProbe
          value:
            initialDelaySeconds: 180
            periodSeconds: 30
            tcpSocket:
              port: 8080
      - equal:
          path: spec.template.spec.containers[0].readinessProbe
          value:
            initialDelaySeconds: 185
            periodSeconds: 30
            tcpSocket:
              port: 8080
      - contains:
          path: spec.template.spec.containers[0].ports
          content:
            containerPort: 8080
      - equal:
          path: spec.template.spec.containers[0].resources.limits.cpu
          value: 1
      - equal:
          path: spec.template.spec.containers[0].resources.limits.memory
          value: 2Gi
      - equal:
          path: spec.template.spec.containers[0].resources.requests.cpu
          value: 100m
      - equal:
          path: spec.template.spec.containers[0].resources.requests.memory
          value: 1Gi
  - it: "should render when deciding to use local cluster (container)"
    set:
      global:
        mariadbGalera:
          localCluster: true
    asserts:
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATASOURCE_URL
            value: jdbc:mariadb://nbi-galera:3306/nbi
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATASOURCE_USERNAME
            value: rene
      - contains:
          path: spec.template.spec.containers[0].env
          content:
            name: SPRING_DATASOURCE_PASSWORD
            valueFrom:
              secretKeyRef:
                name: RELEASE-NAME-nbi-nbi-galera
                key: user-password