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

Forecaster component:

- Extended tests/Tools to allow setting client endpoints in test descriptors
- Minor code cleanup
parent 35248a79
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!160Resolve "(CTTC) Forecaster component"
...@@ -56,7 +56,7 @@ def read_csv(csv_file : str) -> pandas.DataFrame: ...@@ -56,7 +56,7 @@ def read_csv(csv_file : str) -> pandas.DataFrame:
return df return df
def compose_descriptors(df : pandas.DataFrame) -> Dict: def compose_descriptors(df : pandas.DataFrame, num_client_endpoints : int = 0) -> Dict:
devices = dict() devices = dict()
links = dict() links = dict()
...@@ -72,11 +72,17 @@ def compose_descriptors(df : pandas.DataFrame) -> Dict: ...@@ -72,11 +72,17 @@ def compose_descriptors(df : pandas.DataFrame) -> Dict:
dst_port_uuid = row.source dst_port_uuid = row.source
if src_device_uuid not in devices: if src_device_uuid not in devices:
devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': set()} endpoints = set()
for num_client_endpoint in range(num_client_endpoints):
endpoints.add('client:{:d}'.format(num_client_endpoint))
devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': endpoints}
devices[src_device_uuid]['endpoints'].add(src_port_uuid) devices[src_device_uuid]['endpoints'].add(src_port_uuid)
if dst_device_uuid not in devices: if dst_device_uuid not in devices:
devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': set()} endpoints = set()
for num_client_endpoint in range(num_client_endpoints):
endpoints.add('client:{:d}'.format(num_client_endpoint))
devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': endpoints}
devices[dst_device_uuid]['endpoints'].add(dst_port_uuid) devices[dst_device_uuid]['endpoints'].add(dst_port_uuid)
if link_uuid not in links: if link_uuid not in links:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment