diff --git a/src/tests/eucnc24/data/ietf-l3vpn-service.json b/src/tests/eucnc24/data/ietf-l3vpn-service.json index bfeb93fb74c9513ef4d175d5962110127303a2a7..a6297b28f0fea94dcc8a457ad2b45d38e77aa4ea 100644 --- a/src/tests/eucnc24/data/ietf-l3vpn-service.json +++ b/src/tests/eucnc24/data/ietf-l3vpn-service.json @@ -1,231 +1,83 @@ { - "ietf-l3vpn-svc:l3vpn-svc": { - "vpn-services": { - "vpn-service": [ - { - "vpn-id": "vpn1" - } - ] - }, - "sites": { - "site": [ - { - "site-id": "site_OLT", - "management": { - "type": "ietf-l3vpn-svc:provider-managed" - }, - "locations": { - "location": [ - { - "location-id": "OLT" - } - ] - }, - "devices": { - "device": [ - { - "device-id": "128.32.33.5", - "location": "OLT" - } - ] - }, - "routing-protocols": { - "routing-protocol": [ - { - "type": "ietf-l3vpn-svc:static", - "static": { - "cascaded-lan-prefixes": { - "ipv4-lan-prefixes": [ - { - "lan": "128.32.10.1/24", - "lan-tag": "vlan21", - "next-hop": "128.32.33.2" - }, - { - "lan": "128.32.20.1/24", - "lan-tag": "vlan21", - "next-hop": "128.32.33.2" - } - ] - } - } - } - ] - }, - "site-network-accesses": { - "site-network-access": [ - { - "site-network-access-id": "500", - "site-network-access-type": "ietf-l3vpn-svc:multipoint", - "device-reference": "128.32.33.5", - "vpn-attachment": { - "vpn-id": "vpn1", - "site-role": "ietf-l3vpn-svc:spoke-role" - }, - "ip-connection": { - "ipv4": { - "address-allocation-type": "ietf-l3vpn-svc:static-address", - "addresses": { - "provider-address": "128.32.33.254", - "customer-address": "128.32.33.2", - "prefix-length": 24 - } - } - }, - "routing-protocols": { - "routing-protocol": [ - { - "type": "ietf-l3vpn-svc:static", - "static": { - "cascaded-lan-prefixes": { - "ipv4-lan-prefixes": [ + "ietf-l3vpn-svc:l3vpn-svc": { + "vpn-services": {"vpn-service": [{"vpn-id": "ietf-l3vpn-svc"}]}, + "sites": { + "site": [ + { + "site-id": "site_DC1", + "management": {"type": "ietf-l3vpn-svc:provider-managed"}, + "locations": {"location": [{"location-id": "DC1"}]}, + "devices": {"device": [{"device-id": "dc1", "location": "DC1"}]}, + "site-network-accesses": { + "site-network-access": [ { - "lan": "172.1.101.1/24", - "lan-tag": "vlan21", - "next-hop": "128.32.33.254" - } - ] - } - } - } - ] - }, - "service": { - "svc-mtu": 1500, - "svc-input-bandwidth": 1000000000, - "svc-output-bandwidth": 1000000000, - "qos": { - "qos-profile": { - "classes": { - "class": [ - { - "class-id": "qos-realtime", - "direction": "ietf-l3vpn-svc:both", - "latency": { - "latency-boundary": 10 - }, - "bandwidth": { - "guaranteed-bw-percent": 100 + "site-network-access-id": "int", + "site-network-access-type": "ietf-l3vpn-svc:multipoint", + "device-reference": "dc1", + "vpn-attachment": {"vpn-id": "ietf-l3vpn-svc", "site-role": "ietf-l3vpn-svc:spoke-role"}, + "ip-connection": { + "ipv4": { + "address-allocation-type": "ietf-l3vpn-svc:static-address", + "addresses": { + "provider-address": "192.168.1.1", + "customer-address": "192.168.1.10", + "prefix-length": 24 + } + } + }, + "service": { + "svc-mtu": 1500, + "svc-input-bandwidth": 1000000000, + "svc-output-bandwidth": 1000000000, + "qos": {"qos-profile": {"classes": {"class": [{ + "class-id": "qos-realtime", + "direction": "ietf-l3vpn-svc:both", + "latency": {"latency-boundary": 10}, + "bandwidth": {"guaranteed-bw-percent": 100} + }]}}} + } } - } ] - } } - } - } - } - ] - } - }, - { - "site-id": "site_POP", - "management": { - "type": "ietf-l3vpn-svc:provider-managed" - }, - "locations": { - "location": [ - { - "location-id": "POP" - } - ] - }, - "devices": { - "device": [ - { - "device-id": "172.10.33.5", - "location": "POP" - } - ] - }, - "routing-protocols": { - "routing-protocol": [ - { - "type": "ietf-l3vpn-svc:static", - "static": { - "cascaded-lan-prefixes": { - "ipv4-lan-prefixes": [ - { - "lan": "172.1.101.1/24", - "lan-tag": "vlan101", - "next-hop": "172.10.33.2" - } - ] - } - } - } - ] - }, - "site-network-accesses": { - "site-network-access": [ - { - "site-network-access-id": "500", - "site-network-access-type": "ietf-l3vpn-svc:multipoint", - "device-reference": "172.10.33.5", - "vpn-attachment": { - "vpn-id": "vpn1", - "site-role": "ietf-l3vpn-svc:hub-role" }, - "ip-connection": { - "ipv4": { - "address-allocation-type": "ietf-l3vpn-svc:static-address", - "addresses": { - "provider-address": "172.10.33.254", - "customer-address": "172.10.33.2", - "prefix-length": 24 - } - } - }, - "routing-protocols": { - "routing-protocol": [ - { - "type": "ietf-l3vpn-svc:static", - "static": { - "cascaded-lan-prefixes": { - "ipv4-lan-prefixes": [ - { - "lan": "128.32.10.1/24", - "lan-tag": "vlan101", - "next-hop": "172.10.33.254" - }, + { + "site-id": "site_DC2", + "management": {"type": "ietf-l3vpn-svc:provider-managed"}, + "locations": {"location": [{"location-id": "DC2"}]}, + "devices": {"device": [{"device-id": "dc2", "location": "DC2"}]}, + "site-network-accesses": { + "site-network-access": [ { - "lan": "128.32.20.1/24", - "lan-tag": "vlan101", - "next-hop": "172.10.33.254" - } - ] - } - } - } - ] - }, - "service": { - "svc-mtu": 1500, - "svc-input-bandwidth": 1000000000, - "svc-output-bandwidth": 1000000000, - "qos": { - "qos-profile": { - "classes": { - "class": [ - { - "class-id": "qos-realtime", - "direction": "ietf-l3vpn-svc:both", - "latency": { - "latency-boundary": 10 - }, - "bandwidth": { - "guaranteed-bw-percent": 100 + "site-network-access-id": "int", + "site-network-access-type": "ietf-l3vpn-svc:multipoint", + "device-reference": "dc2", + "vpn-attachment": {"vpn-id": "ietf-l3vpn-svc", "site-role": "ietf-l3vpn-svc:hub-role"}, + "ip-connection": { + "ipv4": { + "address-allocation-type": "ietf-l3vpn-svc:static-address", + "addresses": { + "provider-address": "192.168.2.1", + "customer-address": "192.168.2.10", + "prefix-length": 24 + } + } + }, + "service": { + "svc-mtu": 1500, + "svc-input-bandwidth": 1000000000, + "svc-output-bandwidth": 1000000000, + "qos": {"qos-profile": {"classes": {"class": [{ + "class-id": "qos-realtime", + "direction": "ietf-l3vpn-svc:both", + "latency": {"latency-boundary": 10}, + "bandwidth": {"guaranteed-bw-percent": 100} + }]}}} + } } - } ] - } } - } } - } ] - } } - ] } - } -} \ No newline at end of file +} diff --git a/src/tests/eucnc24/data/tfs-service.json b/src/tests/eucnc24/data/tfs-service.json index 98d5d432724f35596a5121c3dc2dae0cdf067564..397fc84789111932da047acd22c7bc787888657f 100644 --- a/src/tests/eucnc24/data/tfs-service.json +++ b/src/tests/eucnc24/data/tfs-service.json @@ -2,7 +2,7 @@ "services": [ { "service_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "dc1-2-dc2-l3svc"} + "context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "tfs-l3vpn-svc"} }, "service_type": "SERVICETYPE_L3NM", "service_status": {"service_status": "SERVICESTATUS_PLANNED"}, diff --git a/src/tests/eucnc24/tests/test_functional_service_tfs.py b/src/tests/eucnc24/tests/test_functional_service_tfs.py index f66047db3ce5295f860ac69b425cd660f77aed34..84385843b5a982219ac3b6d5d473e7371153db2a 100644 --- a/src/tests/eucnc24/tests/test_functional_service_tfs.py +++ b/src/tests/eucnc24/tests/test_functional_service_tfs.py @@ -98,19 +98,18 @@ def test_service_tfs_removal( for service in response.services: service_id = service.service_id assert service.service_status.service_status == ServiceStatusEnum.SERVICESTATUS_ACTIVE + assert service.service_type == ServiceTypeEnum.SERVICETYPE_L3NM response = context_client.ListConnections(service_id) LOGGER.warning(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( - grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) - - if service.service_type == ServiceTypeEnum.SERVICETYPE_OPTICAL_CONNECTIVITY: - assert len(response.connections) == 2 - context_uuid = service_id.context_id.context_uuid.uuid - service_uuid = service_id.service_uuid.uuid - context_service_uuids.add((context_uuid, service_uuid)) - else: - str_service = grpc_message_to_json_string(service) - raise Exception('Unexpected ServiceType: {:s}'.format(str_service)) + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response) + )) + assert len(response.connections) == 1 + + context_uuid = service_id.context_id.context_uuid.uuid + service_uuid = service_id.service_uuid.uuid + context_service_uuids.add((context_uuid, service_uuid)) # Identify service to delete assert len(context_service_uuids) == 1