Commit d8e6fad6 authored by Andrea Sgambelluri's avatar Andrea Sgambelluri
Browse files

Minor corrections for the pipeline test for optical controller

parent 78eaa307
Loading
Loading
Loading
Loading
+20 −11
Changes for src/opticalcontroller/tools.py: 20 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -249,22 +249,31 @@ def list_in_list(a, b):
    return False


def reverse_link(link, link_key__to__src_dst_node_names : Dict[str, Tuple[str, str]]) -> str:
    src_name, dst_name = link_key__to__src_dst_node_names[link]
    rev_link_name = '{:s}-{:s}'.format(dst_name, src_name)
    return rev_link_name

"""def reverse_link(link):
    s, d = link.split('-')
    r_link = "{}-{}".format(d, s)
    return r_link"""
# def reverse_link(link, link_key__to__src_dst_node_names : Dict[str, Tuple[str, str]]) -> str:
#     src_name, dst_name = link_key__to__src_dst_node_names[link]
#     rev_link_name = '{:s}-{:s}'.format(dst_name, src_name)
#     return rev_link_name

def reverse_link(link):
    # Remove port information if present
def reverse_link(link, link_key__to__src_dst_node_names=None) -> str:
    # Remove port information if present (used by the P2MP code)
    link = link.split(' (Ports:')[0]
    if link_key__to__src_dst_node_names is not None and link in link_key__to__src_dst_node_names:
        src_name, dst_name = link_key__to__src_dst_node_names[link]
        return '{:s}-{:s}'.format(dst_name, src_name)
    s, d = link.split('-')
    return f"{d}-{s}"

# def reverse_link(link):
#     s, d = link.split('-')
#     r_link = "{}-{}".format(d, s)
#     return r_link

# def reverse_link(link):
#     # Remove port information if present
#     link = link.split(' (Ports:')[0]
#     s, d = link.split('-')
#     return f"{d}-{s}"

def get_slot_frequency(b, n):
    if debug:
        print(n)
+2 −2
Changes for src/tests/ofc24/descriptors/service-bidir.json: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@
            "service_type": 6,
            "service_status": {"service_status": 1},
            "service_endpoint_ids": [
                {"device_id": {"device_uuid": {"uuid": "T1.1"}}, "endpoint_uuid": {"uuid": "1"}},
                {"device_id": {"device_uuid": {"uuid": "T2.1"}}, "endpoint_uuid": {"uuid": "6"}}
                {"device_id": {"device_uuid": {"uuid": "T1.1"}}, "endpoint_uuid": {"uuid": "7"}},
                {"device_id": {"device_uuid": {"uuid": "T2.1"}}, "endpoint_uuid": {"uuid": "5"}}
            ],
            "service_constraints": [
                {"custom": {"constraint_type": "bandwidth[gbps]", "constraint_value": "100.0"}},