-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtest_int_pool.yml
293 lines (264 loc) · 5.3 KB
/
test_int_pool.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
name: Test int pool allocation
description: |
Integration test for /int-pool endpoint which
handles allocating ints in precreated pools and dynamically created pools
clients:
default:
id: alice
password: alice_password
insecure: true
scope:
project:
name: admin
workflow:
# Five deallocations instead of cleanup. Cleanup cannot pass json data which is required by deallocation.
- name: cleanup - deallocate first int
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: virtual_network_id
value: 5
expect: null
- name: cleanup - deallocate second int
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: virtual_network_id
value: 6
expect: null
- name: cleanup - deallocate third int
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: virtual_network_id
value: 1337
expect: null
- name: cleanup - deallocate fourth int
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: route_target_number
value: 8001000
expect: null
- name: cleanup - delete test int pool
request:
path: /int-pools
method: DELETE
expected: [200]
data:
pool: test_int_pool
- name: allocate first int
request:
path: /int-pool
method: POST
expected: [200]
data:
pool: virtual_network_id
expect:
value: 5
- name: allocate next int
request:
path: /int-pool
method: POST
expected: [200]
data:
pool: virtual_network_id
expect:
value: 6
- name: deallocate one int
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: virtual_network_id
value: 5
expect: null
- name: allocate next int again
request:
path: /int-pool
method: POST
expected: [200]
data:
pool: virtual_network_id
expect:
value: 5
- name: allocate specified int
request:
path: /int-pool
method: POST
expected: [200]
data:
pool: virtual_network_id
value: 1337
expect:
value: 1337
- name: fail to allocate same int
request:
path: /int-pool
method: POST
expected: [400]
data:
pool: virtual_network_id
value: 1337
expect: null
- name: deallocate specified int
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: virtual_network_id
value: 1337
expect: null
- name: deallocate same int twice should pass
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: virtual_network_id
value: 1337
expect: null
- name: deallocate generated int 1
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: virtual_network_id
value: 6
expect: null
- name: deallocate generated int 2
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: virtual_network_id
value: 5
expect: null
- name: allocate route target number
request:
path: /int-pool
method: POST
expected: [200]
data:
pool: route_target_number
value: 8001000
expect:
value: 8001000
- name: deallocate allocated route target number
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: route_target_number
value: 8001000
expect: null
- name: deallocate with empty data
request:
path: /int-pool
method: DELETE
expected: [400]
expect: null
- name: deallocate without value
request:
path: /int-pool
method: DELETE
expected: [400]
data:
pool: virtual_network_id
expect: null
- name: deallocate without pool name
request:
path: /int-pool
method: DELETE
expected: [400]
data:
value: 111
expect: null
- name: allocate without pool name
request:
path: /int-pool
method: POST
expected: [400]
data:
value: 111
expect: null
- name: create test int pool
request:
path: /int-pools
method: POST
expected: [200]
data:
pool: test_int_pool
start: 100
end: 200
- name: try to create test int pool in already allocated area
request:
path: /int-pools
method: POST
expected: [409]
data:
pool: test_int_pool
start: 150
end: 160
- name: allocate int in test int pool
request:
path: /int-pool
method: POST
expected: [200]
data:
pool: test_int_pool
owner: test_int_owner
expect:
value: 100
- name: get owner of allocated int
request:
path: /int-pool?pool=test_int_pool&value=100
method: GET
expected: [200]
expect:
owner: test_int_owner
- name: allocate int in test int pool without owner
request:
path: /int-pool
method: POST
expected: [200]
data:
pool: test_int_pool
expect:
value: 101
- name: try to get owner of allocated int which not specified owner
request:
path: /int-pool?pool=test_int_pool&value=101
method: GET
expected: [200]
expect:
owner: null
- name: deallocate int from test int pool
request:
path: /int-pool
method: DELETE
expected: [200]
data:
pool: test_int_pool
value: 100
expect: null
- name: delete test int pool
request:
path: /int-pools
method: DELETE
expected: [200]
data:
pool: test_int_pool