-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtest_virtual_router.yml
187 lines (175 loc) · 5.02 KB
/
test_virtual_router.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
name: Virtual Router Test
description: |
Basic Virtual Router test
cleanup:
- path: /virtual-router/test_virtual_router_uuid
- path: /network-ipam/test_virtual_router_ipam_uuid
test_data:
virtual_router: &test_virtual_router_test
uuid: test_virtual_router_uuid
parent_type: global-system-config
fq_name:
- default-global-system-config
- test-virtual-router
virtual_router_ip_address: 192.168.0.14
network_ipam: &test_virtual_router_ipam
uuid: test_virtual_router_ipam_uuid
parent_type: project
fq_name: ["default-domain","test-virtual-router-project","test-virtual-router-ipam"]
ipam_subnets:
subnets:
- subnet:
ip_prefix: "10.0.0.0"
ip_prefix_len: 24
allocation_pools:
- start: "10.0.0.0"
end: "10.0.0.255"
vrouter_specific_pool: false
- subnet:
ip_prefix: "10.0.1.0"
ip_prefix_len: 24
allocation_pools:
- start: "10.0.1.0"
end: "10.0.1.255"
vrouter_specific_pool: true
- subnet:
ip_prefix: "10.0.2.0"
ip_prefix_len: 24
allocation_pools:
- start: "10.0.2.0"
end: "10.0.2.255"
vrouter_specific_pool: true
ipam_subnet_method: flat-subnet
clients:
default:
id: alice
password: alice_password
insecure: true
scope:
project:
name: admin
workflow:
- name: create project
request:
path: /projects
method: POST
expected: [200]
data:
project:
parent_type: domain
fq_name: ["default-domain", "test-virtual-router-project"]
uuid: test_virtual_router_project_uuid
- name: create network ipam
request:
path: /network-ipams
method: POST
expected: [200]
data:
network-ipam: *test_virtual_router_ipam
expect: null
- name: create virtual router
request:
path: /virtual-routers
method: POST
expected: [200]
data:
virtual-router:
<<: *test_virtual_router_test
network_ipam_refs:
- uuid: test_virtual_router_ipam_uuid
attr:
allocation_pools:
- start: "10.0.1.0"
end: "10.0.1.255"
vrouter_specific_pool: true
expect:
virtual-router:
<<: *test_virtual_router_test
display_name: test-virtual-router
parent_uuid: beefbeef-beef-beef-beef-beefbeef0001
name: test-virtual-router
- name: add a new allocation pool
request:
path: /virtual-router/test_virtual_router_uuid
method: PUT
expected: [200]
data:
virtual-router:
network_ipam_refs:
- uuid: test_virtual_router_ipam_uuid
attr:
allocation_pools:
- start: "10.0.1.0"
end: "10.0.1.255"
vrouter_specific_pool: true
- start: "10.0.2.0"
end: "10.0.2.255"
vrouter_specific_pool: true
expect: null
- name: check if virtual router has two allocation pools
request:
path: /virtual-router/test_virtual_router_uuid
method: GET
expected: [200]
expect:
virtual-router:
network_ipam_refs:
- uuid: test_virtual_router_ipam_uuid
attr:
allocation_pools:
- start: "10.0.1.0"
end: "10.0.1.255"
vrouter_specific_pool: true
- start: "10.0.2.0"
end: "10.0.2.255"
vrouter_specific_pool: true
- name: try to add non vrouter specific allocation pool
request:
path: /virtual-router/test_virtual_router_uuid
method: PUT
expected: [400]
data:
virtual-router:
network_ipam_refs:
- uuid: test_virtual_router_ipam_uuid
attr:
allocation_pools:
- start: "10.0.0.0"
end: "10.0.0.255"
vrouter_specific_pool: true
- start: "10.0.1.0"
end: "10.0.1.255"
vrouter_specific_pool: true
- start: "10.0.2.0"
end: "10.0.2.255"
vrouter_specific_pool: true
expect: null
- name: delete vrouter specific allocation pool
request:
path: /virtual-router/test_virtual_router_uuid
method: PUT
expected: [200]
data:
virtual-router:
network_ipam_refs:
- uuid: test_virtual_router_ipam_uuid
attr:
allocation_pools:
- start: "10.0.2.0"
end: "10.0.2.255"
vrouter_specific_pool: true
expect: null
# TODO: Add test for trying to delete used allocation pool.
# It can be done when vrouter specific allocation will be implemented
- name: delete virtual router
request:
path: /virtual-router/test_virtual_router_uuid
method: DELETE
expected: [200]
expect: null
- name: delete network ipam
request:
path: /network-ipam/test_virtual_router_ipam_uuid
method: DELETE
expected: [200]
expect: null