def test_convert_to_nsx_transport_zones_no_multiprovider(self): test_net = {'id': 'whatever'} results = nsx_utils.convert_to_nsx_transport_zones( 'meh_zone_uuid', test_net, default_transport_type='meh_transport_type') self.assertEqual(1, len(results)) result = results[0] self.assertEqual('meh_zone_uuid', result['zone_uuid']) self.assertEqual('meh_transport_type', result['transport_type'])
def test_convert_to_nsx_transport_zones_no_multiprovider(self): test_net = {'id': 'whatever'} results = nsx_utils.convert_to_nsx_transport_zones( 'meh_zone_uuid', test_net, default_transport_type='meh_transport_type') self.assertEqual(1, len(results)) result = results[0] self.assertEqual('meh_zone_uuid', result['zone_uuid']) self.assertEqual('meh_transport_type', result['transport_type'])
def test_convert_to_nsx_transport_zones_with_bindings(self): binding_1 = nsx_models.TzNetworkBinding('whatever', utils.NetworkTypes.VLAN, 'whatever_tz_1', 66) binding_2 = nsx_models.TzNetworkBinding('whatever', utils.NetworkTypes.STT, 'whatever_tz_2', None) results = nsx_utils.convert_to_nsx_transport_zones( 'meh_zone_uuid', None, bindings=[binding_1, binding_2]) self._verify_nsx_transport_zones(results)
def test_convert_to_nsx_transport_zones_with_multiprovider(self): segments = [ {pnet.NETWORK_TYPE: utils.NetworkTypes.VLAN, pnet.PHYSICAL_NETWORK: 'whatever_tz_1', pnet.SEGMENTATION_ID: 66}, {pnet.NETWORK_TYPE: utils.NetworkTypes.STT, pnet.PHYSICAL_NETWORK: 'whatever_tz_2'}, ] results = nsx_utils.convert_to_nsx_transport_zones( 'meh_zone_uuid', {'id': 'whatever_net', mpnet.SEGMENTS: segments}) self._verify_nsx_transport_zones(results)
def test_convert_to_nsx_transport_zones_with_multiprovider(self): segments = [ {pnet.NETWORK_TYPE: utils.NetworkTypes.VLAN, pnet.PHYSICAL_NETWORK: 'whatever_tz_1', pnet.SEGMENTATION_ID: 66}, {pnet.NETWORK_TYPE: utils.NetworkTypes.STT, pnet.PHYSICAL_NETWORK: 'whatever_tz_2'}, ] results = nsx_utils.convert_to_nsx_transport_zones( 'meh_zone_uuid', {'id': 'whatever_net', mpnet.SEGMENTS: segments}) self._verify_nsx_transport_zones(results)
def test_convert_to_nsx_transport_zones_with_bindings(self): binding_1 = nsx_models.TzNetworkBinding( 'whatever', utils.NetworkTypes.VLAN, 'whatever_tz_1', 66) binding_2 = nsx_models.TzNetworkBinding( 'whatever', utils.NetworkTypes.STT, 'whatever_tz_2', None) results = nsx_utils.convert_to_nsx_transport_zones( 'meh_zone_uuid', None, bindings=[binding_1, binding_2]) self._verify_nsx_transport_zones(results)