Skip to content
Snippets Groups Projects
Commit a64a5a01 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests:

- Updated according to new definition of endpoint descriptors
parent 275094b4
Branches
Tags
2 merge requests!142Release TeraFlowSDN 2.1,!137Pre-release CI/CD fixes - Service - PathComp
Showing
with 200 additions and 109 deletions
......@@ -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}]'
......
......@@ -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)
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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 ---------------------------------------------------------------------------------------------
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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'
......
......@@ -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'
......
......@@ -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
}
}
......
......@@ -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)
......
......@@ -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']
......
......@@ -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']
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment