Browse Source

Update tests for network templates

Closes-Bug: 1632332
Change-Id: I8ebac9d95de2a86bc9ddcbf2287b81ec9ff6fa06
(cherry picked from commit e26d83beef)
changes/51/446351/1
Sergey Novikov 2 years ago
parent
commit
9a1d0694cc

+ 0
- 28
fuelweb_test/network_templates/ceph.yaml View File

@@ -36,8 +36,6 @@ adv_net_template:
36 36
           ep: br-fw-admin
37 37
         fake:
38 38
           ep: br-fake
39
-        mongo:
40
-          ep: br-mongo
41 39
         keystone:
42 40
           ep: br-keystone
43 41
         neutron-api:
@@ -48,8 +46,6 @@ adv_net_template:
48 46
           ep: br-swift
49 47
         sahara:
50 48
           ep: br-sahara
51
-        ceilometer:
52
-          ep: br-ceilometer
53 49
         cinder:
54 50
           ep: br-cinder
55 51
         glance:
@@ -60,8 +56,6 @@ adv_net_template:
60 56
           ep: br-nova
61 57
         nova-migration:
62 58
           ep: br-novamigr
63
-        murano:
64
-          ep: br-murano
65 59
         horizon:
66 60
           ep: br-horizon
67 61
         messaging:
@@ -176,11 +170,6 @@ adv_net_template:
176 170
           ironic/baremetal: br-fake
177 171
       custom:
178 172
         transformations:
179
-          - action: add-br
180
-            name: br-mongo
181
-          - action: add-port
182
-            bridge: br-mongo
183
-            name: <% if4 %>.201
184 173
           - action: add-br
185 174
             name: br-keystone
186 175
           - action: add-port
@@ -206,11 +195,6 @@ adv_net_template:
206 195
           - action: add-port
207 196
             bridge: br-sahara
208 197
             name: <% if4 %>.206
209
-          - action: add-br
210
-            name: br-ceilometer
211
-          - action: add-port
212
-            bridge: br-ceilometer
213
-            name: <% if4 %>.207
214 198
           - action: add-br
215 199
             name: br-cinder
216 200
           - action: add-port
@@ -236,11 +220,6 @@ adv_net_template:
236 220
           - action: add-port
237 221
             bridge: br-novamigr
238 222
             name: <% if4 %>.212
239
-          - action: add-br
240
-            name: br-murano
241
-          - action: add-port
242
-            bridge: br-murano
243
-            name: <% if4 %>.213
244 223
           - action: add-br
245 224
             name: br-horizon
246 225
           - action: add-port
@@ -287,19 +266,16 @@ adv_net_template:
287 266
             bridge: br-cephrados
288 267
             name: <% if4 %>.222
289 268
         endpoints:
290
-          - br-mongo
291 269
           - br-keystone
292 270
           - br-neutronapi
293 271
           - br-neutronmesh
294 272
           - br-swift
295 273
           - br-sahara
296
-          - br-ceilometer
297 274
           - br-cinder
298 275
           - br-glance
299 276
           - br-heat
300 277
           - br-nova
301 278
           - br-novamigr
302
-          - br-murano
303 279
           - br-horizon
304 280
           - br-messaging
305 281
           - br-corosync
@@ -310,20 +286,16 @@ adv_net_template:
310 286
           - br-cephrepl
311 287
           - br-cephrados
312 288
         roles:
313
-          mongo/db: br-mongo
314 289
           keystone/api: br-keystone
315 290
           neutron/api: br-neutronapi
316 291
           neutron/mesh: br-neutronmesh
317 292
           swift/api: br-swift
318 293
           sahara/api: br-sahara
319
-          ceilometer/api: br-ceilometer
320 294
           cinder/api: br-cinder
321 295
           glance/api: br-glance
322 296
           heat/api: br-heat
323 297
           nova/api: br-nova
324 298
           nova/migration: br-novamigr
325
-          murano/api: br-murano
326
-          murano/cfapi: br-murano
327 299
           horizon: br-horizon
