-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtest_base_properties.yml
259 lines (236 loc) · 6.41 KB
/
test_base_properties.yml
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
name: Base poperties test
description: Tests handling of base properties
cleanup:
- path: /fabric/default_fabric
- path: /fabric/fabric_base_properties_uuid
- path: /project/project_base_properties_uuid
- path: /network-ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
test_data:
fabric_minimal: &fabric_minimal
uuid: fabric_base_properties_uuid
project: &project
fq_name:
- default-domain
- project_base_properties
uuid: project_base_properties_uuid
parent_type: domain
parent_uuid: beefbeef-beef-beef-beef-beefbeef0002
quota: {}
network_ipam: &network_ipam
fq_name:
- default-domain
- project_base_properties_uuid
- 4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
uuid: 4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
parent_type: project
parent_uuid: project_base_properties_uuid
id_perms_with_correct_uuid: &id_perms_with_correct_uuid
uuid:
uuid_lslong: 3335361290466096867
uuid_mslong: 5441706009095324062
clients:
default:
id: alice
password: alice_password
insecure: true
scope:
project:
name: admin
workflow:
##################################################################
# Name, DisplayName, ParentType, FQName and ParentUUID handling #
##################################################################
- name: create Fabric without parent_uuid and fq_name
request:
path: /fabrics
method: POST
expected: [400]
data:
fabric: *fabric_minimal
- name: create Fabric with parent_uuid
request:
path: /fabrics
method: POST
expected: [200]
data:
fabric:
<<: *fabric_minimal
parent_uuid: beefbeef-beef-beef-beef-beefbeef0001 # default global-system-config uuid
expect:
fabric:
<<: *fabric_minimal
name: default-fabric # default name is filled
display_name: default-fabric # display_name defaults to name
parent_type: global-system-config # parent_type filled - gsc is only possible parent for fabric
fq_name:
- default-global-system-config
- default-fabric
- name: delete Fabric
request:
path: /fabric/fabric_base_properties_uuid
method: DELETE
expected: [200]
- name: create Fabric with fq_name
request:
path: /fabrics
method: POST
expected: [200]
data:
fabric:
<<: *fabric_minimal
fq_name:
- default-global-system-config
- my-fabric
expect:
fabric:
<<: *fabric_minimal
name: my-fabric # default name is extracted from fq_name
display_name: my-fabric # display_name defaults to name
parent_type: global-system-config # parent_type filled - gsc is only possible parent for fabric
parent_uuid: beefbeef-beef-beef-beef-beefbeef0001 # parent_uuid filled using fq_name
fq_name:
- default-global-system-config
- my-fabric
- name: delete Fabric
request:
path: /fabric/fabric_base_properties_uuid
method: DELETE
expected: [200]
#####################
# ID perms handling #
#####################
- name: create Project
request:
path: /projects
method: POST
expected: [200]
data:
project: *project
expect:
project: *project
# TODO: API Server should verify if id_perms.uuid match uuid
- name: create Network IPAM with uuid and id_perms specified
request:
path: /network-ipams
method: POST
expected: [200]
data:
network-ipam:
<<: *network_ipam
id_perms:
uuid:
uuid_mslong: 123
uuid_lslong: 456
expect:
network-ipam:
<<: *network_ipam
id_perms:
uuid:
uuid_mslong: 123
uuid_lslong: 456
watchers:
/contrail/network_ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3:
- data:
<<: *network_ipam
id_perms:
uuid:
uuid_mslong: 123
uuid_lslong: 456
- name: update id_perms description
request:
path: /network-ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
method: PUT
expected:
- 200
data:
network-ipam:
id_perms:
description: my-description
expect:
network-ipam:
uuid: 4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
id_perms:
description: my-description
watchers:
/contrail/network_ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3:
- data:
<<: *network_ipam
id_perms:
description: my-description
- name: delete Network IPAM
request:
path: /network-ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
method: DELETE
expected: [200]
- name: create should fill id_perms.uuid given proper uuid property
request:
path: /network-ipams
method: POST
expected: [200]
data:
network-ipam:
<<: *network_ipam
expect:
network-ipam:
<<: *network_ipam
id_perms: *id_perms_with_correct_uuid
- name: update should not zero id_perms.uuid
request:
path: /network-ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
method: PUT
expected: [200]
data:
network-ipam:
<<: *network_ipam
id_perms:
uuid: null
expect:
network-ipam:
<<: *network_ipam
id_perms:
uuid: null
- name: verify id_perms.uuid was not modified after zeroing id_perms.uuid
request:
path: /network-ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
method: GET
expected: [200]
expect:
network-ipam:
<<: *network_ipam
id_perms: *id_perms_with_correct_uuid
- name: update should not modify id_perms.uuid
request:
path: /network-ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
method: PUT
expected: [200]
data:
network-ipam:
<<: *network_ipam
id_perms:
uuid:
uuid_lslong: 2222222222222222222
uuid_mslong: 1111111111111111111
expect:
network-ipam:
<<: *network_ipam
id_perms:
uuid: null
- name: verify id_perms.uuid was not modified after modifying id_perms.uuid
request:
path: /network-ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
method: GET
expected: [200]
expect:
network-ipam:
<<: *network_ipam
id_perms: *id_perms_with_correct_uuid
- name: delete Network IPAM
request:
path: /network-ipam/4b84d2c8-ac3c-419e-2e49-956c13d1f6e3
method: DELETE
expected: [200]
- name: delete Project
request:
path: /project/project_base_properties_uuid
method: DELETE
expected: [200]