Browse Source

Calculation of interface types from templates fixed

In case of adding port on bond 'ether' type was set
for interface. This was root cause of the issue -
bond was processed as nic.

Closes-Bug: #1602817
Change-Id: I6a5136ce9ce5398aa6d55c795857769a7a41f7b0
Dmitry Guryanov 2 years ago
parent
commit
392f3859ff

+ 30
- 8
nailgun/nailgun/extensions/network_manager/managers/neutron.py View File

@@ -34,7 +34,7 @@ from nailgun.extensions.network_manager.manager import NetworkManager
34 34
 from nailgun import objects
35 35
 
36 36
 from nailgun.extensions.network_manager.serializers.neutron_serializers \
37
-    import NeutronNetworkTemplateSerializer70
37
+    import NeutronNetworkTemplateSerializer110
38 38
 
39 39
 
40 40
 class NeutronManager(NetworkManager):
@@ -363,7 +363,7 @@ class NeutronManager70(
363 363
         except ValueError:
364 364
             vlan = None
365 365
 
366
-        return (iface, vlan)
366
+        return iface, vlan
367 367
 
368 368
     @classmethod
369 369
     def get_interfaces_from_template(cls, node):
@@ -372,15 +372,37 @@ class NeutronManager70(
372 372
         Returns a list of bare interfaces and bonds.
373 373
         """
374 374
         transformations = \
375
-            NeutronNetworkTemplateSerializer70.generate_transformations(node)
375
+            NeutronNetworkTemplateSerializer110.generate_transformations(node)
376 376
 
377 377
         interfaces = {}
378 378
         for tx in transformations:
379 379
             if tx['action'] == 'add-port':
380
-                key = tx.get('bridge', tx['name'])
380
+                name = tx['name']
381
+                key = tx.get('bridge', name)
382
+
383
+                iface_type = consts.NETWORK_INTERFACE_TYPES.ether
384
+
385
+                if tx.get('provider') == consts.NEUTRON_L23_PROVIDERS.ovs:
386
+                    iface_name = name
387
+                    vlan = tx.get('vlan_id')
388
+                else:
389
+                    iface_name, vlan = cls._split_iface_name(name)
390
+
391
+                if vlan is not None:
392
+                    # We can't resolve bond type in case of adding port
393
+                    # on the bond. Ether type can be set only if NIC with
394
+                    # iface_name present in the DB
395
+                    nic = objects.NIC.get_nic_by_name(node, iface_name)
396
+                    if nic is None:
397
+                        # We can't detect if vlan configured on the non
398
+                        # existent NIC. In this case iface will have type
399
+                        # BOND. Should be fixed in
400
+                        # https://bugs.launchpad.net/fuel/+bug/1664286
401
+                        iface_type = consts.NETWORK_INTERFACE_TYPES.bond
402
+
381 403
                 interfaces[key] = {
382
-                    'name': tx['name'],
383
-                    'type': consts.NETWORK_INTERFACE_TYPES.ether
404
+                    'name': name,
405
+                    'type': iface_type
384 406
                 }
385 407
 
386 408
             if tx['action'] == 'add-bond':
@@ -489,8 +511,8 @@ class NeutronManager70(
489 511
                 if nic is None:
490 512
                     raise errors.NetworkTemplateCannotBeApplied(
491 513
                         "Networks cannot be assigned as interface with name "
492
-                        "{0} does not exist for node {1}"
493
-                        .format(iface, objects.Node.get_slave_name(node))
514
+                        "{0} does not exist for node {1}".format(
515
+                            iface, objects.Node.get_slave_name(node))
494 516
                     )
495 517
 
496 518
                 node_ifaces[iface]['id'] = nic.id

+ 60
- 21
nailgun/nailgun/extensions/network_manager/tests/test_network_manager.py View File

@@ -44,6 +44,8 @@ from nailgun.extensions.network_manager.managers.neutron import \
44 44
     NeutronManager70
45 45
 from nailgun.extensions.network_manager.managers.neutron import \
46 46
     NeutronManager80
47
+from nailgun.extensions.network_manager.managers.neutron import \
48
+    NeutronManager90
47 49
 from nailgun.extensions.network_manager.managers.nova_network import \
48 50
     NovaNetworkManager
49 51
 from nailgun.extensions.network_manager.managers.nova_network import \
@@ -1698,70 +1700,51 @@ class TestTemplateManager70(BaseIntegrationTest):
1698 1700
     def test_get_interfaces_from_template(self):
1699 1701
         expected_interfaces = {
1700 1702
             'br-aux': {
1701
-                'interface_properties': {},
1702
-                'name': 'eth3.103',
1703
-                'offloading_modes': [],
1703
+                'name': 'eth2.103',
1704 1704
                 'type': 'ether'
1705 1705
             },
1706 1706
             'br-ex': {
1707
-                'interface_properties': {},
1708 1707
                 'name': 'eth1',
1709
-                'offloading_modes': [],
1710 1708
                 'type': 'ether'
1711 1709
             },
1712 1710
             'br-fw-admin': {
1713
-                'interface_properties': {},
1714 1711
                 'name': 'eth0',
1715
-                'offloading_modes': [],
1716 1712
                 'type': 'ether'
1717 1713
             },
1718 1714
             'br-keystone': {
1719
-                'interface_properties': {},
1720 1715
                 'name': 'eth4.202',
1721
-                'offloading_modes': [],
1722 1716
                 'type': 'ether'
1723 1717
             },
1724 1718
             'br-mgmt': {
1725 1719
                 'bond_properties': {'mode': u'active-backup'},
1726 1720
                 'name': u'lnxbond0',
1727
-                'offloading_modes': [],
1728 1721
                 'slaves': [{'name': u'eth3'}, {'name': u'eth4'}],
1729 1722
                 'type': 'bond'
1730 1723
             },
1731 1724
             'br-mongo': {
1732
-                'interface_properties': {},
1733 1725
                 'name': u'eth4.201',
1734
-                'offloading_modes': [],
1735 1726
                 'type': 'ether'
1736 1727
             },
1737 1728
             'br-storage': {
1738
-                'interface_properties': {},
1739 1729
                 'name': 'eth1.102',
1740
-                'offloading_modes': [],
1741 1730
                 'type': 'ether'
1742 1731
             },
1743 1732
             'eth2': {
1744
-                'interface_properties': {},
1745 1733
                 'name': 'eth2',
1746
-                'offloading_modes': [],
1747 1734
                 'type': 'ether'
1748 1735
             },
1749 1736
             'eth3.101': {
1750
-                'interface_properties': {},
1751 1737
                 'name': u'eth3.101',
1752
-                'offloading_modes': [],
1753 1738
                 'type': 'ether'
1754 1739
             },
1755 1740
             'eth4.101': {
1756
-                'interface_properties': {},
1757 1741
                 'name': u'eth4.101',
1758
-                'offloading_modes': [],
1759 1742
                 'type': 'ether'
1760 1743
             }
1761 1744
         }
1762 1745
 
1763 1746
         interfaces = self.nm.get_interfaces_from_template(self.env.nodes[0])
1764
-        self.assertItemsEqual(interfaces, expected_interfaces)
1747
+        self.assertEqual(expected_interfaces, interfaces)
1765 1748
 
1766 1749
     def test_reassign_networks_based_on_template(self):
1767 1750
         expected_mapping = {
@@ -1947,3 +1930,59 @@ class TestNeutronManager80(BaseIntegrationTest):
1947 1930
         template['templates_for_node_role']['test_role'].remove('private')
1948 1931
 
1949 1932
         self.assertFalse(self.net_manager.dpdk_enabled_for_node(node))
1933
+
1934
+
1935
+class TestTemplateManager90(BaseIntegrationTest):
1936
+
1937
+    def setUp(self):
1938
+        super(TestTemplateManager90, self).setUp()
1939
+        self.cluster = self.env.create(
1940
+            release_kwargs={'version': '1111-9.0'},
1941
+            cluster_kwargs={
1942
+                'api': True,
1943
+                'net_provider': consts.CLUSTER_NET_PROVIDERS.neutron,
1944
+            }
1945
+        )
1946
+        self.cluster = objects.Cluster.get_by_uid(self.cluster['id'])
1947
+        self.nm = objects.Cluster.get_network_manager(self.cluster)
1948
+        self.net_templates = self.env.read_fixtures(['network_template_90'])
1949
+
1950
+    def test_get_network_manager(self):
1951
+        self.assertIs(self.nm, NeutronManager90)
1952
+
1953
+    def test_get_interfaces_from_template(self):
1954
+        nodes = self.env.create_nodes_w_interfaces_count(
1955
+            1,
1956
+            if_count=15,
1957
+            cluster_id=self.cluster.id,
1958
+            status=consts.NODE_STATUSES.ready,
1959
+            roles=["controller"],
1960
+            iface_name_prefix='eno{0}'
1961
+        )
1962
+        objects.Cluster.set_network_template(
1963
+            self.cluster,
1964
+            self.net_templates[3]
1965
+        )
1966
+
1967
+        interfaces = self.nm.get_interfaces_from_template(nodes[0])
1968
+
1969
+        expected_interfaces = {
1970
+            'br-fw-admin': {'type': 'ether', 'name': 'eno3'},
1971
+            'bond0': {
1972
+                'bond_properties': {
1973
+                    'lacp_rate': 'fast',
1974
+                    'mode': '802.3ad',
1975
+                    'xmit_hash_policy': 'layer3+4'
1976
+                },
1977
+                'type': 'bond',
1978
+                'name': 'bond0',
1979
+                'slaves': [{'name': 'eno1'}, {'name': 'eno2'}]},
1980
+            'br-prv': {'type': 'bond', 'name': 'bond0.342'},
1981
+            'br-storage': {'type': 'bond', 'name': 'bond0.344'},
1982
+            'br-mgmt': {'type': 'bond', 'name': 'bond0.346'},
1983
+            'br-ex': {'type': 'bond', 'name': 'bond0.345'},
1984
+            'br0': {'type': 'bond', 'name': 'port-with-tag-111'},
1985
+            'br1': {'type': 'bond', 'name': 'eno3333.222'},
1986
+            'br2': {'type': 'ether', 'name': 'eno3333'}
1987
+        }
1988
+        self.assertEqual(expected_interfaces, interfaces)

+ 71
- 0
nailgun/nailgun/extensions/network_manager/tests/test_network_template_handler.py View File

@@ -58,6 +58,42 @@ class TestHandlers(BaseIntegrationTest):
58 58
         self.assertEqual(200, resp.status_code)
59 59
         self.assertEqual(template, resp.json_body)
60 60
 
61
+    def test_network_template_add_node(self):
62
+        cluster = self.env.create(
63
+            release_kwargs={'version': '1111-9.0'},
64
+            cluster_kwargs={
65
+                'api': False,
66
+                'net_provider': consts.CLUSTER_NET_PROVIDERS.neutron
67
+            }
68
+        )
69
+
70
+        self.env.create_nodes_w_interfaces_count(
71
+            5,
72
+            if_count=15,
73
+            cluster_id=cluster.id,
74
+            status=consts.NODE_STATUSES.ready,
75
+            roles=["controller"],
76
+            iface_name_prefix='eno{0}'
77
+        )
78
+
79
+        template = self.env.read_fixtures(['network_template_90'])[3]
80
+        template.pop('pk')  # PK is not needed
81
+
82
+        resp = self.app.put(
83
+            reverse(
84
+                'TemplateNetworkConfigurationHandler',
85
+                kwargs={'cluster_id': cluster.id},
86
+            ),
87
+            jsonutils.dumps(template),
88
+            headers=self.default_headers
89
+        )
90
+        self.assertEqual(200, resp.status_code)
91
+        self.assertEquals(template, resp.json_body)
92
+
93
+        resp = self.get_template(cluster.id)
94
+        self.assertEqual(200, resp.status_code)
95
+        self.assertEqual(template, resp.json_body)
96
+
61 97
     def test_network_template_upload_on_multi_group_cluster(self):
62 98
         cluster = self.env.create_cluster(
63 99
             api=False,
@@ -174,3 +210,38 @@ class TestHandlers(BaseIntegrationTest):
174 210
             # error (403 in this case)
175 211
             db().commit()
176 212
             self.check_put_delete_template(cluster, status not in allowed)
213
+
214
+    def test_network_template_upload_90(self):
215
+        cluster = self.env.create(
216
+            release_kwargs={'version': '1111-9.0'},
217
+            cluster_kwargs={
218
+                'api': True,
219
+                'net_provider': consts.CLUSTER_NET_PROVIDERS.neutron,
220
+            }
221
+        )
222
+        self.env.create_nodes_w_interfaces_count(
223
+            1,
224
+            if_count=15,
225
+            cluster_id=cluster.id,
226
+            status=consts.NODE_STATUSES.ready,
227
+            roles=["controller"],
228
+            iface_name_prefix='eno{0}'
229
+        )
230
+
231
+        template = self.env.read_fixtures(['network_template_90'])[3]
232
+        template.pop('pk')  # PK is not needed
233
+
234
+        resp = self.app.put(
235
+            reverse(
236
+                'TemplateNetworkConfigurationHandler',
237
+                kwargs={'cluster_id': cluster.id},
238
+            ),
239
+            jsonutils.dumps(template),
240
+            headers=self.default_headers
241
+        )
242
+        self.assertEqual(200, resp.status_code)
243
+        self.assertEquals(template, resp.json_body)
244
+
245
+        resp = self.get_template(cluster.id)
246
+        self.assertEqual(200, resp.status_code)
247
+        self.assertEqual(template, resp.json_body)

+ 406
- 0
nailgun/nailgun/fixtures/network_template_90.json View File

@@ -891,4 +891,410 @@
891 891
             }
892 892
         }
893 893
     }
894
+},
895
+
896
+{
897
+    "pk": 4,
898
+    "adv_net_template": {
899
+        "default": {
900
+            "network_assignments": {
901
+                "management": {
902
+                    "ep": "br-mgmt"
903
+                },
904
+                "ceph_cluster": {
905
+                    "ep": "br-cluster"
906
+                },
907
+                "storage": {
908
+                    "ep": "br-storage"
909
+                },
910
+                "public": {
911
+                    "ep": "br-ex"
912
+                },
913
+                "private": {
914
+                    "ep": "br-prv"
915
+                },
916
+                "fuelweb_admin": {
917
+                    "ep": "br-fw-admin"
918
+                }
919
+            },
920
+            "templates_for_node_role": {
921
+                "ceph-osd": [
922
+                    "common",
923
+                    "storage",
924
+                    "ceph_cluster"
925
+                ],
926
+                "compute": [
927
+                    "common",
928
+                    "public",
929
+                    "private",
930
+                    "storage"
931
+                ],
932
+                "mongo": [
933
+                    "common"
934
+                ],
935
+                "kafka": [
936
+                    "common",
937
+                    "public"
938
+                ],
939
+                "elasticsearch_kibana": [
940
+                    "common",
941
+                    "public",
942
+                    "private",
943
+                    "storage"
944
+                ],
945
+                "base-os": [
946
+                    "common"
947
+                ],
948
+                "controller": [
949
+                    "common",
950
+                    "public",
951
+                    "private",
952
+                    "storage"
953
+                ],
954
+                "influxdb_grafana": [
955
+                    "common",
956
+                    "public",
957
+                    "private",
958
+                    "storage"
959
+                ],
960
+                "infrastructure_alerting": [
961
+                    "common",
962
+                    "public",
963
+                    "private",
964
+                    "storage"
965
+                ],
966
+                "ceph-mon": [
967
+                    "common",
968
+                    "storage",
969
+                    "ceph_cluster"
970
+                ],
971
+                "standalone-rabbitmq": [
972
+                    "common",
973
+                    "public"
974
+                ]
975
+            },
976
+            "network_scheme": {
977
+                "ceph_cluster": {
978
+                    "endpoints": [
979
+                        "br-cluster"
980
+                    ],
981
+                    "transformations": [
982
+                        {
983
+                            "action": "add-br",
984
+                            "ethtool": {
985
+                                "offload": {
986
+                                    "large-receive-offload": false,
987
+                                    "generic-receive-offload": false
988
+                                }
989
+                            },
990
+                            "name": "br-cluster",
991
+                            "mtu": 9000
992
+                        },
993
+                        {
994
+                            "action": "add-port",
995
+                            "bridge": "br-cluster",
996
+                            "ethtool": {
997
+                                "offload": {
998
+                                    "large-receive-offload": false,
999
+                                    "generic-receive-offload": false
1000
+                                }
1001
+                            },
1002
+                            "name": "bond0.343",
1003
+                            "mtu": 9000
1004
+                        }
1005
+                    ],
1006
+                    "roles": {
1007
+                        "ceph/replication": "br-cluster"
1008
+                    }
1009
+                },
1010
+                "storage": {
1011
+                    "endpoints": [
1012
+                        "br-storage"
1013
+                    ],
1014
+                    "transformations": [
1015
+                        {
1016
+                            "action": "add-br",
1017
+                            "ethtool": {
1018
+                                "offload": {
1019
+                                    "large-receive-offload": false,
1020
+                                    "generic-receive-offload": false
1021
+                                }
1022
+                            },
1023
+                            "name": "br-storage",
1024
+                            "mtu": 9000
1025
+                        },
1026
+                        {
1027
+                            "action": "add-port",
1028
+                            "bridge": "br-storage",
1029
+                            "ethtool": {
1030
+                                "offload": {
1031
+                                    "large-receive-offload": false,
1032
+                                    "generic-receive-offload": false
1033
+                                }
1034
+                            },
1035
+                            "name": "bond0.344",
1036
+                            "mtu": 9000
1037
+                        }
1038
+                    ],
1039
+                    "roles": {
1040
+                        "ceph/radosgw": "br-storage",
1041
+                        "rados_gw_plublic_vip": "br-storage",
1042
+                        "storage": "br-storage",
1043
+                        "cinder/iscsi": "br-storage",
1044
+                        "ceph/public": "br-storage"
1045
+                    }
1046
+                },
1047
+                "public": {
1048
+                    "endpoints": [
1049
+                        "br-ex"
1050
+                    ],
1051
+                    "transformations": [
1052
+                        {
1053
+                            "action": "add-br",
1054
+                            "ethtool": {
1055
+                                "offload": {
1056
+                                    "large-receive-offload": false,
1057
+                                    "generic-receive-offload": false
1058
+                                }
1059
+                            },
1060
+                            "name": "br-ex",
1061
+                            "mtu": 9000
1062
+                        },
1063
+                        {
1064
+                            "action": "add-br",
1065
+                            "ethtool": {
1066
+                                "offload": {
1067
+                                    "large-receive-offload": false,
1068
+                                    "generic-receive-offload": false
1069
+                                }
1070
+                            },
1071
+                            "mtu": 9000,
1072
+                            "name": "br-floating",
1073
+                            "provider": "ovs"
1074
+                        },
1075
+                        {
1076
+                            "action": "add-patch",
1077
+                            "bridges": [
1078
+                                "br-floating",
1079
+                                "br-ex"
1080
+                            ],
1081
+                            "mtu": 9000,
1082
+                            "ethtool": {
1083
+                                "offload": {
1084
+                                    "large-receive-offload": false,
1085
+                                    "generic-receive-offload": false
1086
+                                }
1087
+                            },
1088
+                            "provider": "ovs"
1089
+                        },
1090
+                        {
1091
+                            "action": "add-port",
1092
+                            "bridge": "br-ex",
1093
+                            "ethtool": {
1094
+                                "offload": {
1095
+                                    "large-receive-offload": false,
1096
+                                    "generic-receive-offload": false
1097
+                                }
1098
+                            },
1099
+                            "name": "bond0.345",
1100
+                            "mtu": 9000
1101
+                        }
1102
+                    ],
1103
+                    "roles": {
1104
+                        "ex": "br-ex",
1105
+                        "neutron/floating": "br-floating",
1106
+                        "public/vip": "br-ex"
1107
+                    }
1108
+                },
1109
+                "private": {
1110
+                    "endpoints": [
1111
+                        "br-prv"
1112
+                    ],
1113
+                    "transformations": [
1114
+                        {
1115
+                            "action": "add-br",
1116
+                            "ethtool": {
1117
+                                "offload": {
1118
+                                    "large-receive-offload": false,
1119
+                                    "generic-receive-offload": false
1120
+                                }
1121
+                            },
1122
+                            "name": "br-prv",
1123
+                            "mtu": 9000
1124
+                        },
1125
+                        {
1126
+                            "action": "add-port",
1127
+                            "bridge": "br-prv",
1128
+                            "ethtool": {
1129
+                                "offload": {
1130
+                                    "large-receive-offload": false,
1131
+                                    "generic-receive-offload": false
1132
+                                }
1133
+                            },
1134
+                            "name": "bond0.342",
1135
+                            "mtu": 9000
1136
+                        }
1137
+                    ],
1138
+                    "roles": {
1139
+                        "neutron/private": "None",
1140
+                        "neutron/mesh": "br-prv"
1141
+                    }
1142
+                },
1143
+                "common": {
1144
+                    "endpoints": [
1145
+                        "br-fw-admin",
1146
+                        "br-mgmt"
1147
+                    ],
1148
+                    "transformations": [
1149
+                        {
1150
+                            "action": "add-br",
1151
+                            "ethtool": {
1152
+                                "offload": {
1153
+                                    "large-receive-offload": false,
1154
+                                    "generic-receive-offload": false
1155
+                                }
1156
+                            },
1157
+                            "name": "br-fw-admin",
1158
+                            "mtu": 9000
1159
+                        },
1160
+                        {
1161
+                            "action": "add-br",
1162
+                            "ethtool": {
1163
+                                "offload": {
1164
+                                    "large-receive-offload": false,
1165
+                                    "generic-receive-offload": false
1166
+                                }
1167
+                            },
1168
+                            "name": "br-mgmt",
1169
+                            "mtu": 9000
1170
+                        },
1171
+                        {
1172
+                            "action": "add-port",
1173
+                            "bridge": "br-fw-admin",
1174
+                            "ethtool": {
1175
+                                "offload": {
1176
+                                    "large-receive-offload": false,
1177
+                                    "generic-receive-offload": false
1178
+                                }
1179
+                            },
1180
+                            "name": "<%if2%>",
1181
+                            "mtu": 9000
1182
+                        },
1183
+                        {
1184
+                            "action": "add-port",
1185
+                            "bridge": "br1",
1186
+                            "ethtool": {
1187
+                                "offload": {
1188
+                                    "large-receive-offload": false,
1189
+                                    "generic-receive-offload": false
1190
+                                }
1191
+                            },
1192
+                            "name": "<%if3%>.222",
1193
+                            "mtu": 9000
1194
+                        },
1195
+                        {
1196
+                            "action": "add-port",
1197
+                            "bridge": "br2",
1198
+                            "ethtool": {
1199
+                                "offload": {
1200
+                                    "large-receive-offload": false,
1201
+                                    "generic-receive-offload": false
1202
+                                }
1203
+                            },
1204
+                            "name": "<%if3%>",
1205
+                            "mtu": 9000
1206
+                        },
1207
+                        {
1208
+                            "ethtool": {
1209
+                                "offload": {
1210
+                                    "large-receive-offload": false,
1211
+                                    "generic-receive-offload": false
1212
+                                }
1213
+                            },
1214
+                            "bond_properties": {
1215
+                                "lacp_rate": "fast",
1216
+                                "mode": "802.3ad",
1217
+                                "xmit_hash_policy": "layer3+4"
1218
+                            },
1219
+                            "name": "bond0",
1220
+                            "interface_properties": {
1221
+                                "ethtool": {
1222
+                                    "offload": {
1223
+                                        "large-receive-offload": false,
1224
+                                        "generic-receive-offload": false
1225
+                                    }
1226
+                                },
1227
+                                "mtu": 9000
1228
+                            },
1229
+                            "action": "add-bond",
1230
+                            "interfaces": [
1231
+                                "<%if0%>",
1232
+                                "<%if1%>"
1233
+                            ],
1234
+                            "mtu": 9000
1235
+                        },
1236
+                        {
1237
+                            "action": "add-port",
1238
+                            "bridge": "br-mgmt",
1239
+                            "ethtool": {
1240
+                                "offload": {
1241
+                                    "large-receive-offload": false,
1242
+                                    "generic-receive-offload": false
1243
+                                }
1244
+                            },
1245
+                            "name": "bond0.346",
1246
+                            "mtu": 9000
1247
+                        },
1248
+                        {
1249
+                            "action": "add-port",
1250
+                            "name": "port-with-tag-111",
1251
+                            "bridge": "br0",
1252
+                            "vlan_id": 111,
1253
+                            "provider": "ovs"
1254
+                        }
1255
+                    ],
1256
+                    "roles": {
1257
+                        "keystone/api": "br-mgmt",
1258
+                        "neutron/api": "br-mgmt",
1259
+                        "mgmt/database": "br-mgmt",
1260
+                        "sahara/api": "br-mgmt",
1261
+                        "admin/pxe": "br-fw-admin",
1262
+                        "kibana": "br-mgmt",
1263
+                        "mgmt/corosync": "br-mgmt",
1264
+                        "mongo/db": "br-mgmt",
1265
+                        "ceilometer/api": "br-mgmt",
1266
+                        "glance/api": "br-mgmt",
1267
+                        "nova/migration": "br-mgmt",
1268
+                        "rados_gw_management_vip": "br-mgmt",
1269
+                        "mgmt/vip": "br-mgmt",
1270
+                        "fw-admin": "br-fw-admin",
1271
+                        "mgmt/messaging": "br-mgmt",
1272
+                        "management": "br-mgmt",
1273
+                        "swift/api": "br-mgmt",
1274
+                        "heat/api": "br-mgmt",
1275
+                        "mgmt/memcache": "br-mgmt",
1276
+                        "mgmt/api": "br-mgmt",
1277
+                        "murano/api": "br-mgmt",
1278
+                        "infrastructure_alerting_ui": "br-mgmt",
1279
+                        "grafana": "br-mgmt",
1280
+                        "influxdb_vip": "br-mgmt",
1281
+                        "nova/api": "br-mgmt",
1282
+                        "elasticsearch": "br-mgmt",
1283
+                        "horizon": "br-mgmt",
1284
+                        "infrastructure_alerting": "br-mgmt",
1285
+                        "cinder/api": "br-mgmt",
1286
+                        "swift/replication": "br-mgmt"
1287
+                    }
1288
+                }
1289
+            },
1290
+            "nic_mapping": {
1291
+                "default": {
1292
+                    "if0": "eno1",
1293
+                    "if1": "eno2",
1294
+                    "if2": "eno3",
1295
+                    "if3": "eno3333"
1296
+                }
1297
+            }
1298
+        }
1299
+    }
894 1300
 }]

+ 2
- 1
nailgun/nailgun/test/base.py View File

@@ -457,11 +457,12 @@ class EnvironmentManager(object):
457 457
         Default random MAC is generated for each interface
458 458
         """
459 459
         nodes = []
460
+        prefix_tpl = kwargs.get('iface_name_prefix', 'eth{0}')
460 461
         for i in range(nodes_count):
461 462
             meta = self.default_metadata()
462 463
             if_list = [
463 464
                 {
464
-                    "name": "eth{0}".format(i),
465
+                    "name": prefix_tpl.format(i),
465 466
                     "mac": self.generate_random_mac(),
466 467
                 }
467 468
                 for i in range(if_count)]

Loading…
Cancel
Save