Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tfs/controller
1 result
Show changes
......@@ -58,7 +58,6 @@ def test_scenario_cleanup(
device_uuid = device_id['device_uuid']['uuid']
LOGGER.info('Deleting Device {:s}'.format(device_uuid))
device_client.DeleteDevice(DeviceId(**device_id))
#expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid)))
response = context_client.ListDevices(Empty())
assert len(response.devices) == 0
......@@ -72,7 +71,6 @@ def test_scenario_cleanup(
LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid))
context_client.RemoveTopology(TopologyId(**topology_id))
context_id = json_context_id(context_uuid)
#expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id)))
# ----- Delete Contexts and Validate Collected Events --------------------------------------------------------------
for context in CONTEXTS:
......@@ -80,4 +78,3 @@ def test_scenario_cleanup(
context_uuid = context_id['context_uuid']['uuid']
LOGGER.info('Deleting Context {:s}'.format(context_uuid))
context_client.RemoveContext(ContextId(**context_id))
#expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid)))
......@@ -54,15 +54,6 @@ def service_client():
def test_rules_entry(
context_client : ContextClient, device_client : DeviceClient, service_client : ServiceClient): # pylint: disable=redefined-outer-name
for device, _, __ in DEVICES:
# Enable device
device_p4_with_operational_status = copy.deepcopy(device)
device_p4_with_operational_status['device_operational_status'] = \
DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED
device_client.ConfigureDevice(Device(**device_p4_with_operational_status))
# ----- Create Services ---------------------------------------------------------------
for service, endpoints in SERVICES:
# Insert Service (table entries)
......@@ -72,22 +63,3 @@ def test_rules_entry(
service_client.CreateService(Service(**service_p4))
service_p4['service_endpoint_ids'].extend(endpoints)
service_client.UpdateService(Service(**service_p4))
"""
con_cl = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC'))
dev_cl = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC'))
srv_cl = ServiceClient(get_setting('SERVICESERVICE_SERVICE_HOST'), get_setting('SERVICESERVICE_SERVICE_PORT_GRPC'))
for service, endpoints in SERVICES:
service_uuid = service['service_id']['service_uuid']['uuid']
print('Creating Service {:s}'.format(service_uuid))
service_p4 = copy.deepcopy(service)
srv_cl.CreateService(Service(**service_p4))
#service_data = con_cl.GetService(ServiceId(**json_service_id('svc1')))
#print('service_data = {:s}'.format(grpc_message_to_json_string(service_data)))
service_p4 = copy.deepcopy(service)
service_p4['service_endpoint_ids'].extend(endpoints)
srv_cl.UpdateService(Service(**service_p4))
"""
\ No newline at end of file
......@@ -60,10 +60,3 @@ def test_rules_delete(
print('Deleting Service {:s}'.format(service_uuid))
service_p4 = copy.deepcopy(service)
response = service_client.DeleteService(ServiceId(**json_service_id(service_uuid, CONTEXT_ID)))
# ----- Disable Devices ---------------------------------------------------------------
for device, _, _ in DEVICES:
device_p4_with_operational_status = copy.deepcopy(device)
device_p4_with_operational_status['device_operational_status'] = \
DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED
device_client.ConfigureDevice(Device(**device_p4_with_operational_status))
......@@ -34,6 +34,8 @@ slice_client = SliceClient()
LOGGER = logging.getLogger(__name__)
DESCRIPTOR_LOADER_NUM_WORKERS = 10
def process_descriptors(descriptors):
try:
descriptors_file = request.files[descriptors.name]
......@@ -43,7 +45,7 @@ def process_descriptors(descriptors):
flash(f'Unable to load descriptor file: {str(e)}', 'danger')
return
descriptor_loader = DescriptorLoader(descriptors)
descriptor_loader = DescriptorLoader(descriptors, num_workers=DESCRIPTOR_LOADER_NUM_WORKERS)
results = descriptor_loader.process()
for message,level in compose_notifications(results):
if level == 'error': LOGGER.warning('ERROR message={:s}'.format(str(message)))
......