diff --git a/test/per_router/test_data_routes.py b/test/per_router/test_data_routes.py index 11bd5353ee036f79ca22f63274426626d66a3266..4ac97975b0d8208bd680680f9f725bb2daca86ec 100644 --- a/test/per_router/test_data_routes.py +++ b/test/per_router/test_data_routes.py @@ -75,45 +75,55 @@ def test_snmp_ids(router, client): def test_router_bgp_routes(router, client): - ROUTERS_WITH_BGP_CONFIG = [ - "mx1.bud.hu.geant.net", - "mx1.pra.cz.geant.net", - "mx1.lon.uk.geant.net", - "mx1.vie.at.geant.net", - "mx1.ams.nl.geant.net", - "mx1.fra.de.geant.net", - "mx1.gen.ch.geant.net", - "mx1.mil2.it.geant.net", - "mx1.mad.es.geant.net", - "mx1.dub.ie.geant.net", - "mx1.mar.fr.geant.net" + ROUTERS_WITHOUT_PEERING_DATA = [ + 'mx2.bru.be.geant.net' ] - - if router not in ROUTERS_WITH_BGP_CONFIG: + if router in ROUTERS_WITHOUT_PEERING_DATA: pytest.skip('%s is not expected to have bgp peers' % router) return bgp_list_schema = { "$schema": "http://json-schema.org/draft-07/schema#", - "type": "array", - "items": { - "type": "object", - "properties": { - "name": {"type": "string"}, - "description": {"type": "string"}, - "as": { - "type": "object", - "properties": { - "peer": {"type": "integer"}, - "local": {"type": "integer"} - }, - "required": ["peer", "local"], - "additionalProperties": False + "definitions": { + "instance-peering": { + "type": "object", + "properties": { + "instance": {"type": "string"}, + "group": {"type": "string"}, + "description": {"type": "string"}, + "address": {"type": "string"}, + "remote-asn": {"type": "integer"}, + "local-asn": {"type": "integer"} }, + # description and-or local-asn is not always present, + # just based on empirical tests - not a problem + "required": ["instance", "group", "address", "remote-asn"], + "additionalProperties": False }, - "required": ["description", "as", "name"], - "additionalProperties": False - } + "logical-system-peering": { + "type": "object", + "properties": { + "logical-system": {"type": "string"}, + "group": {"type": "string"}, + "description": {"type": "string"}, + "address": {"type": "string"}, + "remote-asn": {"type": "integer"}, + "local-asn": {"type": "integer"} + }, + # local/remote-asn and/or description are not always present, + # just based on empirical tests - not a problem + "required": ["logical-system", "group", "address"], + "additionalProperties": False + }, + "peering": { + "oneOf": [ + {"$ref": "#/definitions/instance-peering"}, + {"$ref": "#/definitions/logical-system-peering"} + ] + } + }, + "type": "array", + "items": {"$ref": "#/definitions/peering"} } rv = client.post(