328 300
           mgmt/messaging: br-messaging
329 301
           mgmt/corosync: br-corosync

+ 0
- 28
fuelweb_test/network_templates/cinder.yaml View File

@@ -36,8 +36,6 @@ adv_net_template:
36 36
           ep: br-fw-admin
37 37
         fake:
38 38
           ep: br-fake
39
-        mongo:
40
-          ep: br-mongo
41 39
         keystone:
42 40
           ep: br-keystone
43 41
         neutron-api:
@@ -48,8 +46,6 @@ adv_net_template:
48 46
           ep: br-swift
49 47
         sahara:
50 48
           ep: br-sahara
51
-        ceilometer:
52
-          ep: br-ceilometer
53 49
         cinder:
54 50
           ep: br-cinder
55 51
         glance:
@@ -60,8 +56,6 @@ adv_net_template:
60 56
           ep: br-nova
61 57
         nova-migration:
62 58
           ep: br-novamigr
63
-        murano:
64
-          ep: br-murano
65 59
         horizon:
66 60
           ep: br-horizon
67 61
         messaging:
@@ -167,11 +161,6 @@ adv_net_template:
167 161
           ironic/baremetal: br-fake
168 162
       custom:
169 163
         transformations:
170
-          - action: add-br
171
-            name: br-mongo
172
-          - action: add-port
173
-            bridge: br-mongo
174
-            name: <% if4 %>.201
175 164
           - action: add-br
176 165
             name: br-keystone
177 166
           - action: add-port
@@ -197,11 +186,6 @@ adv_net_template:
197 186
           - action: add-port
198 187
             bridge: br-sahara
199 188
             name: <% if4 %>.206
200
-          - action: add-br
201
-            name: br-ceilometer
202
-          - action: add-port
203
-            bridge: br-ceilometer
204
-            name: <% if4 %>.207
205 189
           - action: add-br
206 190
             name: br-cinder
207 191
           - action: add-port
@@ -227,11 +211,6 @@ adv_net_template:
227 211
           - action: add-port
228 212
             bridge: br-novamigr
229 213
             name: <% if4 %>.212
230
-          - action: add-br
231
-            name: br-murano
232
-          - action: add-port
233
-            bridge: br-murano
234
-            name: <% if4 %>.213
235 214
           - action: add-br
236 215
             name: br-horizon
237 216
           - action: add-port
@@ -268,19 +247,16 @@ adv_net_template:
268 247
             bridge: br-swiftrepl
269 248
             name: <% if4 %>.220
270 249
         endpoints:
271
-          - br-mongo
272 250
           - br-keystone
273 251
           - br-neutronapi
274 252
           - br-neutronmesh
275 253
           - br-swift
276 254
           - br-sahara
277
-          - br-ceilometer
278 255
           - br-cinder
279 256
           - br-glance
280 257
           - br-heat
281 258
           - br-nova
282 259
           - br-novamigr
283
-          - br-murano
284 260
           - br-horizon
285 261
           - br-messaging
286 262
           - br-corosync
@@ -289,20 +265,16 @@ adv_net_template:
289 265
           - br-cinderiscsi
290 266
           - br-swiftrepl
291 267
         roles:
292
-          mongo/db: br-mongo
293 268
           keystone/api: br-keystone
294 269
           neutron/api: br-neutronapi
295 270
           neutron/mesh: br-neutronmesh
296 271
           swift/api: br-swift
297 272
           sahara/api: br-sahara
298
-          ceilometer/api: br-ceilometer
299 273
           cinder/api: br-cinder
300 274
           glance/api: br-glance
301 275
           heat/api: br-heat
302 276
           nova/api: br-nova
303 277
           nova/migration: br-novamigr
304
-          murano/api: br-murano
305
-          murano/cfapi: br-murano
306 278
           horizon: br-horizon
307 279
           mgmt/messaging: br-messaging
308 280
           mgmt/corosync: br-corosync

+ 0
- 28
fuelweb_test/network_templates/cinder_add_nodes.yaml View File

