diff --git a/src/tests/ecoc22/descriptors_emulated-BigNet.json b/src/tests/ecoc22/descriptors_emulated-BigNet.json new file mode 100644 index 0000000000000000000000000000000000000000..cd038269425755258cea9b0908478d66702ad9cc --- /dev/null +++ b/src/tests/ecoc22/descriptors_emulated-BigNet.json @@ -0,0 +1,1299 @@ +{ + "contexts": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "service_ids": [], + "topology_ids": [] + } + ], + "devices": [ + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CE1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CE2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CE3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CE4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "PE1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "PE2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "PE3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "PE4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB6" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/4\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/5\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/6\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + } + ], + "links": [ + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CE1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "PE1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CE1/1/1==CE1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CE2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "PE2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CE2/1/1==CE2/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CE3" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "PE3" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CE3/1/1==CE3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CE4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "PE4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CE4/1/1==CE4/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE1" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE1/2/1==PE1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE1" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE1/2/2==PE1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE2" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE2/2/1==PE2/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE2" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE2/2/2==PE2/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE3" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE3/2/2==PE3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE3" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE3/2/1==PE3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE4" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE4/2/2==PE4/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE4" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE4/2/1==PE4/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB1/2/1==BB1/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB3" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB2/2/1==BB2/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB3" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB3/2/1==BB3/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB4/2/1==BB4/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB6" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB5/2/1==BB5/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB6" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB6/2/1==BB6/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB1/2/3==BB1/2/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB2/2/3==BB2/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB3" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB3/2/3==BB3/2/3" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/4" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB4/2/3==BB4/2/4" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/5" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB5/2/3==BB5/2/5" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB6" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/6" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB6/2/3==BB6/2/6" + } + } + } + ], + "topologies": [ + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ] +} \ No newline at end of file diff --git a/src/tests/ecoc22/descriptors_emulated-DC_CSGW_TN.json b/src/tests/ecoc22/descriptors_emulated-DC_CSGW_TN.json new file mode 100644 index 0000000000000000000000000000000000000000..5f40edac2feef134c02a74b08fcad21d917aae07 --- /dev/null +++ b/src/tests/ecoc22/descriptors_emulated-DC_CSGW_TN.json @@ -0,0 +1,1005 @@ +{ + "contexts": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "service_ids": [], + "topology_ids": [] + } + ], + "devices": [ + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "device_operational_status": 1, + "device_type": "emu-datacenter" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "device_operational_status": 1, + "device_type": "emu-datacenter" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + } + ], + "links": [ + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC1-GW/eth1==CS1-GW1/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC1-GW/eth2==CS1-GW2/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC2-GW/eth1==CS2-GW1/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC2-GW/eth2==CS2-GW2/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW1/1/1==TN-R1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW2/1/1==TN-R2/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW1/1/2==TN-R2/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW2/1/2==TN-R1/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW1/1/1==TN-R3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW2/1/1==TN-R4/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW1/1/2==TN-R4/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW2/1/2==TN-R3/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R1/2/1==TN-R2/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R2/2/1==TN-R3/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R3/2/1==TN-R4/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R4/2/1==TN-R1/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R1/2/3==TN-R3/2/3" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R2/2/3==TN-R4/2/3" + } + } + } + ], + "topologies": [ + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "DC1" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "DC2" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "CS1" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "CS2" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "TN" + } + } + } + ] +} \ No newline at end of file diff --git a/src/tests/ecoc22/descriptors_emulated-DC_CSGW_TN_OLS.json b/src/tests/ecoc22/descriptors_emulated-DC_CSGW_TN_OLS.json new file mode 100644 index 0000000000000000000000000000000000000000..8d8e6fde3d3c183688fdc6ec7c3e6498c0d6791a --- /dev/null +++ b/src/tests/ecoc22/descriptors_emulated-DC_CSGW_TN_OLS.json @@ -0,0 +1,985 @@ +{ + "contexts": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "service_ids": [], + "topology_ids": [] + } + ], + "devices": [ + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "device_operational_status": 1, + "device_type": "emu-datacenter" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "device_operational_status": 1, + "device_type": "emu-datacenter" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"a3adcbbcc03f\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"9329780033f5\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"e8a127ea3ed1\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"ef1c58823a49\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "device_operational_status": 1, + "device_type": "emu-open-line-system" + } + ], + "links": [ + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC1-GW/eth1==CS1-GW1/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC1-GW/eth2==CS1-GW2/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC2-GW/eth1==CS2-GW1/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC2-GW/eth2==CS2-GW2/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW1/1/1==TN-R1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW2/1/1==TN-R2/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW1/1/2==TN-R2/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW2/1/2==TN-R1/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW1/1/1==TN-R3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW2/1/1==TN-R4/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW1/1/2==TN-R4/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW2/1/2==TN-R3/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "endpoint_uuid": { + "uuid": "a3adcbbcc03f" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R1/2/1==TN-OLS/a3adcbbcc03f" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "endpoint_uuid": { + "uuid": "9329780033f5" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R2/2/1==TN-OLS/9329780033f5" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "endpoint_uuid": { + "uuid": "e8a127ea3ed1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R3/2/1==TN-OLS/e8a127ea3ed1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "endpoint_uuid": { + "uuid": "ef1c58823a49" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R4/2/1==TN-OLS/ef1c58823a49" + } + } + } + ], + "topologies": [ + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "DC1" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "DC2" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "CS1" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "CS2" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "TN" + } + } + } + ] +} \ No newline at end of file diff --git a/src/tests/ecoc22/tests/BuildDescriptors.py b/src/tests/ecoc22/tests/BuildDescriptors.py index fab6f2ceb04f6e34a954a815bbc8e220c687237f..b0075c0639c70092ed60bafd06c9f62b581faa33 100644 --- a/src/tests/ecoc22/tests/BuildDescriptors.py +++ b/src/tests/ecoc22/tests/BuildDescriptors.py @@ -12,15 +12,51 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy, json, sys -from .Objects_OldBigNet import CONTEXTS, DEVICES, LINKS, TOPOLOGIES +# Execution: +# $ cd src +# $ python -m tests.ecoc22.tests.BuildDescriptors dc-csgw-tn +# $ python -m tests.ecoc22.tests.BuildDescriptors dc-csgw-tn-ols +# $ python -m tests.ecoc22.tests.BuildDescriptors bignet + +import copy, json, os, sys +from enum import Enum +from typing import Dict, Tuple + +class Scenario(Enum): + BIGNET = 'bignet' + DC_CSGW_TN = 'dc-csgw-tn' + DC_CSGW_TN_OLS = 'dc-csgw-tn-ols' + +scenario = None if len(sys.argv) < 2 else sys.argv[1].lower() + +if scenario == Scenario.BIGNET.value: + from .Objects_BigNet import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + FILENAME = 'tests/ecoc22/descriptors_emulated-BigNet.json' +elif scenario == Scenario.DC_CSGW_TN.value: + os.environ['ADD_CONNECT_RULES_TO_DEVICES'] = 'TRUE' + from .Objects_DC_CSGW_TN import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + FILENAME = 'tests/ecoc22/descriptors_emulated-DC_CSGW_TN.json' +elif scenario == Scenario.DC_CSGW_TN_OLS.value: + os.environ['ADD_CONNECT_RULES_TO_DEVICES'] = 'TRUE' + from .Objects_DC_CSGW_TN_OLS import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + FILENAME = 'tests/ecoc22/descriptors_emulated-DC_CSGW_TN_OLS.json' +else: + scenarios = str([s.value for s in Scenario]) + raise Exception('Unsupported Scenario({:s}), choices are: {:s}'.format(scenario, scenarios)) def main(): - with open('tests/ecoc22/descriptors_emulated.json', 'w', encoding='UTF-8') as f: + with open(FILENAME, 'w', encoding='UTF-8') as f: devices = [] - for device,connect_rules in DEVICES: + for item in DEVICES: + if isinstance(item, Dict): + device = item + elif isinstance(item, Tuple) and len(item) == 2: + device,connect_rules = item + else: + raise Exception('Wrongly formatted item: {:s}'.format(str(item))) device = copy.deepcopy(device) - device['device_config']['config_rules'].extend(connect_rules) + if len(item) == 2: + device['device_config']['config_rules'].extend(connect_rules) devices.append(device) f.write(json.dumps({ @@ -28,7 +64,7 @@ def main(): 'topologies': TOPOLOGIES, 'devices': devices, 'links': LINKS - })) + }, sort_keys=True, indent=4)) return 0 if __name__ == '__main__': diff --git a/src/tests/ecoc22/tests/Fixtures.py b/src/tests/ecoc22/tests/Fixtures.py index 5c5fd26e081870b5ffbfddb6881a2415cc7843cb..70b41bdcb159552daa3dcf0c041a3713e2d1c821 100644 --- a/src/tests/ecoc22/tests/Fixtures.py +++ b/src/tests/ecoc22/tests/Fixtures.py @@ -3,7 +3,9 @@ from common.Settings import get_setting from compute.tests.mock_osm.MockOSM import MockOSM from context.client.ContextClient import ContextClient from device.client.DeviceClient import DeviceClient +#from .Objects_BigNet import WIM_MAPPING, WIM_PASSWORD, WIM_USERNAME from .Objects_DC_CSGW_TN import WIM_MAPPING, WIM_PASSWORD, WIM_USERNAME +#from .Objects_DC_CSGW_TN_OLS import WIM_MAPPING, WIM_PASSWORD, WIM_USERNAME @pytest.fixture(scope='session') def context_client(): diff --git a/src/tests/ecoc22/tests/Objects_OldBigNet.py b/src/tests/ecoc22/tests/Objects_BigNet.py similarity index 99% rename from src/tests/ecoc22/tests/Objects_OldBigNet.py rename to src/tests/ecoc22/tests/Objects_BigNet.py index 33a6ad052b0bfcadb6c4e3fafdf87f4cc923faa2..592376ff9dbaebbf4d8d02b04189e5d4f24584e3 100644 --- a/src/tests/ecoc22/tests/Objects_OldBigNet.py +++ b/src/tests/ecoc22/tests/Objects_BigNet.py @@ -20,7 +20,6 @@ from common.tools.object_factory.Device import ( 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 - # ----- Context -------------------------------------------------------------------------------------------------------- CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) CONTEXT = json_context(DEFAULT_CONTEXT_UUID) diff --git a/src/tests/ecoc22/tests/Objects_DC_CSGW_TN.py b/src/tests/ecoc22/tests/Objects_DC_CSGW_TN.py index 642b12b581783d86217263d3631746953ebaf88b..e5504bbf9062e3dca55e1efeb7f962c1f6144e3a 100644 --- a/src/tests/ecoc22/tests/Objects_DC_CSGW_TN.py +++ b/src/tests/ecoc22/tests/Objects_DC_CSGW_TN.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os 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 ( @@ -22,21 +23,26 @@ from common.tools.object_factory.Link import get_link_uuid, json_link, json_link from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned from common.tools.object_factory.Topology import json_topology, json_topology_id -def compose_router(device_uuid, endpoint_uuids, topology_id=None, with_connect_rules=True): +# if true, Device component is present and will infeer the endpoints from connect-rules +# if false, Device component is not present and device objects must contain preconfigured endpoints +ADD_CONNECT_RULES_TO_DEVICES = os.environ.get('ADD_CONNECT_RULES_TO_DEVICES', 'False') +ADD_CONNECT_RULES_TO_DEVICES = ADD_CONNECT_RULES_TO_DEVICES.upper() in {'T', 'TRUE', '1', 'Y', 'YES'} + +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] - config_rules = json_device_emulated_connect_rules(r_endpoints) if with_connect_rules else [] + 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 with_connect_rules else endpoints + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints device = json_device_emulated_packet_router_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) return device_id, endpoints, device -def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None, with_connect_rules=True): +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] - config_rules = json_device_emulated_connect_rules(r_endpoints) if with_connect_rules else [] + 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 with_connect_rules else endpoints + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints device = json_device_emulated_datacenter_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) return device_id, endpoints, device diff --git a/src/tests/ecoc22/tests/Objects_DC_CSGW_TN_OLS.py b/src/tests/ecoc22/tests/Objects_DC_CSGW_TN_OLS.py index 5b1d01c300802f64c5afc4d8a5cfa2895b08f4bc..9d67b1a41a16709e2e47bda9f9dc0e7e4bfdc1cf 100644 --- a/src/tests/ecoc22/tests/Objects_DC_CSGW_TN_OLS.py +++ b/src/tests/ecoc22/tests/Objects_DC_CSGW_TN_OLS.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import uuid +import os, uuid 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 ( @@ -23,30 +23,35 @@ from common.tools.object_factory.Link import get_link_uuid, json_link, json_link from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned from common.tools.object_factory.Topology import json_topology, json_topology_id -def compose_router(device_uuid, endpoint_uuids, topology_id=None, with_connect_rules=True): +# if true, Device component is present and will infeer the endpoints from connect-rules +# if false, Device component is not present and device objects must contain preconfigured endpoints +ADD_CONNECT_RULES_TO_DEVICES = os.environ.get('ADD_CONNECT_RULES_TO_DEVICES', 'False') +ADD_CONNECT_RULES_TO_DEVICES = ADD_CONNECT_RULES_TO_DEVICES.upper() in {'T', 'TRUE', '1', 'Y', 'YES'} + +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] - config_rules = json_device_emulated_connect_rules(r_endpoints) if with_connect_rules else [] + 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 with_connect_rules else endpoints + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints device = json_device_emulated_packet_router_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) return device_id, endpoints, device -def compose_ols(device_uuid, endpoint_uuids, topology_id=None, with_connect_rules=True): +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] - config_rules = json_device_emulated_connect_rules(r_endpoints) if with_connect_rules else [] + 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 with_connect_rules else endpoints + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints device = json_device_emulated_tapi_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) return device_id, endpoints, device -def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None, with_connect_rules=True): +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] - config_rules = json_device_emulated_connect_rules(r_endpoints) if with_connect_rules else [] + 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 with_connect_rules else endpoints + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints device = json_device_emulated_datacenter_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) return device_id, endpoints, device diff --git a/src/tests/ecoc22/tests/test_functional_bootstrap.py b/src/tests/ecoc22/tests/test_functional_bootstrap.py index 2e5e0daf825723e7b9f8c476361c64cf099c2660..defc9a809820d1299f314aaa7b7709aeb1255693 100644 --- a/src/tests/ecoc22/tests/test_functional_bootstrap.py +++ b/src/tests/ecoc22/tests/test_functional_bootstrap.py @@ -17,8 +17,9 @@ from common.proto.context_pb2 import Context, ContextId, Device, DeviceId, Empty from context.client.ContextClient import ContextClient from device.client.DeviceClient import DeviceClient from .Fixtures import context_client, device_client -#from .Objects_OldBigNet import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES -from .Objects_DC_CSGW_TN import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, OBJECTS_PER_TOPOLOGY, TOPOLOGIES +#from .Objects_BigNet import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES +from .Objects_DC_CSGW_TN import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES +#from .Objects_DC_CSGW_TN_OLS import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES LOGGER = logging.getLogger(__name__) diff --git a/src/tests/ecoc22/tests/test_functional_cleanup.py b/src/tests/ecoc22/tests/test_functional_cleanup.py index 8c7ef7885c9ae8efa6aca592643251bf13bd22ac..81181db1c25bc78c1d5103aa878d951f4fa4df5f 100644 --- a/src/tests/ecoc22/tests/test_functional_cleanup.py +++ b/src/tests/ecoc22/tests/test_functional_cleanup.py @@ -18,8 +18,9 @@ from common.tools.object_factory.Context import json_context_id from context.client.ContextClient import ContextClient from device.client.DeviceClient import DeviceClient from .Fixtures import context_client, device_client -#from .Objects_OldBigNet import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES +#from .Objects_BigNet import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES from .Objects_DC_CSGW_TN import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES +#from .Objects_DC_CSGW_TN_OLS import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES LOGGER = logging.getLogger(__name__) diff --git a/src/tests/ecoc22/tests/test_functional_create_service.py b/src/tests/ecoc22/tests/test_functional_create_service.py index ed914bb691f8e377f7565cd0d834565e7b0d02bc..714bb98ab8d49e10ca965fe38e1fcf324f024648 100644 --- a/src/tests/ecoc22/tests/test_functional_create_service.py +++ b/src/tests/ecoc22/tests/test_functional_create_service.py @@ -18,8 +18,12 @@ from common.tools.grpc.Tools import grpc_message_to_json_string from compute.tests.mock_osm.MockOSM import MockOSM from context.client.ContextClient import ContextClient from .Fixtures import context_client, osm_wim +#from .Objects_BigNet import ( +# CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE) from .Objects_DC_CSGW_TN import ( CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE) +#from .Objects_DC_CSGW_TN_OLS import ( +# CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE) LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) diff --git a/src/tests/ecoc22/tests/test_functional_delete_service.py b/src/tests/ecoc22/tests/test_functional_delete_service.py index c24d70185c20a38ed398b187430757efe7109b17..c4899d8bad39b96e40418338ca9f12ff425fbd95 100644 --- a/src/tests/ecoc22/tests/test_functional_delete_service.py +++ b/src/tests/ecoc22/tests/test_functional_delete_service.py @@ -24,9 +24,12 @@ from common.tools.grpc.Tools import grpc_message_to_json_string from compute.tests.mock_osm.MockOSM import MockOSM from context.client.ContextClient import ContextClient from context.client.EventsCollector import EventsCollector -from .Objects_OldBigNet import ( - CONTEXT_ID, CONTEXTS, DEVICE_O1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES, WIM_MAPPING, - WIM_PASSWORD, WIM_USERNAME) +#from .Objects_BigNet import ( +# CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE) +from .Objects_DC_CSGW_TN import ( + CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE) +#from .Objects_DC_CSGW_TN_OLS import ( +# CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE) LOGGER = logging.getLogger(__name__)