diff --git a/src/device/tests/Device_Emulated.py b/src/device/tests/Device_Emulated.py index bb5dfa5f39e2e3ec3c07f9f49dc55e03c8e3c88d..c8453486f6c3b056c27d2b0ab60e0649f08e34e1 100644 --- a/src/device/tests/Device_Emulated.py +++ b/src/device/tests/Device_Emulated.py @@ -15,14 +15,18 @@ from common.proto.kpi_sample_types_pb2 import KpiSampleType from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set from common.tools.object_factory.Device import ( - json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id, + json_endpoint_descriptor) from device.tests.CommonObjects import PACKET_PORT_SAMPLE_TYPES DEVICE_EMU_UUID = 'R1-EMU' DEVICE_EMU_ID = json_device_id(DEVICE_EMU_UUID) DEVICE_EMU = json_device_emulated_packet_router_disabled(DEVICE_EMU_UUID) DEVICE_EMU_EP_UUIDS = ['EP1', 'EP2', 'EP3', 'EP4'] -DEVICE_EMU_EP_DESCS = [(ep_uuid, '10Gbps', PACKET_PORT_SAMPLE_TYPES) for ep_uuid in DEVICE_EMU_EP_UUIDS] +DEVICE_EMU_EP_DESCS = [ + json_endpoint_descriptor(ep_uuid, '10Gbps', sample_types=PACKET_PORT_SAMPLE_TYPES) + for ep_uuid in DEVICE_EMU_EP_UUIDS +] DEVICE_EMU_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_EMU_EP_DESCS) RSRC_EP = '/endpoints/endpoint[{:s}]' diff --git a/src/monitoring/tests/Objects.py b/src/monitoring/tests/Objects.py index 447ed0d601bd7079e55dc30e5cab66d25eb1fd88..e6beb92dcb02bef34703695131a4210f78308f61 100644 --- a/src/monitoring/tests/Objects.py +++ b/src/monitoring/tests/Objects.py @@ -14,7 +14,7 @@ from common.proto.kpi_sample_types_pb2 import KpiSampleType from common.tools.object_factory.Device import ( - json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled) + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_endpoint_descriptor) PACKET_PORT_SAMPLE_TYPES = [ KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, @@ -25,6 +25,8 @@ PACKET_PORT_SAMPLE_TYPES = [ DEVICE_DEV1_UUID = 'DEV1' ENDPOINT_END1_UUID = 'END1' -DEVICE_DEV1_ENDPOINT_DEFS = [(ENDPOINT_END1_UUID, 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_DEV1_ENDPOINT_DEFS = [ + json_endpoint_descriptor(ENDPOINT_END1_UUID, 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES) +] DEVICE_DEV1 = json_device_emulated_packet_router_disabled(DEVICE_DEV1_UUID) DEVICE_DEV1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_DEV1_ENDPOINT_DEFS) diff --git a/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN.py b/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN.py index 053dfd4c45e3822914745905c71f9b64300e1a2f..548a3268d40efbfcb48689bf56fc82fb34b6a90c 100644 --- a/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN.py +++ b/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN.py @@ -17,7 +17,7 @@ from common.tools.object_factory.Constraint import json_constraint_sla_capacity, from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, - json_device_emulated_packet_router_disabled, json_device_id) + json_device_emulated_packet_router_disabled, json_device_id, json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoints from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned @@ -29,7 +29,7 @@ ADD_CONNECT_RULES_TO_DEVICES = False def compose_router(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints @@ -38,7 +38,7 @@ def compose_router(device_uuid, endpoint_uuids, topology_id=None): def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints diff --git a/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN_OLS.py b/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN_OLS.py index 2c8428568c001a53cbf2c08aa13b61ad14a1bd51..546a03ac0581cdfee0ab6219a60e8f95daba4561 100644 --- a/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN_OLS.py +++ b/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN_OLS.py @@ -18,7 +18,8 @@ from common.tools.object_factory.Constraint import json_constraint_sla_capacity, from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, - json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) + json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, + json_device_id, json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoints from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned @@ -30,7 +31,7 @@ ADD_CONNECT_RULES_TO_DEVICES = False def compose_router(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints @@ -39,7 +40,7 @@ def compose_router(device_uuid, endpoint_uuids, topology_id=None): def compose_ols(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'optical', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'optical') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints @@ -48,7 +49,7 @@ def compose_ols(device_uuid, endpoint_uuids, topology_id=None): def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints diff --git a/src/service/tests/ServiceHandler_L3NM_EMU.py b/src/service/tests/ServiceHandler_L3NM_EMU.py index a6639c768594295bf982522987395e6d699b013b..50832ffff6ccc38959454fc7a891f88400123830 100644 --- a/src/service/tests/ServiceHandler_L3NM_EMU.py +++ b/src/service/tests/ServiceHandler_L3NM_EMU.py @@ -18,7 +18,7 @@ from common.tools.object_factory.Location import json_location, json_gps_positio from common.tools.object_factory.ConfigRule import json_config_rule_set from common.tools.object_factory.Constraint import json_constraint_custom, json_constraint_endpoint_location_gps from common.tools.object_factory.Device import ( - json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id, json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id from common.tools.object_factory.Link import json_link, json_link_id from common.tools.object_factory.Service import json_service_id, json_service_l3nm_planned @@ -54,8 +54,8 @@ ALBACETE_GPS = (38.998249, -1.858145) # ----- Devices -------------------------------------------------------------------------------------------------------- DEVICE_R1_UUID = 'R1' DEVICE_R1_ENDPOINT_DEFS = [ - ('EP1', 'optical', json_location(gps_position=json_gps_position(*BARCELONA_GPS))), - ('EP100', 'copper', json_location(gps_position=json_gps_position(*BARCELONA_GPS))) + json_endpoint_descriptor('EP1', 'optical', location=json_location(gps_position=json_gps_position(*BARCELONA_GPS))), + json_endpoint_descriptor('EP100', 'copper', location=json_location(gps_position=json_gps_position(*BARCELONA_GPS))) ] DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) DEVICE_R1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R1_ENDPOINT_DEFS) @@ -67,8 +67,8 @@ ENDPOINT_ID_R1_EP100 = DEVICE_R1_ENDPOINT_IDS[1] DEVICE_R2_UUID = 'R2' DEVICE_R2_ENDPOINT_DEFS = [ - ('EP1', 'optical', json_location(gps_position=json_gps_position(*MADRID_GPS))), - ('EP100', 'copper', json_location(gps_position=json_gps_position(*MADRID_GPS))) + json_endpoint_descriptor('EP1', 'optical', location=json_location(gps_position=json_gps_position(*MADRID_GPS))), + json_endpoint_descriptor('EP100', 'copper', location=json_location(gps_position=json_gps_position(*MADRID_GPS))) ] DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) DEVICE_R2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R2_ENDPOINT_DEFS) @@ -80,8 +80,8 @@ ENDPOINT_ID_R2_EP100 = DEVICE_R2_ENDPOINT_IDS[1] DEVICE_R3_UUID = 'R3' DEVICE_R3_ENDPOINT_DEFS = [ - ('EP1', 'optical', json_location(gps_position=json_gps_position(*MALAGA_GPS))), - ('EP100', 'copper', json_location(gps_position=json_gps_position(*MALAGA_GPS))) + json_endpoint_descriptor('EP1', 'optical', location=json_location(gps_position=json_gps_position(*MALAGA_GPS))), + json_endpoint_descriptor('EP100', 'copper', location=json_location(gps_position=json_gps_position(*MALAGA_GPS))) ] DEVICE_R3_ID = json_device_id(DEVICE_R3_UUID) DEVICE_R2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R2_ENDPOINT_DEFS) @@ -93,9 +93,9 @@ ENDPOINT_ID_R3_EP100 = DEVICE_R3_ENDPOINT_IDS[1] DEVICE_O1_UUID = 'O1' DEVICE_O1_ENDPOINT_DEFS = [ - ('EP1', 'optical', json_location(gps_position=json_gps_position(*PONFERRADA_GPS))), - ('EP2', 'optical', json_location(gps_position=json_gps_position(*PONFERRADA_GPS))), - ('EP3', 'optical', json_location(gps_position=json_gps_position(*PONFERRADA_GPS))) + json_endpoint_descriptor('EP1', 'optical', location=json_location(gps_position=json_gps_position(*PONFERRADA_GPS))), + json_endpoint_descriptor('EP2', 'optical', location=json_location(gps_position=json_gps_position(*PONFERRADA_GPS))), + json_endpoint_descriptor('EP3', 'optical', location=json_location(gps_position=json_gps_position(*PONFERRADA_GPS))) ] DEVICE_O1_ID = json_device_id(DEVICE_O1_UUID) DEVICE_O1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_O1_ENDPOINT_DEFS) diff --git a/src/tests/benchmark/automation/tests/Objects.py b/src/tests/benchmark/automation/tests/Objects.py index 8558d1fe7af84f1e312bc44eb458a3624ed694ae..cdf90568aa9659e0671acf10851919fafafb08f6 100644 --- a/src/tests/benchmark/automation/tests/Objects.py +++ b/src/tests/benchmark/automation/tests/Objects.py @@ -17,7 +17,8 @@ from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, - json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled, + json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id from common.tools.object_factory.Link import json_link, json_link_id from common.tools.object_factory.Topology import json_topology, json_topology_id @@ -40,7 +41,8 @@ PACKET_PORT_SAMPLE_TYPES = [ ] # ----- Devices -------------------------------------------------------------------------------------------------------- -DEVICE_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_ENDPOINT_DEFS) # ----- Object Collections --------------------------------------------------------------------------------------------- diff --git a/src/tests/ecoc22/tests/old_code/Objects_BigNet.py b/src/tests/ecoc22/tests/old_code/Objects_BigNet.py index fb96914678e646840400e5270892b82428c428ee..0e9d20a5d8f949bc382607effd97f30d26fa2059 100644 --- a/src/tests/ecoc22/tests/old_code/Objects_BigNet.py +++ b/src/tests/ecoc22/tests/old_code/Objects_BigNet.py @@ -16,7 +16,7 @@ from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, - json_device_emulated_packet_router_disabled, json_device_id) + json_device_emulated_packet_router_disabled, json_device_id, json_endpoint_descriptor) from common.tools.object_factory.Topology import json_topology, json_topology_id from .Tools import compose_bearer, compose_service_endpoint_id, json_endpoint_ids, link @@ -32,7 +32,7 @@ TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) # ----- Customer Equipment (CE) Devices -------------------------------------------------------------------------------- DEVICE_CE1_UUID = 'CE1' -DEVICE_CE1_ENDPOINT_DEFS = [('1/1', 'copper', [])] +DEVICE_CE1_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper')] DEVICE_CE1_ID = json_device_id(DEVICE_CE1_UUID) DEVICE_CE1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_CE1_ID, DEVICE_CE1_ENDPOINT_DEFS) DEVICE_CE1 = json_device_emulated_packet_router_disabled(DEVICE_CE1_UUID) @@ -40,7 +40,7 @@ ENDPOINT_ID_CE1_1_1 = DEVICE_CE1_ENDPOINT_IDS[0] DEVICE_CE1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_CE1_ENDPOINT_DEFS) DEVICE_CE2_UUID = 'CE2' -DEVICE_CE2_ENDPOINT_DEFS = [('1/1', 'copper', [])] +DEVICE_CE2_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper')] DEVICE_CE2_ID = json_device_id(DEVICE_CE2_UUID) DEVICE_CE2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_CE2_ID, DEVICE_CE2_ENDPOINT_DEFS) DEVICE_CE2 = json_device_emulated_packet_router_disabled(DEVICE_CE2_UUID) @@ -48,7 +48,7 @@ ENDPOINT_ID_CE2_1_1 = DEVICE_CE2_ENDPOINT_IDS[0] DEVICE_CE2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_CE2_ENDPOINT_DEFS) DEVICE_CE3_UUID = 'CE3' -DEVICE_CE3_ENDPOINT_DEFS = [('1/1', 'copper', [])] +DEVICE_CE3_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper')] DEVICE_CE3_ID = json_device_id(DEVICE_CE3_UUID) DEVICE_CE3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_CE3_ID, DEVICE_CE3_ENDPOINT_DEFS) DEVICE_CE3 = json_device_emulated_packet_router_disabled(DEVICE_CE3_UUID) @@ -56,7 +56,7 @@ ENDPOINT_ID_CE3_1_1 = DEVICE_CE3_ENDPOINT_IDS[0] DEVICE_CE3_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_CE3_ENDPOINT_DEFS) DEVICE_CE4_UUID = 'CE4' -DEVICE_CE4_ENDPOINT_DEFS = [('1/1', 'copper', [])] +DEVICE_CE4_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper')] DEVICE_CE4_ID = json_device_id(DEVICE_CE4_UUID) DEVICE_CE4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_CE4_ID, DEVICE_CE4_ENDPOINT_DEFS) DEVICE_CE4 = json_device_emulated_packet_router_disabled(DEVICE_CE4_UUID) @@ -65,8 +65,9 @@ DEVICE_CE4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_CE4_ENDPOIN # ----- Provider Equipment (PE) Devices -------------------------------------------------------------------------------- DEVICE_PE1_UUID = 'PE1' -DEVICE_PE1_ENDPOINT_DEFS = [('1/1', 'copper', []), - ('2/1', 'copper', []), ('2/2', 'copper', [])] +DEVICE_PE1_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper'), + json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper')] DEVICE_PE1_ID = json_device_id(DEVICE_PE1_UUID) DEVICE_PE1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_PE1_ID, DEVICE_PE1_ENDPOINT_DEFS) DEVICE_PE1 = json_device_emulated_packet_router_disabled(DEVICE_PE1_UUID) @@ -76,8 +77,9 @@ ENDPOINT_ID_PE1_2_2 = DEVICE_PE1_ENDPOINT_IDS[2] DEVICE_PE1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_PE1_ENDPOINT_DEFS) DEVICE_PE2_UUID = 'PE2' -DEVICE_PE2_ENDPOINT_DEFS = [('1/1', 'copper', []), - ('2/1', 'copper', []), ('2/2', 'copper', [])] +DEVICE_PE2_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper'), + json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper')] DEVICE_PE2_ID = json_device_id(DEVICE_PE2_UUID) DEVICE_PE2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_PE2_ID, DEVICE_PE2_ENDPOINT_DEFS) DEVICE_PE2 = json_device_emulated_packet_router_disabled(DEVICE_PE2_UUID) @@ -87,8 +89,9 @@ ENDPOINT_ID_PE2_2_2 = DEVICE_PE2_ENDPOINT_IDS[2] DEVICE_PE2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_PE2_ENDPOINT_DEFS) DEVICE_PE3_UUID = 'PE3' -DEVICE_PE3_ENDPOINT_DEFS = [('1/1', 'copper', []), - ('2/1', 'copper', []), ('2/2', 'copper', [])] +DEVICE_PE3_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper'), + json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper')] DEVICE_PE3_ID = json_device_id(DEVICE_PE3_UUID) DEVICE_PE3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_PE3_ID, DEVICE_PE3_ENDPOINT_DEFS) DEVICE_PE3 = json_device_emulated_packet_router_disabled(DEVICE_PE3_UUID) @@ -98,8 +101,9 @@ ENDPOINT_ID_PE3_2_2 = DEVICE_PE3_ENDPOINT_IDS[2] DEVICE_PE3_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_PE3_ENDPOINT_DEFS) DEVICE_PE4_UUID = 'PE4' -DEVICE_PE4_ENDPOINT_DEFS = [('1/1', 'copper', []), - ('2/1', 'copper', []), ('2/2', 'copper', [])] +DEVICE_PE4_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper'), + json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper')] DEVICE_PE4_ID = json_device_id(DEVICE_PE4_UUID) DEVICE_PE4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_PE4_ID, DEVICE_PE4_ENDPOINT_DEFS) DEVICE_PE4 = json_device_emulated_packet_router_disabled(DEVICE_PE4_UUID) @@ -110,8 +114,11 @@ DEVICE_PE4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_PE4_ENDPOIN # ----- BackBone (BB) Devices ------------------------------------------------------------------------------------------ DEVICE_BB1_UUID = 'BB1' -DEVICE_BB1_ENDPOINT_DEFS = [('1/1', 'copper', []), ('1/2', 'copper', []), - ('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB1_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper'), + json_endpoint_descriptor('1/2', 'copper'), + json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper'), + json_endpoint_descriptor('2/3', 'copper')] DEVICE_BB1_ID = json_device_id(DEVICE_BB1_UUID) DEVICE_BB1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB1_ID, DEVICE_BB1_ENDPOINT_DEFS) DEVICE_BB1 = json_device_emulated_packet_router_disabled(DEVICE_BB1_UUID) @@ -123,8 +130,11 @@ ENDPOINT_ID_BB1_2_3 = DEVICE_BB1_ENDPOINT_IDS[4] DEVICE_BB1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB1_ENDPOINT_DEFS) DEVICE_BB2_UUID = 'BB2' -DEVICE_BB2_ENDPOINT_DEFS = [('1/1', 'copper', []), ('1/2', 'copper', []), - ('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB2_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper'), + json_endpoint_descriptor('1/2', 'copper'), + json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper'), + json_endpoint_descriptor('2/3', 'copper')] DEVICE_BB2_ID = json_device_id(DEVICE_BB2_UUID) DEVICE_BB2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB2_ID, DEVICE_BB2_ENDPOINT_DEFS) DEVICE_BB2 = json_device_emulated_packet_router_disabled(DEVICE_BB2_UUID) @@ -136,7 +146,9 @@ ENDPOINT_ID_BB2_2_3 = DEVICE_BB2_ENDPOINT_IDS[4] DEVICE_BB2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB2_ENDPOINT_DEFS) DEVICE_BB3_UUID = 'BB3' -DEVICE_BB3_ENDPOINT_DEFS = [('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB3_ENDPOINT_DEFS = [json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper'), + json_endpoint_descriptor('2/3', 'copper')] DEVICE_BB3_ID = json_device_id(DEVICE_BB3_UUID) DEVICE_BB3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB3_ID, DEVICE_BB3_ENDPOINT_DEFS) DEVICE_BB3 = json_device_emulated_packet_router_disabled(DEVICE_BB3_UUID) @@ -146,8 +158,11 @@ ENDPOINT_ID_BB3_2_3 = DEVICE_BB3_ENDPOINT_IDS[2] DEVICE_BB3_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB3_ENDPOINT_DEFS) DEVICE_BB4_UUID = 'BB4' -DEVICE_BB4_ENDPOINT_DEFS = [('1/1', 'copper', []), ('1/2', 'copper', []), - ('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB4_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper'), + json_endpoint_descriptor('1/2', 'copper'), + json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper'), + json_endpoint_descriptor('2/3', 'copper')] DEVICE_BB4_ID = json_device_id(DEVICE_BB4_UUID) DEVICE_BB4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB4_ID, DEVICE_BB4_ENDPOINT_DEFS) DEVICE_BB4 = json_device_emulated_packet_router_disabled(DEVICE_BB4_UUID) @@ -159,8 +174,11 @@ ENDPOINT_ID_BB4_2_3 = DEVICE_BB4_ENDPOINT_IDS[4] DEVICE_BB4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB4_ENDPOINT_DEFS) DEVICE_BB5_UUID = 'BB5' -DEVICE_BB5_ENDPOINT_DEFS = [('1/1', 'copper', []), ('1/2', 'copper', []), - ('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB5_ENDPOINT_DEFS = [json_endpoint_descriptor('1/1', 'copper'), + json_endpoint_descriptor('1/2', 'copper'), + json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper'), + json_endpoint_descriptor('2/3', 'copper')] DEVICE_BB5_ID = json_device_id(DEVICE_BB5_UUID) DEVICE_BB5_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB5_ID, DEVICE_BB5_ENDPOINT_DEFS) DEVICE_BB5 = json_device_emulated_packet_router_disabled(DEVICE_BB5_UUID) @@ -172,7 +190,9 @@ ENDPOINT_ID_BB5_2_3 = DEVICE_BB5_ENDPOINT_IDS[4] DEVICE_BB5_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB5_ENDPOINT_DEFS) DEVICE_BB6_UUID = 'BB6' -DEVICE_BB6_ENDPOINT_DEFS = [('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB6_ENDPOINT_DEFS = [json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper'), + json_endpoint_descriptor('2/3', 'copper')] DEVICE_BB6_ID = json_device_id(DEVICE_BB6_UUID) DEVICE_BB6_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB6_ID, DEVICE_BB6_ENDPOINT_DEFS) DEVICE_BB6 = json_device_emulated_packet_router_disabled(DEVICE_BB6_UUID) @@ -182,8 +202,12 @@ ENDPOINT_ID_BB6_2_3 = DEVICE_BB6_ENDPOINT_IDS[2] DEVICE_BB6_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB6_ENDPOINT_DEFS) DEVICE_BB7_UUID = 'BB7' -DEVICE_BB7_ENDPOINT_DEFS = [('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', []), ('2/4', 'copper', []), - ('2/5', 'copper', []), ('2/6', 'copper', [])] +DEVICE_BB7_ENDPOINT_DEFS = [json_endpoint_descriptor('2/1', 'copper'), + json_endpoint_descriptor('2/2', 'copper'), + json_endpoint_descriptor('2/3', 'copper'), + json_endpoint_descriptor('2/4', 'copper'), + json_endpoint_descriptor('2/5', 'copper'), + json_endpoint_descriptor('2/6', 'copper')] DEVICE_BB7_ID = json_device_id(DEVICE_BB7_UUID) DEVICE_BB7_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB7_ID, DEVICE_BB7_ENDPOINT_DEFS) DEVICE_BB7 = json_device_emulated_packet_router_disabled(DEVICE_BB7_UUID) diff --git a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_OLS.py b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_OLS.py index 522c25d6b272247093edb72cdbfa0ba515ed8cf8..f60e2e54307a1627d16811d858e933c5ee7b9143 100644 --- a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_OLS.py +++ b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_OLS.py @@ -17,7 +17,8 @@ from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, - json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) + json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, + json_device_id, json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoints from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned @@ -30,7 +31,7 @@ ADD_CONNECT_RULES_TO_DEVICES = ADD_CONNECT_RULES_TO_DEVICES.upper() in {'T', 'TR def compose_router(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints @@ -39,7 +40,7 @@ def compose_router(device_uuid, endpoint_uuids, topology_id=None): def compose_ols(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'optical', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'optical') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints @@ -48,7 +49,7 @@ def compose_ols(device_uuid, endpoint_uuids, topology_id=None): def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints diff --git a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN.py b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN.py index c02f5d0c880f4bf570b7d14278c4bcbb1cffe72d..06bdf85c0a34dbda0483d69219e072ee1b4d3a3d 100644 --- a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN.py +++ b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN.py @@ -17,7 +17,7 @@ from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, - json_device_emulated_packet_router_disabled, json_device_id) + json_device_emulated_packet_router_disabled, json_device_id, json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoints from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned @@ -30,7 +30,7 @@ ADD_CONNECT_RULES_TO_DEVICES = ADD_CONNECT_RULES_TO_DEVICES.upper() in {'T', 'TR def compose_router(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints @@ -39,7 +39,7 @@ def compose_router(device_uuid, endpoint_uuids, topology_id=None): def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints diff --git a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN_OLS.py b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN_OLS.py index 6c34ec01d4c9b466aa81d306078a0ab242a334ad..6650de8c9625c3621e6083392d4552e8b149888c 100644 --- a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN_OLS.py +++ b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN_OLS.py @@ -17,7 +17,8 @@ from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, - json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) + json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, + json_device_id, json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoints from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned @@ -30,7 +31,7 @@ ADD_CONNECT_RULES_TO_DEVICES = ADD_CONNECT_RULES_TO_DEVICES.upper() in {'T', 'TR def compose_router(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints @@ -39,7 +40,7 @@ def compose_router(device_uuid, endpoint_uuids, topology_id=None): def compose_ols(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'optical', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'optical') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints @@ -48,7 +49,7 @@ def compose_ols(device_uuid, endpoint_uuids, topology_id=None): def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): device_id = json_device_id(device_uuid) - r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + r_endpoints = [json_endpoint_descriptor(endpoint_uuid, 'copper') for endpoint_uuid in endpoint_uuids] config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints diff --git a/src/tests/oeccpsc22/tests/Objects_Domain_1.py b/src/tests/oeccpsc22/tests/Objects_Domain_1.py index 2f35aa76eea8f7adfc89011cbc4822daecbd1d14..402737f7e2844c322d6a1217c17bfd73b00d83ff 100644 --- a/src/tests/oeccpsc22/tests/Objects_Domain_1.py +++ b/src/tests/oeccpsc22/tests/Objects_Domain_1.py @@ -15,7 +15,8 @@ from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( - json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, + json_device_id, json_endpoint_descriptor) from common.tools.object_factory.Link import json_link, json_link_id from common.tools.object_factory.Topology import json_topology, json_topology_id from .Tools import get_link_uuid, json_endpoint_ids @@ -32,12 +33,24 @@ D1_TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=D1_CONTEXT_ID) # Assume all devices have the same architecture of endpoints D1_DEVICE_ENDPOINT_DEFS = [ # Trunk ports - ('1/1', '25Gbps', []), ('1/2', '25Gbps', []), ('1/3', '25Gbps', []), ('1/4', '25Gbps', []), + json_endpoint_descriptor('1/1', '25Gbps'), + json_endpoint_descriptor('1/2', '25Gbps'), + json_endpoint_descriptor('1/3', '25Gbps'), + json_endpoint_descriptor('1/4', '25Gbps'), + # Inter-domain ports - ('2/1', '100Gbps', []), ('2/2', '100Gbps', []), + json_endpoint_descriptor('2/1', '100Gbps'), + json_endpoint_descriptor('2/2', '100Gbps'), + # Access ports - ('3/1', '10Gbps', []), ('3/2', '10Gbps', []), ('3/3', '10Gbps', []), ('3/4', '10Gbps', []), - ('3/5', '10Gbps', []), ('3/6', '10Gbps', []), ('3/7', '10Gbps', []), ('3/8', '10Gbps', []), + json_endpoint_descriptor('3/1', '10Gbps'), + json_endpoint_descriptor('3/2', '10Gbps'), + json_endpoint_descriptor('3/3', '10Gbps'), + json_endpoint_descriptor('3/4', '10Gbps'), + json_endpoint_descriptor('3/5', '10Gbps'), + json_endpoint_descriptor('3/6', '10Gbps'), + json_endpoint_descriptor('3/7', '10Gbps'), + json_endpoint_descriptor('3/8', '10Gbps'), ] D1_DEVICE_D1R1_UUID = 'R1@D1' diff --git a/src/tests/oeccpsc22/tests/Objects_Domain_2.py b/src/tests/oeccpsc22/tests/Objects_Domain_2.py index 0e5065c3b6ec3e1d44a16f0ee8231aca28e2c2d1..1cb4676355231dfaca24ccdb15f774bc7456842b 100644 --- a/src/tests/oeccpsc22/tests/Objects_Domain_2.py +++ b/src/tests/oeccpsc22/tests/Objects_Domain_2.py @@ -15,7 +15,8 @@ from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( - json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, + json_device_id, json_endpoint_descriptor) from common.tools.object_factory.Link import json_link, json_link_id from common.tools.object_factory.Topology import json_topology, json_topology_id from .Tools import get_link_uuid, json_endpoint_ids @@ -32,12 +33,24 @@ D2_TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=D2_CONTEXT_ID) # Assume all devices have the same architecture of endpoints D2_DEVICE_ENDPOINT_DEFS = [ # Trunk ports - ('1/1', '25Gbps', []), ('1/2', '25Gbps', []), ('1/3', '25Gbps', []), ('1/4', '25Gbps', []), + json_endpoint_descriptor('1/1', '25Gbps'), + json_endpoint_descriptor('1/2', '25Gbps'), + json_endpoint_descriptor('1/3', '25Gbps'), + json_endpoint_descriptor('1/4', '25Gbps'), + # Inter-domain ports - ('2/1', '100Gbps', []), ('2/2', '100Gbps', []), + json_endpoint_descriptor('2/1', '100Gbps'), + json_endpoint_descriptor('2/2', '100Gbps'), + # Access ports - ('3/1', '10Gbps', []), ('3/2', '10Gbps', []), ('3/3', '10Gbps', []), ('3/4', '10Gbps', []), - ('3/5', '10Gbps', []), ('3/6', '10Gbps', []), ('3/7', '10Gbps', []), ('3/8', '10Gbps', []), + json_endpoint_descriptor('3/1', '10Gbps'), + json_endpoint_descriptor('3/2', '10Gbps'), + json_endpoint_descriptor('3/3', '10Gbps'), + json_endpoint_descriptor('3/4', '10Gbps'), + json_endpoint_descriptor('3/5', '10Gbps'), + json_endpoint_descriptor('3/6', '10Gbps'), + json_endpoint_descriptor('3/7', '10Gbps'), + json_endpoint_descriptor('3/8', '10Gbps'), ] D2_DEVICE_D2R1_UUID = 'R1@D2' diff --git a/src/tests/oeccpsc22/tests/Tools.py b/src/tests/oeccpsc22/tests/Tools.py index 30333b6f47b31bda76626545b78aaa3c96bff7c0..483090f8b8c0e1524bbdf98a5f3208b485c9ddaa 100644 --- a/src/tests/oeccpsc22/tests/Tools.py +++ b/src/tests/oeccpsc22/tests/Tools.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Dict, List, Tuple +from typing import Dict, List from common.tools.object_factory.EndPoint import json_endpoint_id -def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Dict]): return { device_id['device_uuid']['uuid']: { - ep_uuid: json_endpoint_id(device_id, ep_uuid, topology_id=None) - for ep_uuid, _, _ in endpoint_descriptors + ep_data['uuid']: json_endpoint_id(device_id, ep_data['uuid'], topology_id=None) + for ep_data in endpoint_descriptors } } diff --git a/src/tests/ofc22/tests/ObjectsXr.py b/src/tests/ofc22/tests/ObjectsXr.py index 9871a50b8181b53cfbb767be76a1a0978eaf1d27..b0d17313180bdab9213b1b629359ae88f06b869f 100644 --- a/src/tests/ofc22/tests/ObjectsXr.py +++ b/src/tests/ofc22/tests/ObjectsXr.py @@ -17,7 +17,8 @@ from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, - json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled, + json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id from common.tools.object_factory.Link import json_link, json_link_id from common.tools.object_factory.Topology import json_topology, json_topology_id @@ -88,7 +89,8 @@ if not USE_REAL_DEVICES: DEVICE_R1_UUID = 'R1-EMU' DEVICE_R1_TIMEOUT = 120 -DEVICE_R1_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R1_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) #DEVICE_R1_ENDPOINTS = json_endpoints(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) DEVICE_R1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) @@ -103,7 +105,8 @@ DEVICE_R1_CONNECT_RULES = json_device_connect_rules(DEVICE_R1_ADDRESS, DEVICE_R1 DEVICE_R2_UUID = 'R2-EMU' -DEVICE_R2_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R2_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) #DEVICE_R2_ENDPOINTS = json_endpoints(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) DEVICE_R2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) @@ -115,7 +118,8 @@ DEVICE_R2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R2_ENDPOINT_ DEVICE_R3_UUID = 'R3-EMU' DEVICE_R3_TIMEOUT = 120 -DEVICE_R3_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R3_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_R3_ID = json_device_id(DEVICE_R3_UUID) #DEVICE_R3_ENDPOINTS = json_endpoints(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) DEVICE_R3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) @@ -130,7 +134,8 @@ DEVICE_R3_CONNECT_RULES = json_device_connect_rules(DEVICE_R3_ADDRESS, DEVICE_R3 DEVICE_R4_UUID = 'R4-EMU' -DEVICE_R4_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R4_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_R4_ID = json_device_id(DEVICE_R4_UUID) #DEVICE_R4_ENDPOINTS = json_endpoints(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) DEVICE_R4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) @@ -143,12 +148,12 @@ DEVICE_R4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R4_ENDPOINT_ DEVICE_X1_UUID = 'X1-XR-CONSTELLATION' DEVICE_X1_TIMEOUT = 120 DEVICE_X1_ENDPOINT_DEFS = [ - ('XR HUB 1|XR-T1', 'optical', []), - ('XR HUB 1|XR-T2', 'optical', []), - ('XR HUB 1|XR-T3', 'optical', []), - ('XR HUB 1|XR-T4', 'optical', []), - ('XR LEAF 1|XR-T1', 'optical', []), - ('XR LEAF 2|XR-T1', 'optical', []), + json_endpoint_descriptor('XR HUB 1|XR-T1', 'optical'), + json_endpoint_descriptor('XR HUB 1|XR-T2', 'optical'), + json_endpoint_descriptor('XR HUB 1|XR-T3', 'optical'), + json_endpoint_descriptor('XR HUB 1|XR-T4', 'optical'), + json_endpoint_descriptor('XR LEAF 1|XR-T1', 'optical'), + json_endpoint_descriptor('XR LEAF 2|XR-T1', 'optical'), ] DEVICE_X1_ID = json_device_id(DEVICE_X1_UUID) DEVICE_X1 = json_device_tapi_disabled(DEVICE_X1_UUID) diff --git a/src/tests/p4/tests/Objects.py b/src/tests/p4/tests/Objects.py index 9a9b230170fb492e94bac7cb19172f623daa3394..7f5a981bcd1ac8cdc324c057c69baaf0d7d0e8dd 100644 --- a/src/tests/p4/tests/Objects.py +++ b/src/tests/p4/tests/Objects.py @@ -19,7 +19,8 @@ from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_connect_rules, json_device_id, json_device_p4_disabled, - json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled, + json_endpoint_descriptor) from common.tools.object_factory.Service import ( get_service_uuid, json_service_l3nm_planned,json_service_p4_planned) from common.tools.object_factory.ConfigRule import ( @@ -68,7 +69,10 @@ DEVICE_SW1_SW_VER = 'Stratum' DEVICE_SW1_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW1_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW1_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', []), ('3', 'port', []), ('4', 'port', [])] +DEVICE_SW1_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port'), + json_endpoint_descriptor('3', 'port'), + json_endpoint_descriptor('4', 'port')] DEVICE_SW1_ENDPOINTS = json_endpoints(DEVICE_SW1_ID, DEVICE_SW1_ENDPOINT_DEFS) DEVICE_SW1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW1_ID, DEVICE_SW1_ENDPOINT_DEFS) ENDPOINT_ID_SW1_1 = DEVICE_SW1_ENDPOINTS[0]['endpoint_id'] @@ -107,7 +111,8 @@ DEVICE_SW2_SW_VER = 'Stratum' DEVICE_SW2_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW2_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW2_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW2_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW2_ENDPOINTS = json_endpoints(DEVICE_SW2_ID, DEVICE_SW2_ENDPOINT_DEFS) DEVICE_SW2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW2_ID, DEVICE_SW2_ENDPOINT_DEFS) ENDPOINT_ID_SW2_1 = DEVICE_SW2_ENDPOINTS[0]['endpoint_id'] @@ -144,7 +149,8 @@ DEVICE_SW3_SW_VER = 'Stratum' DEVICE_SW3_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW3_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW3_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW3_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW3_ENDPOINTS = json_endpoints(DEVICE_SW3_ID, DEVICE_SW3_ENDPOINT_DEFS) DEVICE_SW3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW3_ID, DEVICE_SW3_ENDPOINT_DEFS) ENDPOINT_ID_SW3_1 = DEVICE_SW3_ENDPOINTS[0]['endpoint_id'] @@ -181,7 +187,8 @@ DEVICE_SW4_SW_VER = 'Stratum' DEVICE_SW4_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW4_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW4_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW4_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW4_ENDPOINTS = json_endpoints(DEVICE_SW4_ID, DEVICE_SW4_ENDPOINT_DEFS) DEVICE_SW4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW4_ID, DEVICE_SW4_ENDPOINT_DEFS) ENDPOINT_ID_SW4_1 = DEVICE_SW4_ENDPOINTS[0]['endpoint_id'] @@ -218,7 +225,8 @@ DEVICE_SW5_SW_VER = 'Stratum' DEVICE_SW5_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW5_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW5_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW5_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW5_ENDPOINTS = json_endpoints(DEVICE_SW5_ID, DEVICE_SW5_ENDPOINT_DEFS) DEVICE_SW5_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW5_ID, DEVICE_SW5_ENDPOINT_DEFS) ENDPOINT_ID_SW5_1 = DEVICE_SW5_ENDPOINTS[0]['endpoint_id'] @@ -255,7 +263,8 @@ DEVICE_SW6_SW_VER = 'Stratum' DEVICE_SW6_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW6_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW6_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW6_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW6_ENDPOINTS = json_endpoints(DEVICE_SW6_ID, DEVICE_SW6_ENDPOINT_DEFS) DEVICE_SW6_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW6_ID, DEVICE_SW6_ENDPOINT_DEFS) ENDPOINT_ID_SW6_1 = DEVICE_SW6_ENDPOINTS[0]['endpoint_id'] @@ -292,7 +301,8 @@ DEVICE_SW7_SW_VER = 'Stratum' DEVICE_SW7_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW7_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW7_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW7_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW7_ENDPOINTS = json_endpoints(DEVICE_SW7_ID, DEVICE_SW7_ENDPOINT_DEFS) DEVICE_SW7_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW7_ID, DEVICE_SW7_ENDPOINT_DEFS) ENDPOINT_ID_SW7_1 = DEVICE_SW7_ENDPOINTS[0]['endpoint_id'] @@ -329,7 +339,10 @@ DEVICE_SW8_SW_VER = 'Stratum' DEVICE_SW8_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW8_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW8_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', []), ('3', 'port', []), ('4', 'port', [])] +DEVICE_SW8_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port'), + json_endpoint_descriptor('3', 'port'), + json_endpoint_descriptor('4', 'port')] DEVICE_SW8_ENDPOINTS = json_endpoints(DEVICE_SW8_ID, DEVICE_SW8_ENDPOINT_DEFS) DEVICE_SW8_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW8_ID, DEVICE_SW8_ENDPOINT_DEFS) ENDPOINT_ID_SW8_1 = DEVICE_SW8_ENDPOINTS[0]['endpoint_id'] diff --git a/src/tests/p4/tests/topologies/6switchObjects.py b/src/tests/p4/tests/topologies/6switchObjects.py index 29f01cd61aca58712cb0bc27b7f80c04b2f37d52..5411ef465ff465c2508bf35c5afbaba078e946cc 100644 --- a/src/tests/p4/tests/topologies/6switchObjects.py +++ b/src/tests/p4/tests/topologies/6switchObjects.py @@ -19,7 +19,7 @@ from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_connect_rules, json_device_id, json_device_p4_disabled, - json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled, json_endpoint_descriptor) from common.tools.object_factory.Service import ( get_service_uuid, json_service_l3nm_planned,json_service_p4_planned) from common.tools.object_factory.ConfigRule import ( @@ -68,7 +68,9 @@ DEVICE_SW1_SW_VER = 'Stratum' DEVICE_SW1_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW1_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW1_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', []), ('3', 'port', [])] +DEVICE_SW1_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port'), + json_endpoint_descriptor('3', 'port')] DEVICE_SW1_ENDPOINTS = json_endpoints(DEVICE_SW1_ID, DEVICE_SW1_ENDPOINT_DEFS) DEVICE_SW1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW1_ID, DEVICE_SW1_ENDPOINT_DEFS) ENDPOINT_ID_SW1_1 = DEVICE_SW1_ENDPOINTS[0]['endpoint_id'] @@ -106,7 +108,8 @@ DEVICE_SW2_SW_VER = 'Stratum' DEVICE_SW2_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW2_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW2_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW2_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW2_ENDPOINTS = json_endpoints(DEVICE_SW2_ID, DEVICE_SW2_ENDPOINT_DEFS) DEVICE_SW2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW2_ID, DEVICE_SW2_ENDPOINT_DEFS) ENDPOINT_ID_SW2_1 = DEVICE_SW2_ENDPOINTS[0]['endpoint_id'] @@ -143,7 +146,8 @@ DEVICE_SW3_SW_VER = 'Stratum' DEVICE_SW3_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW3_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW3_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW3_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW3_ENDPOINTS = json_endpoints(DEVICE_SW3_ID, DEVICE_SW3_ENDPOINT_DEFS) DEVICE_SW3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW3_ID, DEVICE_SW3_ENDPOINT_DEFS) ENDPOINT_ID_SW3_1 = DEVICE_SW3_ENDPOINTS[0]['endpoint_id'] @@ -180,7 +184,8 @@ DEVICE_SW4_SW_VER = 'Stratum' DEVICE_SW4_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW4_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW4_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW4_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW4_ENDPOINTS = json_endpoints(DEVICE_SW4_ID, DEVICE_SW4_ENDPOINT_DEFS) DEVICE_SW4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW4_ID, DEVICE_SW4_ENDPOINT_DEFS) ENDPOINT_ID_SW4_1 = DEVICE_SW4_ENDPOINTS[0]['endpoint_id'] @@ -217,7 +222,8 @@ DEVICE_SW5_SW_VER = 'Stratum' DEVICE_SW5_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW5_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW5_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW5_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port')] DEVICE_SW5_ENDPOINTS = json_endpoints(DEVICE_SW5_ID, DEVICE_SW5_ENDPOINT_DEFS) DEVICE_SW5_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW5_ID, DEVICE_SW5_ENDPOINT_DEFS) ENDPOINT_ID_SW5_1 = DEVICE_SW5_ENDPOINTS[0]['endpoint_id'] @@ -254,7 +260,9 @@ DEVICE_SW6_SW_VER = 'Stratum' DEVICE_SW6_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW6_INFO_PATH = '/root/p4/p4info.txt' -DEVICE_SW6_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', []), ('3', 'port', [])] +DEVICE_SW6_ENDPOINT_DEFS = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port'), + json_endpoint_descriptor('3', 'port')] DEVICE_SW6_ENDPOINTS = json_endpoints(DEVICE_SW6_ID, DEVICE_SW6_ENDPOINT_DEFS) DEVICE_SW6_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW6_ID, DEVICE_SW6_ENDPOINT_DEFS) ENDPOINT_ID_SW6_1 = DEVICE_SW6_ENDPOINTS[0]['endpoint_id'] diff --git a/src/tests/scenario2/old_tests/tests/Objects.py b/src/tests/scenario2/old_tests/tests/Objects.py index 7eea0f4c3262793e9ba00ae80c66cc5b1ed0b8dc..39faaa4f822458cb2c96ecd4c2d1ec6523efe10a 100644 --- a/src/tests/scenario2/old_tests/tests/Objects.py +++ b/src/tests/scenario2/old_tests/tests/Objects.py @@ -17,7 +17,7 @@ from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, - json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled, json_endpoint_descriptor) from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id from common.tools.object_factory.Link import json_link, json_link_id from common.tools.object_factory.Topology import json_topology, json_topology_id @@ -88,7 +88,8 @@ if not USE_REAL_DEVICES: DEVICE_R1_UUID = 'R1-EMU' DEVICE_R1_TIMEOUT = 120 -DEVICE_R1_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R1_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) #DEVICE_R1_ENDPOINTS = json_endpoints(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) DEVICE_R1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) @@ -103,7 +104,8 @@ DEVICE_R1_CONNECT_RULES = json_device_connect_rules(DEVICE_R1_ADDRESS, DEVICE_R1 DEVICE_R2_UUID = 'R2-EMU' -DEVICE_R2_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R2_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) #DEVICE_R2_ENDPOINTS = json_endpoints(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) DEVICE_R2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) @@ -115,7 +117,8 @@ DEVICE_R2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R2_ENDPOINT_ DEVICE_R3_UUID = 'R3-EMU' DEVICE_R3_TIMEOUT = 120 -DEVICE_R3_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R3_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_R3_ID = json_device_id(DEVICE_R3_UUID) #DEVICE_R3_ENDPOINTS = json_endpoints(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) DEVICE_R3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) @@ -130,7 +133,8 @@ DEVICE_R3_CONNECT_RULES = json_device_connect_rules(DEVICE_R3_ADDRESS, DEVICE_R3 DEVICE_R4_UUID = 'R4-EMU' -DEVICE_R4_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R4_ENDPOINT_DEFS = [json_endpoint_descriptor('13/0/0', 'optical'), + json_endpoint_descriptor('13/1/2', 'copper', sample_types=PACKET_PORT_SAMPLE_TYPES)] DEVICE_R4_ID = json_device_id(DEVICE_R4_UUID) #DEVICE_R4_ENDPOINTS = json_endpoints(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) DEVICE_R4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) @@ -143,10 +147,10 @@ DEVICE_R4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R4_ENDPOINT_ DEVICE_O1_UUID = 'O1-OLS' DEVICE_O1_TIMEOUT = 120 DEVICE_O1_ENDPOINT_DEFS = [ - ('aade6001-f00b-5e2f-a357-6a0a9d3de870', 'optical', []), # node_1_port_13 - ('eb287d83-f05e-53ec-ab5a-adf6bd2b5418', 'optical', []), # node_2_port_13 - ('0ef74f99-1acc-57bd-ab9d-4b958b06c513', 'optical', []), # node_3_port_13 - ('50296d99-58cc-5ce7-82f5-fc8ee4eec2ec', 'optical', []), # node_4_port_13 + json_endpoint_descriptor('aade6001-f00b-5e2f-a357-6a0a9d3de870', 'optical', endpoint_name='node_1_port_13'), + json_endpoint_descriptor('eb287d83-f05e-53ec-ab5a-adf6bd2b5418', 'optical', endpoint_name='node_2_port_13'), + json_endpoint_descriptor('0ef74f99-1acc-57bd-ab9d-4b958b06c513', 'optical', endpoint_name='node_3_port_13'), + json_endpoint_descriptor('50296d99-58cc-5ce7-82f5-fc8ee4eec2ec', 'optical', endpoint_name='node_4_port_13'), ] DEVICE_O1_ID = json_device_id(DEVICE_O1_UUID) DEVICE_O1 = json_device_tapi_disabled(DEVICE_O1_UUID)