@@ -42,8 +42,6 @@ adv_net_template:
42 42
           ep: br-fw-admin
43 43
         fake:
44 44
           ep: br-fake
45
-        mongo:
46
-          ep: br-mongo
47 45
         keystone:
48 46
           ep: br-keystone
49 47
         neutron-api:
@@ -54,8 +52,6 @@ adv_net_template:
54 52
           ep: br-swift
55 53
         sahara:
56 54
           ep: br-sahara
57
-        ceilometer:
58
-          ep: br-ceilometer
59 55
         cinder:
60 56
           ep: br-cinder
61 57
         glance:
@@ -66,8 +62,6 @@ adv_net_template:
66 62
           ep: br-nova
67 63
         nova-migration:
68 64
           ep: br-novamigr
69
-        murano:
70
-          ep: br-murano
71 65
         horizon:
72 66
           ep: br-horizon
73 67
         messaging:
@@ -173,11 +167,6 @@ adv_net_template:
173 167
           ironic/baremetal: br-fake
174 168
       custom:
175 169
         transformations:
176
-          - action: add-br
177
-            name: br-mongo
178
-          - action: add-port
179
-            bridge: br-mongo
180
-            name: <% if4 %>.201
181 170
           - action: add-br
182 171
             name: br-keystone
183 172
           - action: add-port
@@ -203,11 +192,6 @@ adv_net_template:
203 192
           - action: add-port
204 193
             bridge: br-sahara
205 194
             name: <% if4 %>.206
206
-          - action: add-br
207
-            name: br-ceilometer
208
-          - action: add-port
209
-            bridge: br-ceilometer
210
-            name: <% if4 %>.207
211 195
           - action: add-br
212 196
             name: br-cinder
213 197
           - action: add-port
@@ -233,11 +217,6 @@ adv_net_template:
233 217
           - action: add-port
234 218
             bridge: br-novamigr
235 219
             name: <% if4 %>.212
236
-          - action: add-br
237
-            name: br-murano
238
-          - action: add-port
239
-            bridge: br-murano
240
-            name: <% if4 %>.213
241 220
           - action: add-br
242 221
             name: br-horizon
243 222
           - action: add-port
@@ -274,19 +253,16 @@ adv_net_template:
274 253
             bridge: br-swiftrepl
275 254
             name: <% if4 %>.220
276 255
         endpoints:
277
-          - br-mongo
278 256
           - br-keystone
279 257
           - br-neutronapi
280 258
           - br-neutronmesh
281 259
           - br-swift
282 260
           - br-sahara
283
-          - br-ceilometer
284 261
           - br-cinder
285 262
           - br-glance
286 263
           - br-heat
287 264
           - br-nova
288 265
           - br-novamigr
289
-          - br-murano
290 266
           - br-horizon
291 267
           - br-messaging
292 268
           - br-corosync
@@ -295,20 +271,16 @@ adv_net_template:
295 271
           - br-cinderiscsi
296 272
           - br-swiftrepl
297 273
         roles:
298
-          mongo/db: br-mongo
299 274
           keystone/api: br-keystone
300 275
           neutron/api: br-neutronapi
301 276
           neutron/mesh: br-neutronmesh
302 277
           swift/api: br-swift
303 278
           sahara/api: br-sahara
304
-          ceilometer/api: br-ceilometer
305 279
           cinder/api: br-cinder
306 280
           glance/api: br-glance
307 281
           heat/api: br-heat
308 282
           nova/api: br-nova
309 283
           nova/migration: br-novamigr
310
-          murano/api: br-murano
311
-          murano/cfapi: br-murano
312 284
           horizon: br-horizon
313 285
           mgmt/messaging: br-messaging
314 286
           mgmt/corosync: br-corosync

+ 0
- 4
fuelweb_test/network_templates/default.yaml View File

@@ -110,21 +110,17 @@ adv_net_template:
110 110
         roles:
111 111
           admin/pxe: br-fw-admin
112 112
           fw-admin: br-fw-admin
113
-          mongo/db: br-mgmt
114 113
           management: br-mgmt
