Skip to content
Snippets Groups Projects
Commit aa1dafa6 authored by Robert Latta's avatar Robert Latta
Browse files

added interfaces from other stanzas and updated tests. RE DBOARD3-987

parent 40052ad6
No related branches found
No related tags found
No related merge requests found
......@@ -228,7 +228,9 @@ def get_lags_config(netconf_config):
def get_interfaces_config(netconf_config):
for interface in netconf_config.findall('configure/router/interface'):
for interface in netconf_config.xpath('configure/router/interface '
'| configure/service/vprn/interface '
'| configure/service/ies/interface'):
details = {
"interface-name": interface.find('interface-name').text,
"ipv4": [],
......
This diff is collapsed.
......@@ -10,7 +10,7 @@ from inventory_provider import nokia
PORT_SCHEMA = {
'$schema': 'https://json-schema.org/draft-07/schema#',
'$schema': 'https://json-schema.org/draft/2020-12/schema',
'type': 'object',
'properties': {
'port-id': {'type': 'string'},
......@@ -47,6 +47,13 @@ state_doc = nokia.remove_xml_namespaces(etree.parse(pathlib.Path(__file__).paren
@pytest.mark.parametrize('hostname,expected_bundles', [
('rt0.ams.nl.lab.office.geant.net', {
'lag-1': ['1/1/c2/1'],
'lag-2': ['1/1/c5/1'],
'lag-4': ['1/1/c8/1'],
'lag-5': ['1/1/c11/1', '2/1/c11/1'],
'lag-6': ['2/1/c8/1'],
'lag-11': ['1/1/c2/3']}),
('rt0.ams.nl.geant.net', {
'lag-5': ['1/1/c19/1', '2/1/c19/1'],
'lag-8': ['1/1/c1/1', '1/1/c5/1'],
......@@ -66,6 +73,17 @@ def test_get_lags(hostname, expected_bundles):
@pytest.mark.parametrize(
'hostname,all_expected_data', [
('rt0.ams.nl.lab.office.geant.net', (
('lag-1.0', {'62.40.119.88/31'}, {'2001:799:1ab:2::31/126'}),
('lag-2.0', {'62.40.119.90/31'}, {'2001:799:1ab:2::41/126'}),
('lag-4.0', {'62.40.119.98/31'}, {'2001:799:1ab:2::55/126'}),
('lag-5.0', {'62.40.119.100/31'}, {'2001:799:1ab:2::59/126'}),
('lag-6.0', {'62.40.119.102/31'}, {'2001:799:1ab:2::5d/126'}),
('system', {'62.40.119.6/32'}, {'2001:799:1ab::6/128'}),
('lag-11:100', {'62.40.124.217/30'}, {'2001:798:14:10aa::9/126'}),
('LAG-11.333', {'83.97.88.245/30'}, {'2001:7f8:3c::35/126'}),
('LAG-11.111', {'62.40.126.184/31'}, {'2001:798:111:1::31/126'}),
)),
('rt0.ams.nl.geant.net', (
('lag-5.0', {'62.40.98.39/31'}, {'2001:798:cc::62/126'}),
('lag-8.0', {'62.40.98.20/31'}, {'2001:798:cc::21/126'}),
......@@ -101,6 +119,7 @@ def test_interface_info(hostname, all_expected_data):
@pytest.mark.parametrize('hostname,port_count', [
('rt0.ams.nl.lab.office.geant.net', 65),
('rt0.ams.nl.geant.net', 66),
('rt0.fra.de.geant.net', 58),
('rt0.gen.ch.geant.net', 141),
......
......@@ -870,7 +870,7 @@ def test_refresh_nokia_interface_list(mocked_redis, data_config):
interface_hosts = json.loads(r.get(
'lab:netconf-interfaces-hosts:rt0.lon.uk.lab.office.geant.net'
).decode('utf-8'))
assert len(interface_hosts) == 9
assert len(interface_hosts) == 15
interface_hosts_schema = {
'$schema': 'http://json-schema.org/draft-07/schema#',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment