Skip to content
Snippets Groups Projects
Commit 47412fc8 authored by Erik Reid's avatar Erik Reid
Browse files

added a test that fails with the existing code

parent db7dd1c8
Branches
Tags
1 merge request!24Feature/dboard3 833 handle inactive bundle config
Source diff could not be displayed: it is too large. Options to address this: view the blob.
import ast
import netifaces
import ipaddress
import os
from lxml import etree
import pytest
from inventory_provider import juniper
......@@ -89,3 +91,25 @@ def test_asn_to_int_functionality():
with pytest.raises(ValueError):
asn_to_int('66512.2')
asn_to_int('Test')
def test_DBOARD3_833():
"""Test that the bundle inactive attribute is handled correctly.
The test data contains an interface: et-4/0/2 with the bundle
configuration (for ae6) marked as 'inactive'. et-4/0/2 also
has a logical interface configured.
This test confirms that either et-4/0/2 nor et-4/0/2.0 are
part of a bundle.
"""
test_filename = os.path.join(
os.path.dirname(__file__),
'data',
'DBOARD3-833.xml')
with open(test_filename, 'r') as f:
netconf_config = etree.XML(f.read())
interfaces = {i['name']: i for i in juniper.list_interfaces(netconf_config)}
assert not interfaces['et-4/0/2']['bundle']
assert not interfaces['et-4/0/2.0']['bundle']
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment