diff --git a/test/per_router/test_peer_caching.py b/test/per_router/test_peer_caching.py deleted file mode 100644 index 3111f1a3297b5a122d5ef95994bf0cf5e5251f44..0000000000000000000000000000000000000000 --- a/test/per_router/test_peer_caching.py +++ /dev/null @@ -1,93 +0,0 @@ -import os -import jsonschema -from lxml import etree -import pytest - -import inventory_provider -from inventory_provider import juniper - -TEST_DATA_DIRNAME = os.path.realpath(os.path.join( - inventory_provider.__path__[0], - '..', - 'test', - 'data')) - - -@pytest.fixture -def netconf(router): - netconf_filename = os.path.join( - TEST_DATA_DIRNAME, - router + '-netconf.xml') - doc = etree.parse(netconf_filename) - juniper.validate_netconf_config(doc) - return doc - - -def test_ix_public_peers(netconf): - - schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - - "definitions": { - "ip-address": { - "type": "string", - "oneOf": [ - {"pattern": r'^(\d+\.){3}\d+$'}, - {"pattern": r'^([a-f\d]{4}:){7}[a-f\d]{4}$'} - ] - } - }, - - "type": "object", - "properties": { - "name": {"$ref": "#/definitions/ip-address"}, - "description": {"type": "string"}, - "as": { - "type": "object", - "properties": { - "local": {"type": "integer"}, - "peer": {"type": "integer"}, - }, - "required": ["local", "peer"], - "additionalProperties": False - } - }, - "required": ["name", "description", "as"], - "additionalProperties": False - } - - for p in juniper.ix_public_peers(netconf): - jsonschema.validate(p, schema) - print(p) - - -def test_vpn_rr_peers(netconf): - - # there are actually no v6 addresses, pattern could be ommitted - # TODO: check if there's a robust justification for this - schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - - "definitions": { - "ip-address": { - "type": "string", - "oneOf": [ - {"pattern": r'^(\d+\.){3}\d+$'}, - {"pattern": r'^([a-f\d]{4}:){7}[a-f\d]{4}$'} - ] - } - }, - - "type": "object", - "properties": { - "name": {"$ref": "#/definitions/ip-address"}, - "description": {"type": "string"}, - "peer-as": {"type": "integer"} - }, - "required": ["name", "description"], - "additionalProperties": False - } - - for p in juniper.vpn_rr_peers(netconf): - jsonschema.validate(p, schema) - print(p)