Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
47412fc8
Commit
47412fc8
authored
1 year ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
added a test that fails with the existing code
parent
db7dd1c8
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!24
Feature/dboard3 833 handle inactive bundle config
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/data/DBOARD3-833.xml
+230
-0
230 additions, 0 deletions
test/data/DBOARD3-833.xml
test/test_juniper_data_global.py
+24
-0
24 additions, 0 deletions
test/test_juniper_data_global.py
with
254 additions
and
0 deletions
test/data/DBOARD3-833.xml
0 → 100644
+
230
−
0
View file @
47412fc8
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
test/test_juniper_data_global.py
+
24
−
0
View file @
47412fc8
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
'
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment