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
d95295d9
Commit
d95295d9
authored
3 years ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Add NREN type and test cases
parent
315c2f64
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inventory_provider/routes/poller.py
+9
-3
9 additions, 3 deletions
inventory_provider/routes/poller.py
test/test_general_poller_routes.py
+25
-3
25 additions, 3 deletions
test/test_general_poller_routes.py
with
34 additions
and
6 deletions
inventory_provider/routes/poller.py
+
9
−
3
View file @
d95295d9
...
...
@@ -99,6 +99,9 @@ class BRIAN_DASHBOARDS(Enum):
LHCONE
=
auto
()
CAE1
=
auto
()
# NREN customer
NREN
=
auto
()
# only used in INTERFACE_LIST_SCHEMA and sphinx docs
_DASHBOARD_IDS
=
[
d
.
name
for
d
in
list
(
BRIAN_DASHBOARDS
)]
...
...
@@ -397,6 +400,9 @@ def _get_dashboards(interface):
yield
BRIAN_DASHBOARDS
.
CAE1
if
re
.
match
(
'
^PHY UPSTREAM
'
,
description
):
yield
BRIAN_DASHBOARDS
.
GWS_PHY_UPSTREAM
regex
=
r
'
(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER
'
if
re
.
match
(
regex
,
description
):
yield
BRIAN_DASHBOARDS
.
NREN
def
_add_dashboards
(
interfaces
):
...
...
@@ -778,9 +784,9 @@ def eumetsat_multicast(hostname=None):
MX1_FRA
=
'
mx1.fra.de.geant.net
'
SUBSCRIPTIONS
=
[{
'
subscription
'
:
f
'
232.223.222.
{
idx
}
'
,
'
endpoint
'
:
'
193.17.9.3
'
,
}
for
idx
in
range
(
1
,
73
)]
'
subscription
'
:
f
'
232.223.222.
{
idx
}
'
,
'
endpoint
'
:
'
193.17.9.3
'
,
}
for
idx
in
range
(
1
,
73
)]
SUBSCRIPTIONS
.
append
(
{
'
subscription
'
:
'
232.223.223.1
'
,
'
endpoint
'
:
'
193.17.9.7
'
})
...
...
This diff is collapsed.
Click to expand it.
test/test_general_poller_routes.py
+
25
−
3
View file @
d95295d9
...
...
@@ -55,7 +55,7 @@ def test_eumetsat_multicast(mocker, client):
# routers don't have snmp acl's for us
mocker
.
patch
(
'
inventory_provider.juniper.snmp_community_string
'
)
\
.
return_value
=
'
blah
'
.
return_value
=
'
blah
'
rv
=
client
.
get
(
'
/poller/eumetsat-multicast
'
,
...
...
@@ -219,9 +219,31 @@ def test_fw_counter_bytes_oid_values(customer, interface_name, expected_oid):
@pytest.mark.parametrize
(
'
description,expected_dashboards
'
,
[
(
'
SRV_IAS CUSTOMER JISC #JISC-AP1-IAS IASPS | ASN786
'
,
[
'
IAS_CUSTOMER
'
]),
[
'
IAS_CUSTOMER
'
,
'
NREN
'
]),
(
'
SRV_L2CIRCUIT CUSTOMER JISC JISC #DUB-LON-NRENBBEXT-JANET-13015 | backup for niran
'
,
# noqa: E501
[
'
L2_CIRCUIT
'
])
[
'
L2_CIRCUIT
'
]),
(
'
SRV_L3VPN CUSTOMER EENET #EENET-AP2-LHCONE | ASN3221
'
,
[
'
LHCONE
'
,
'
LHCONE_CUST
'
,
'
NREN
'
]),
(
'
SRV_IAS PRIVATE OPTIMA-TELEKOM #HR-EduZone | For Eduzone
'
,
[
'
IAS_PEERS
'
,
'
IAS_PRIVATE
'
]),
(
'
SRV_CLS PRIVATE AWS #AT-AWS-CLS|ASN16509 |
'
,
[
'
CLS
'
,
'
CLS_PEERS
'
]),
(
'
SRV_IAS PUBLIC MIX #IX_Peerings_in_MIX |
'
,
[
'
IAS_PEERS
'
,
'
IAS_PUBLIC
'
]),
(
'
LAG INFRASTRUCTURE BACKBONE SRF0000001 | bil-por
'
,
[
'
INFRASTRUCTURE_BACKBONE
'
]),
(
'
SRV_GCS CUSTOMER FCCN MICROSOFT #FCCN_NoveSBE_ExpressRoute_Vlan1945 | UNIT CONFIGURATION HAS BEEN SYSTEM GENERATED
'
,
# noqa: E501
[
'
GCS
'
]),
(
'
PHY UPSTREAM TELIA SRF9940473 | Telia ID: IC-326863
'
,
[
'
GWS_PHY_UPSTREAM
'
]),
(
'
SRV_IAS UPSTREAM COGENT #COGENT_GWS_VIE | ASN174
'
,
[
'
IAS_UPSTREAM
'
]),
(
'
SRV_L3VPN RE_INTERCONNECT CLARA #REDCLARA-LIS-LHCONE | ASN27750
'
,
[
'
LHCONE
'
,
'
LHCONE_PEER
'
]),
(
'
SRV_MDVPN CUSTOMER REDIRIS #RedIRIS_AP1_BGP_LU_CoC_1 | MD VPN CoC-REDIRIS -
'
,
# noqa: E501
[
'
MDVPN_CUSTOMERS
'
,
'
NREN
'
]),
(
'
SRV_L2CIRCUIT CUSTOMER TENET PSNC #lon-lon-GEANTOPEN-PSNC-TENET-18067 |
'
,
# noqa: E501
[
'
GEANTOPEN
'
,
'
L2_CIRCUIT
'
])
])
def
test_interface_dashboard_mapping
(
description
,
expected_dashboards
):
interface
=
{
...
...
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