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
02703a2f
Commit
02703a2f
authored
4 years ago
by
Vidya Ambadipudi
Browse files
Options
Downloads
Patches
Plain Diff
added tests and removed unused category
parent
6655d690
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inventory_provider/tasks/worker.py
+0
-1
0 additions, 1 deletion
inventory_provider/tasks/worker.py
test/test_worker_utils.py
+34
-4
34 additions, 4 deletions
test/test_worker_utils.py
with
34 additions
and
5 deletions
inventory_provider/tasks/worker.py
+
0
−
1
View file @
02703a2f
...
...
@@ -696,7 +696,6 @@ class PollerServiceCategory(str, enum.Enum):
IAS
=
'
ias
'
RE_CUST
=
'
re_cust
'
RE_PEER
=
'
re_peer
'
BACKBONE
=
'
backbone
'
def
_classify_interface
(
ifc
):
...
...
This diff is collapsed.
Click to expand it.
test/test_worker_utils.py
+
34
−
4
View file @
02703a2f
...
...
@@ -65,16 +65,22 @@ def test_build_interface_services(mocked_worker_module):
assert
type
in
(
'
mdvpn
'
,
'
lhcone_peer
'
,
'
re_peer
'
,
'
re_cust
'
,
'
ias
'
,
'
lhcone
'
,
'
lhcone_cust
'
)
'
lhcone_cust
'
,
'
l2_circuits
'
,
'
automated_l2_circuits
'
)
expected_seen_types
=
set
([
'
mdvpn
'
,
'
lhcone_peer
'
,
'
re_peer
'
,
'
re_cust
'
,
'
ias
'
,
'
lhcone
'
,
'
lhcone_cust
'
])
'
lhcone_cust
'
,
'
l2_circuits
'
,
'
automated_l2_circuits
'
])
assert
seen_types
==
expected_seen_types
...
...
@@ -126,6 +132,12 @@ def test_build_subnet_db(mocked_worker_module):
# this data is just enough to be an example
# ... seems the method is not yet ready for testing
@pytest.mark.parametrize
(
'
description,expected_categories
'
,
[
[
'
SRV_MDVPN CUSTOMER SANET SRF9939441 | VPN-Proxy to NREN CE
'
,
{
worker
.
PollerServiceCategory
.
MDVPN
}
],
[
'
SRV_L3VPN CUSTOMER ESNET LHCONE SRF9928635 | ASN293 | GEN-EEX-ESNET-LHCONE
'
,
# noqa
{
...
...
@@ -133,9 +145,27 @@ def test_build_subnet_db(mocked_worker_module):
}
],
[
'
SRV_
MD
VPN
CUSTOMER SANET SRF9939441 | VPN-Proxy to NREN CE
'
,
'
SRV_
L3
VPN
RE KREONET LHCONE SRF17072 | ASN17579
'
,
# noqa
{
worker
.
PollerServiceCategory
.
MDVPN
worker
.
PollerServiceCategory
.
LHCONE_PEER
}
],
[
'
SRV_IAS CUSTOMER ACONET SRF9947199 IASPS | ASN1853
'
,
# noqa
{
worker
.
PollerServiceCategory
.
IAS
}
],
[
'
SRV_GLOBAL RE_INTERCONNECT HBKU SRF18085 | ASN34945|
'
,
# noqa
{
worker
.
PollerServiceCategory
.
RE_PEER
}
],
[
'
SRV_GLOBAL RE_INTERCONNECT HBKU SRF18085 | ASN34945|
'
,
# noqa
{
worker
.
PollerServiceCategory
.
RE_PEER
}
]
])
...
...
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