115 114
           keystone/api: br-mgmt
116 115
           neutron/api: br-mgmt
117 116
           neutron/mesh: br-mgmt
118 117
           swift/api: br-mgmt
119 118
           sahara/api: br-mgmt
120
-          ceilometer/api: br-mgmt
121 119
           cinder/api: br-mgmt
122 120
           glance/api: br-mgmt
123 121
           heat/api: br-mgmt
124 122
           nova/api: br-mgmt
125 123
           nova/migration: br-mgmt
126
-          murano/api: br-mgmt
127
-          murano/cfapi: br-mgmt
128 124
           horizon: br-mgmt
129 125
           mgmt/api: br-mgmt
130 126
           mgmt/memcache: br-mgmt

+ 0
- 4
fuelweb_test/network_templates/default_no_mgmt_nwk.yaml View File

@@ -102,20 +102,16 @@ adv_net_template:
102 102
         roles:
103 103
           admin/pxe: br-fw-admin
104 104
           fw-admin: br-fw-admin
105
-          mongo/db: br-fw-admin
106 105
           management: br-fw-admin
107 106
           keystone/api: br-fw-admin
108 107
           neutron/api: br-fw-admin
109 108
           neutron/mesh: br-fw-admin
110 109
           sahara/api: br-fw-admin
111
-          ceilometer/api: br-fw-admin
112 110
           cinder/api: br-fw-admin
113 111
           glance/api: br-fw-admin
114 112
           heat/api: br-fw-admin
115 113
           nova/api: br-fw-admin
116 114
           nova/migration: br-fw-admin
117
-          murano/api: br-fw-admin
118
-          murano/cfapi: br-fw-admin
119 115
           horizon: br-fw-admin
120 116
           mgmt/api: br-fw-admin
121 117
           mgmt/memcache: br-fw-admin

+ 0
- 4
fuelweb_test/network_templates/default_ovs.yaml View File

@@ -121,21 +121,17 @@ adv_net_template:
121 121
         roles:
122 122
           admin/pxe: br-fw-admin
123 123
           fw-admin: br-fw-admin
124
-          mongo/db: br-mgmt
125 124
           management: br-mgmt
126 125
           keystone/api: br-mgmt
127 126
           neutron/api: br-mgmt
128 127
           neutron/mesh: br-mgmt
129 128
           swift/api: br-mgmt
130 129
           sahara/api: br-mgmt
131
-          ceilometer/api: br-mgmt
132 130
           cinder/api: br-mgmt
133 131
           glance/api: br-mgmt
134 132
           heat/api: br-mgmt
135 133
           nova/api: br-mgmt
136 134
           nova/migration: br-mgmt
137
-          murano/api: br-mgmt
138
-          murano/cfapi: br-mgmt
139 135
           horizon: br-mgmt
140 136
           mgmt/api: br-mgmt
141 137
           mgmt/memcache: br-mgmt

+ 0
- 22
fuelweb_test/network_templates/hardware.yaml View File

@@ -13,8 +13,6 @@ adv_net_template:
13 13
         ep: br-mgmt
14 14
       messaging:
15 15
         ep: br-messaging
16
-      mongo:
17
-        ep: br-mongo
18 16
       openstack:
19 17
         ep: br-openstack
20 18
       private:
@@ -98,17 +96,6 @@ adv_net_template:
98 96
         - action: add-port
99 97
           bridge: br-messaging
100 98
           name: <% if2 %>.368
101
-      mongo:
102
-        endpoints:
103
-        - br-mongo
104
-        roles:
105
-          mongo/db: br-mongo
106
-        transformations:
107
-        - action: add-br
108
-          name: br-mongo
109
-        - action: add-port
110
-          bridge: br-mongo
111
-          name: <% if1 %>.369
112 99
       openstack:
113 100
         endpoints:
114 101
         - br-openstack
@@ -171,10 +158,7 @@ adv_net_template:
171 158
         endpoints:
172 159
         - br-services
173 160
         roles:
174
-          ceilometer/api: br-services
175 161
           heat/api: br-services
