Commit 9fedfbf4 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

OFC'22 test:

- updated WIM service settings
parent 17129bae
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -12,17 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Dict, Optional

def compose_service_endpoint_id(endpoint_id):
    device_uuid = endpoint_id['device_id']['device_uuid']['uuid']
    endpoint_uuid = endpoint_id['endpoint_uuid']['uuid']
    return ':'.join([device_uuid, endpoint_uuid])

def wim_mapping(site_id, ce_endpoint_id, pe_device_id, priority=None, redundant=[]):
def wim_mapping(site_id, ce_endpoint_id, pe_device_id : Optional[Dict] = None, priority=None, redundant=[]):
    ce_endpoint_id = ce_endpoint_id['endpoint_id']
    ce_device_uuid = ce_endpoint_id['device_id']['device_uuid']['uuid']
    ce_endpoint_uuid = ce_endpoint_id['endpoint_uuid']['uuid']
    pe_device_uuid = pe_device_id['device_uuid']['uuid']
    service_endpoint_id = '{:s}:{:s}:{:s}'.format(site_id, ce_device_uuid, ce_endpoint_uuid)
    if pe_device_id is None:
        bearer = '{:s}:{:s}'.format(ce_device_uuid, ce_endpoint_uuid)
    else:
        pe_device_uuid = pe_device_id['device_uuid']['uuid']
        bearer = '{:s}:{:s}'.format(ce_device_uuid, pe_device_uuid)
    _mapping = {
        'service_endpoint_id': service_endpoint_id,
+6 −4
Original line number Diff line number Diff line
@@ -19,15 +19,17 @@ from compute.tests.mock_osm.Tools import compose_service_endpoint_id, connection
# ----- WIM Service Settings -------------------------------------------------------------------------------------------

DEV_R1_ID          = json_device_id('R1-EMU')
DEV_R1_ENDPOINT_ID = compose_service_endpoint_id(json_endpoint_id(DEV_R1_ID, '13/1/2'))
DEV_R1_ENDPOINT_ID = json_endpoint_id(DEV_R1_ID, '13/1/2')
WIM_SEP_R1_ID      = compose_service_endpoint_id(DEV_R1_ENDPOINT_ID)
WIM_SEP_R1_SITE_ID = '1'

DEV_R3_ID          = json_device_id('R3-EMU')
DEV_R3_ENDPOINT_ID = compose_service_endpoint_id(json_endpoint_id(DEV_R3_ID, '13/1/2'))
DEV_R3_ENDPOINT_ID = json_endpoint_id(DEV_R3_ID, '13/1/2')
WIM_SEP_R3_ID      = compose_service_endpoint_id(DEV_R3_ENDPOINT_ID)
WIM_SEP_R3_SITE_ID = '2'

WIM_SEP_DC1, WIM_MAP_DC1 = wim_mapping(WIM_SEP_R1_SITE_ID, DEV_DC1GW_EPS[0], DEV_CS1GW1_ID)
WIM_SEP_DC2, WIM_MAP_DC2 = wim_mapping(WIM_SEP_R3_SITE_ID, DEV_DC2GW_EPS[0], DEV_CS2GW1_ID)
WIM_SEP_DC1, WIM_MAP_DC1 = wim_mapping(WIM_SEP_R1_SITE_ID, DEV_R1_ENDPOINT_ID)
WIM_SEP_DC2, WIM_MAP_DC2 = wim_mapping(WIM_SEP_R3_SITE_ID, DEV_R3_ENDPOINT_ID)
WIM_MAPPING  = [WIM_MAP_DC1, WIM_MAP_DC2]

WIM_SRV_VLAN_ID = 300