176
-          murano/api: br-services
177
-          murano/cfapi: br-services
178 162
           sahara/api: br-services
179 163
         transformations:
180 164
         - action: add-br
@@ -237,9 +221,3 @@ adv_net_template:
237 221
       - openstack
238 222
       - database
239 223
       - messaging
240
-      - mongo
241
-      mongo:
242
-      - admin
243
-      - management
244
-      - messaging
245
-      - mongo

+ 0
- 4
fuelweb_test/network_templates/public_api.yaml View File

@@ -30,7 +30,6 @@ adv_net_template:
30 30
         endpoints:
31 31
         - br-mgmt
32 32
         roles:
33
-          ceilometer/api: br-mgmt
34 33
           ceph/radosgw: br-mgmt
35 34
           ceph/replication: br-mgmt
36 35
           cinder/api: br-mgmt
@@ -48,9 +47,6 @@ adv_net_template:
48 47
           mgmt/memcache: br-mgmt
49 48
           mgmt/messaging: br-mgmt
50 49
           mgmt/vip: br-mgmt
51
-          mongo/db: br-mgmt
52
-          murano/api: br-mgmt
53
-          murano/cfapi: br-mgmt
54 50
           neutron/api: br-mgmt
55 51
           neutron/mesh: br-mgmt
56 52
           nova/api: br-mgmt

+ 0
- 7
fuelweb_test/network_templates/two_nodegroups.yaml View File

@@ -86,20 +86,16 @@ adv_net_template:
86 86
           management: br-mgmt
87 87
           mgmt/vip: br-mgmt
88 88
           mgmt/api: br-mgmt
89
-          mongo/db: br-mgmt
90 89
           keystone/api: br-mgmt
91 90
           neutron/api: br-mgmt
92 91
           neutron/mesh: br-mgmt
93 92
           swift/api: br-mgmt
94 93
           sahara/api: br-mgmt
95
-          ceilometer/api: br-mgmt
96 94
           cinder/api: br-mgmt
97 95
           glance/api: br-mgmt
98 96
           heat/api: br-mgmt
99 97
           nova/api: br-mgmt
100 98
           nova/migration: br-mgmt
101
-          murano/api: br-mgmt
102
-          murano/cfapi: br-mgmt
103 99
           horizon: br-mgmt
104 100
           mgmt/messaging: br-mgmt
105 101
           mgmt/corosync: br-mgmt
@@ -231,19 +227,16 @@ adv_net_template:
231 227
           management: br-mgmt
232 228
           mgmt/vip: br-mgmt
233 229
           mgmt/api: br-mgmt
234
-          mongo/db: br-mgmt
235 230
           keystone/api: br-mgmt
236 231
           neutron/api: br-mgmt
237 232
           neutron/mesh: br-mgmt
238 233
           swift/api: br-mgmt
239 234
           sahara/api: br-mgmt
240
-          ceilometer/api: br-mgmt
241 235
           cinder/api: br-mgmt
242 236
           glance/api: br-mgmt
243 237
           heat/api: br-mgmt
244 238
           nova/api: br-mgmt
245 239
           nova/migration: br-mgmt
246
-          murano/api: br-mgmt
247 240
           horizon: br-mgmt
248 241
           mgmt/messaging: br-mgmt
249 242
           mgmt/corosync: br-mgmt

+ 33
- 12
fuelweb_test/tests/test_net_templates_base.py View File

@@ -44,13 +44,11 @@ class TestNetworkTemplatesBase(TestBasic):
44 44
         :param template: Yaml template with network assignments on interfaces.
45 45
         :param ip_nets: Dict with network descriptions.
46 46
         :param ip_prefixlen: Integer for slicing network prefix.
47
-        :return: Data to be used to assign networks to nodes.
47
+        :return: Data to be used to assign networks to nodes
48 48
         """
49 49
         networks_data = []
50 50
         nodegroups = self.fuel_web.client.get_nodegroups()
51 51
         for nodegroup, section in template['adv_net_template'].items():
52
-            networks = [(n, section['network_assignments'][n]['ep'])
53
-                        for n in section['network_assignments']]
54 52
             assert_true(any(n['name'] == nodegroup for n in nodegroups),
55 53
                         'Network templates contains settings for Node Group '
56 54
                         '"{0}", which does not exist!'.format(nodegroup))
@@ -58,14 +56,13 @@ class TestNetworkTemplatesBase(TestBasic):
58 56
                         n['name'] == nodegroup][0]
59 57
             ip_network = netaddr.IPNetwork(str(ip_nets[nodegroup]))
60 58
             ip_subnets = list(ip_network.subnet(int(ip_prefixlen)))
61
-            for network, interface in networks:
59
+            for network in section['network_assignments']:
62 60
                 ip_subnet = ip_subnets.pop()
63 61
                 networks_data.append(
64 62
                     {
65 63
                         'name': network,
66 64
                         'cidr': str(ip_subnet),
67 65
                         'group_id': group_id,
68
-                        'interface': interface,
69 66
                         'gateway': None,
70 67
                         'meta': {
71 68
                             "notation": "ip_ranges",
@@ -81,6 +78,26 @@ class TestNetworkTemplatesBase(TestBasic):
81 78
                 )
82 79
         return networks_data
83 80
 
81
+    @logwrap
82
+    def map_group_by_iface_and_network(self, template):
83
+        """ Map groip id, iface name and network name
84
+
85
+        :param template: Yaml template with network assignments on interfaces.
86
+        :return: Data to be used for check of ip assignment
87
+        """
88
+        mapped_data = {}
89
+        nodegroups = self.fuel_web.client.get_nodegroups()
90
+        for nodegroup, section in template['adv_net_template'].items():
91
+            networks = [(n, section['network_assignments'][n]['ep'])
92
+                        for n in section['network_assignments']]
93
+            assert_true(any(n['name'] == nodegroup for n in nodegroups),
94
+                        'Network templates contains settings for Node Group '
95
+                        '"{0}", which does not exist!'.format(nodegroup))
96
+            group_id = [n['id'] for n in nodegroups if
97
+                        n['name'] == nodegroup][0]
98
+            mapped_data[group_id] = dict(networks)
99
+        return mapped_data
100
+
84 101
     @staticmethod
85 102
     @logwrap
86 103
     def get_template_ep_for_role(template, role, nodegroup='default',
@@ -172,6 +189,7 @@ class TestNetworkTemplatesBase(TestBasic):
172 189
         # Network for Neutron is configured in namespaces (l3/dhcp agents)
173 190
         # and a bridge for it doesn't have IP, so skipping it for now
174 191
         skip_roles = {'neutron/private'}
192
+        mapped_data = self.map_group_by_iface_and_network(network_template)
175 193
         for node in self.fuel_web.client.list_cluster_nodes(cluster_id):
176 194
             node_networks = set()
177 195
             node_group_name = [ng['name'] for ng in
@@ -188,13 +206,16 @@ class TestNetworkTemplatesBase(TestBasic):
188 206
                     if network['name'] not in node_networks or \
189 207
                             network['group_id'] != node['group_id']:
190 208
                         continue
191
-                    logger.debug('Checking interface "{0}" for IP network '
192
-                                 '"{1}" on "{2}"'.format(network['interface'],
193
-                                                         network['cidr'],
194
-                                                         node['hostname']))
195
-                    self.check_interface_ip_exists(remote,
196
-                                                   network['interface'],
197
-                                                   network['cidr'])
209
+                    logger.debug(
210
+                        'Checking interface "{0}" for IP network '
211
+                        '"{1}" on "{2}"'.format(
212
+                            mapped_data[node['group_id']][network['name']],
213
+                            network['cidr'],
214
+                            node['hostname']))
215
+                    self.check_interface_ip_exists(
216
+                        remote,
217
+                        mapped_data[node['group_id']][network['name']],
218
+                        network['cidr'])
198 219
 
199 220
     @staticmethod
200 221
     @logwrap

Loading…
Cancel
Save