Skip to content
Snippets Groups Projects
Commit 9e9bad69 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Fix test due to threading

parent a2b3dc6d
No related branches found
No related tags found
1 merge request!16Implement get_router_dashboard_data and _provision_vlan_dashboards
# flake8: noqa
import pytest import pytest
import responses import responses
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
...@@ -12,7 +13,6 @@ TEST_INTERFACES = [ ...@@ -12,7 +13,6 @@ TEST_INTERFACES = [
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "PHY CUSTOMER GEANT CORPORATE SRF000001 | GEANT Corporate to MX1.LON - Via Vodafone", "description": "PHY CUSTOMER GEANT CORPORATE SRF000001 | GEANT Corporate to MX1.LON - Via Vodafone",
# noqa: E501
"circuits": [ "circuits": [
{ {
"id": 679232, "id": 679232,
...@@ -43,7 +43,6 @@ TEST_INTERFACES = [ ...@@ -43,7 +43,6 @@ TEST_INTERFACES = [
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "SRV_GLOBAL CUSTOMER GEANT #GEANT_CORPORATE-ViaVodafone | GEANT Corporate to mx1.lon - Via Vodafone ", "description": "SRV_GLOBAL CUSTOMER GEANT #GEANT_CORPORATE-ViaVodafone | GEANT Corporate to mx1.lon - Via Vodafone ",
# noqa: E501
"circuits": [ "circuits": [
{ {
"id": 679360, "id": 679360,
...@@ -78,7 +77,6 @@ TEST_INTERFACES = [ ...@@ -78,7 +77,6 @@ TEST_INTERFACES = [
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "SRV_GLOBAL CUSTOMER GEANT #GEANT_CORPORATE_ViaVodafone-VRF | GEANT Corporate to mx1.lon - Via Vodafone - for VRF", "description": "SRV_GLOBAL CUSTOMER GEANT #GEANT_CORPORATE_ViaVodafone-VRF | GEANT Corporate to mx1.lon - Via Vodafone - for VRF",
# noqa: E501
"circuits": [ "circuits": [
{ {
"id": 712144, "id": 712144,
...@@ -111,11 +109,10 @@ TEST_INTERFACES = [ ...@@ -111,11 +109,10 @@ TEST_INTERFACES = [
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "SRV_GLOBAL CUSTOMER GEANT #GEANT_CORPORATE_ViaVodafone-VRF-TEST | GEANT Corporate to mx1.lon - Via Vodafone - DASHBOARD BGP TEST VLAN", "description": "SRV_GLOBAL CUSTOMER GEANT #GEANT_CORPORATE_ViaVodafone-VRF-TEST | GEANT Corporate to mx1.lon - Via Vodafone - DASHBOARD BGP TEST VLAN",
# noqa: E501
"circuits": [ "circuits": [
{ {
"id": 678920, "id": 678920,
"name": "GEANT_CORPORATE_VIAVODAFONE-VRF-TEST (DO NOT OPEN A TICKET)", # noqa: E501 "name": "GEANT_CORPORATE_VIAVODAFONE-VRF-TEST (DO NOT OPEN A TICKET)",
"type": "GEANT IP", "type": "GEANT IP",
"status": "non-monitored" "status": "non-monitored"
} }
...@@ -144,7 +141,6 @@ TEST_INTERFACES = [ ...@@ -144,7 +141,6 @@ TEST_INTERFACES = [
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "SRV_GLOBAL CUSTOMER GEANT #GEANT_OPERATIONS_LabConnectivity | GEANT MX1.LON Infinera VRF to Operations Lab", "description": "SRV_GLOBAL CUSTOMER GEANT #GEANT_OPERATIONS_LabConnectivity | GEANT MX1.LON Infinera VRF to Operations Lab",
# noqa: E501
"circuits": [ "circuits": [
{ {
"id": 678999, "id": 678999,
...@@ -226,7 +222,7 @@ TEST_INTERFACES = [ ...@@ -226,7 +222,7 @@ TEST_INTERFACES = [
"name": "ge-0/2/1.0", "name": "ge-0/2/1.0",
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "SRV_L2CIRCUIT INFRASTRUCTURE GEANT GEANT #AMS-ZAG OPENFLOW |", # noqa: E501 "description": "SRV_L2CIRCUIT INFRASTRUCTURE GEANT GEANT #AMS-ZAG OPENFLOW |",
"circuits": [], "circuits": [],
"snmp-index": 687, "snmp-index": 687,
"dashboards": [ "dashboards": [
...@@ -248,7 +244,7 @@ TEST_INTERFACES = [ ...@@ -248,7 +244,7 @@ TEST_INTERFACES = [
"name": "ge-0/2/2.0", "name": "ge-0/2/2.0",
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "SRV_L2CIRCUIT INFRASTRUCTURE GEANT GEANT #AMS-VIE OPENFLOW |", # noqa: E501 "description": "SRV_L2CIRCUIT INFRASTRUCTURE GEANT GEANT #AMS-VIE OPENFLOW |",
"circuits": [], "circuits": [],
"snmp-index": 711, "snmp-index": 711,
"dashboards": [ "dashboards": [
...@@ -270,7 +266,7 @@ TEST_INTERFACES = [ ...@@ -270,7 +266,7 @@ TEST_INTERFACES = [
"name": "ge-0/2/4.0", "name": "ge-0/2/4.0",
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "SRV_L2CIRCUIT INFRASTRUCTURE GEANT GEANT #AMS-FRA OPENFLOW |", # noqa: E501 "description": "SRV_L2CIRCUIT INFRASTRUCTURE GEANT GEANT #AMS-FRA OPENFLOW |",
"circuits": [], "circuits": [],
"snmp-index": 718, "snmp-index": 718,
"dashboards": [ "dashboards": [
...@@ -288,7 +284,6 @@ TEST_INTERFACES = [ ...@@ -288,7 +284,6 @@ TEST_INTERFACES = [
"ipv6": [] "ipv6": []
}, },
{ {
"router": "rt1.fra.de.geant.net", "router": "rt1.fra.de.geant.net",
"name": "xe-11/2/5.300", "name": "xe-11/2/5.300",
"bundle": [], "bundle": [],
...@@ -331,7 +326,7 @@ NREN_INTERFACES = [ ...@@ -331,7 +326,7 @@ NREN_INTERFACES = [
"ae10" "ae10"
], ],
"bundle-parents": [], "bundle-parents": [],
"description": "PHY CUSTOMER HEANET P_AE10 SRF9948758 | HEANET-AP2-LL3", # noqa: E501 "description": "PHY CUSTOMER HEANET P_AE10 SRF9948758 | HEANET-AP2-LL3",
"circuits": [], "circuits": [],
"snmp-index": 554, "snmp-index": 554,
"dashboards": [ "dashboards": [
...@@ -356,7 +351,7 @@ NREN_INTERFACES = [ ...@@ -356,7 +351,7 @@ NREN_INTERFACES = [
"ae10" "ae10"
], ],
"bundle-parents": [], "bundle-parents": [],
"description": "PHY CUSTOMER HEANET P_AE10 SRF0000001 | HEANET-AP2-LL2", # noqa: E501 "description": "PHY CUSTOMER HEANET P_AE10 SRF0000001 | HEANET-AP2-LL2",
"circuits": [], "circuits": [],
"snmp-index": 527, "snmp-index": 527,
"dashboards": [ "dashboards": [
...@@ -381,7 +376,7 @@ NREN_INTERFACES = [ ...@@ -381,7 +376,7 @@ NREN_INTERFACES = [
"ae10" "ae10"
], ],
"bundle-parents": [], "bundle-parents": [],
"description": "PHY CUSTOMER HEANET P_AE10 SRF9925903 | HEANET-AP2-LL1", # noqa: E501 "description": "PHY CUSTOMER HEANET P_AE10 SRF9925903 | HEANET-AP2-LL1",
"circuits": [], "circuits": [],
"snmp-index": 528, "snmp-index": 528,
"dashboards": [ "dashboards": [
...@@ -473,7 +468,7 @@ NREN_INTERFACES = [ ...@@ -473,7 +468,7 @@ NREN_INTERFACES = [
"xe-1/0/1", "xe-1/0/1",
"xe-1/1/0" "xe-1/1/0"
], ],
"description": "SRV_MDVPN CUSTOMER HEANET AP2 #HEANET-BGP-LU-CoC-1 |", # noqa: E501 "description": "SRV_MDVPN CUSTOMER HEANET AP2 #HEANET-BGP-LU-CoC-1 |",
"circuits": [ "circuits": [
{ {
"id": 663160, "id": 663160,
...@@ -509,7 +504,7 @@ NREN_INTERFACES = [ ...@@ -509,7 +504,7 @@ NREN_INTERFACES = [
"xe-1/0/1", "xe-1/0/1",
"xe-1/1/0" "xe-1/1/0"
], ],
"description": "SRV_IAS CUSTOMER HEANET #HEANET-AP2-IAS IASPS | ASN1213 ", # noqa: E501 "description": "SRV_IAS CUSTOMER HEANET #HEANET-AP2-IAS IASPS | ASN1213 ",
"circuits": [ "circuits": [
{ {
"id": 663214, "id": 663214,
...@@ -547,7 +542,7 @@ NREN_INTERFACES = [ ...@@ -547,7 +542,7 @@ NREN_INTERFACES = [
"xe-1/0/1", "xe-1/0/1",
"xe-1/1/0" "xe-1/1/0"
], ],
"description": "SRV_L2CIRCUIT CUSTOMER HEANET GEANT #ams-dub2-HEANET-RARE-21061 |", # noqa: E501 "description": "SRV_L2CIRCUIT CUSTOMER HEANET GEANT #ams-dub2-HEANET-RARE-21061 |",
"circuits": [ "circuits": [
{ {
"id": 713335, "id": 713335,
...@@ -574,9 +569,7 @@ NREN_INTERFACES = [ ...@@ -574,9 +569,7 @@ NREN_INTERFACES = [
"ipv4": [], "ipv4": [],
"ipv6": [] "ipv6": []
}, },
{ {"router": "rt1.fra.de.geant.net",
"router": "rt1.fra.de.geant.net",
"name": "xe-11/2/5.300", "name": "xe-11/2/5.300",
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
...@@ -607,48 +600,48 @@ NREN_INTERFACES = [ ...@@ -607,48 +600,48 @@ NREN_INTERFACES = [
"port_type": "SERVICE", "port_type": "SERVICE",
"ipv4": [], "ipv4": [],
"ipv6": [] "ipv6": []
} }
] ]
EUMETSAT_MULTICAST = [ EUMETSAT_MULTICAST = [
{ {
'router': 'mx1.ams.nl.geant.net', 'router': 'mx1.ams.nl.geant.net',
'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255', # noqa: E501 'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255',
'community': '0pBiFbD', 'community': '0pBiFbD',
'subscription': '232.223.222.1', 'subscription': '232.223.222.1',
'endpoint': '193.17.9.3' 'endpoint': '193.17.9.3'
}, },
{ {
'router': 'mx1.ams.nl.geant.net', 'router': 'mx1.ams.nl.geant.net',
'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255', # noqa: E501 'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255',
'community': '0pBiFbD', 'community': '0pBiFbD',
'subscription': '232.223.222.2', 'subscription': '232.223.222.2',
'endpoint': '193.17.9.3' 'endpoint': '193.17.9.3'
}, },
{ {
'router': 'mx1.lon.uk.geant.net', 'router': 'mx1.lon.uk.geant.net',
'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255', # noqa: E501 'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255',
'community': '0pBiFbD', 'community': '0pBiFbD',
'subscription': '232.223.222.1', 'subscription': '232.223.222.1',
'endpoint': '193.17.9.3' 'endpoint': '193.17.9.3'
}, },
{ {
'router': 'mx1.lon.uk.geant.net', 'router': 'mx1.lon.uk.geant.net',
'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255', # noqa: E501 'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255',
'community': '0pBiFbD', 'community': '0pBiFbD',
'subscription': '232.223.222.2', 'subscription': '232.223.222.2',
'endpoint': '193.17.9.3' 'endpoint': '193.17.9.3'
}, },
{ {
'router': 'mx1.fra.de.geant.net', 'router': 'mx1.fra.de.geant.net',
'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255', # noqa: E501 'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255',
'community': '0pBiFbD', 'community': '0pBiFbD',
'subscription': '232.223.222.1', 'subscription': '232.223.222.1',
'endpoint': '193.17.9.3' 'endpoint': '193.17.9.3'
}, },
{ {
'router': 'mx1.fra.de.geant.net', 'router': 'mx1.fra.de.geant.net',
'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255', # noqa: E501 'oid': '1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255',
'community': '0pBiFbD', 'community': '0pBiFbD',
'subscription': '232.223.222.2', 'subscription': '232.223.222.2',
'endpoint': '193.17.9.3' 'endpoint': '193.17.9.3'
...@@ -730,14 +723,14 @@ def populate_inventory(get_test_data, data_config): ...@@ -730,14 +723,14 @@ def populate_inventory(get_test_data, data_config):
("NREN Access", [], {'ASNET-AM', 'CESNET', 'GEANT', 'KIAE', 'LITNET', 'SWITCH'}), ("NREN Access", [], {'ASNET-AM', 'CESNET', 'GEANT', 'KIAE', 'LITNET', 'SWITCH'}),
("NREN Access", ["GEANT", "KIAE"], {'ASNET-AM', 'CESNET', 'LITNET', 'SWITCH'}), ("NREN Access", ["GEANT", "KIAE"], {'ASNET-AM', 'CESNET', 'LITNET', 'SWITCH'}),
( (
"NREN Access", "NREN Access",
[], [],
{'ASNET-AM', "LITNET", "CESNET", "GEANT", "KIAE", "SWITCH"}, {'ASNET-AM', "LITNET", "CESNET", "GEANT", "KIAE", "SWITCH"},
), ),
( (
"NREN Access", "NREN Access",
["GEANT"], ["GEANT"],
{'ASNET-AM', "LITNET", "CESNET", "KIAE", "SWITCH"}, {'ASNET-AM', "LITNET", "CESNET", "KIAE", "SWITCH"},
), ),
("testfolder", ["GEANT"], {"KIAE", "SWITCH"}), ("testfolder", ["GEANT"], {"KIAE", "SWITCH"}),
], ],
...@@ -853,7 +846,7 @@ def test_provision_re_peer_dashboard( ...@@ -853,7 +846,7 @@ def test_provision_re_peer_dashboard(
{ {
"router": "mx1.dub2.ie.geant.net", "router": "mx1.dub2.ie.geant.net",
"name": "xe-0/0/0.1", "name": "xe-0/0/0.1",
"description": "PHY SVC P_AE10 SRF9948758 | HEANET-AP2-LL3", # noqa: E501 "description": "PHY SVC P_AE10 SRF9948758 | HEANET-AP2-LL3",
"dashboards": ["RE_PEER"], "dashboards": ["RE_PEER"],
"dashboard_info": {"name": "ESNET", "interface_type": "LOGICAL"}, "dashboard_info": {"name": "ESNET", "interface_type": "LOGICAL"},
"dashboards_info": [{"name": "ESNET", "interface_type": "LOGICAL"}], "dashboards_info": [{"name": "ESNET", "interface_type": "LOGICAL"}],
...@@ -905,64 +898,50 @@ def test_vlan_interfaces(mocker, data_config, mock_grafana, reporting_provider, ...@@ -905,64 +898,50 @@ def test_vlan_interfaces(mocker, data_config, mock_grafana, reporting_provider,
'dashboard_info': {'interface_type': 'AGGREGATE', 'name': 'REDIRIS'}, 'dashboards': ['NREN', 'RE_CUST'], 'dashboard_info': {'interface_type': 'AGGREGATE', 'name': 'REDIRIS'}, 'dashboards': ['NREN', 'RE_CUST'],
'dashboards_info': [{'interface_type': 'AGGREGATE', 'name': 'REDIRIS'}], 'dashboards_info': [{'interface_type': 'AGGREGATE', 'name': 'REDIRIS'}],
'description': 'LAG CUSTOMER REDIRIS SRF21114 $GA-01800 |', 'ipv4': [], 'ipv6': [], 'name': 'ae16', 'description': 'LAG CUSTOMER REDIRIS SRF21114 $GA-01800 |', 'ipv4': [], 'ipv6': [], 'name': 'ae16',
'port_type': 'ACCESS', 'router': 'mx1.mad.es.geant.net', 'snmp-index': 654, 'vlan_type': 'TRUNK'}, 'port_type': 'ACCESS', 'router': 'mx1.mad.es.geant.net', 'snmp-index': 654, 'vlan_type': 'TRUNK'}, {'bundle': [], 'bundle-parents': ['et-4/0/0', 'et-5/0/5', 'et-8/1/2', 'et-8/1/5'], 'circuits': [
{'id': 739804, 'name': 'UC3M-REDIRIS-BELNET-SLICES-IMEC', 'status': 'non-monitored', 'type': 'GEANT PLUS'}],
{'bundle': [], 'bundle-parents': ['et-4/0/0', 'et-5/0/5', 'et-8/1/2', 'et-8/1/5'], 'circuits': [ 'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'REDIRIS'},
{'id': 739804, 'name': 'UC3M-REDIRIS-BELNET-SLICES-IMEC', 'status': 'non-monitored', 'type': 'GEANT PLUS'}], 'dashboards': ["VLAN Interfaces"],
'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'REDIRIS'}, 'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'REDIRIS'},
'dashboards': ["VLAN Interfaces"], {'interface_type': 'LOGICAL', 'name': 'BELNET'}],
'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'REDIRIS'}, 'description': 'SRV_L2CIRCUIT CUSTOMER REDIRIS BELNET #UC3M-RedIRIS-BELNET-SLICES-IMEC $GS-02514 |',
{'interface_type': 'LOGICAL', 'name': 'BELNET'}], 'ipv4': [], 'ipv6': [], 'name': 'ae16.975', 'port_type': 'SERVICE', 'router': 'mx1.mad.es.geant.net',
'description': 'SRV_L2CIRCUIT CUSTOMER REDIRIS BELNET #UC3M-RedIRIS-BELNET-SLICES-IMEC $GS-02514 |', 'snmp-index': 818, 'vlan_type': 'VLAN'}, {'bundle': [], 'bundle-parents': ['et-4/0/0', 'et-5/0/5', 'et-8/1/2', 'et-8/1/5'], 'circuits': [
'ipv4': [], 'ipv6': [], 'name': 'ae16.975', 'port_type': 'SERVICE', 'router': 'mx1.mad.es.geant.net', {'id': 732759, 'name': 'FRA-MAD-RARE-REDIRIS-23017-VL201', 'status': 'non-monitored',
'snmp-index': 818, 'vlan_type': 'VLAN'}, 'type': 'GEANT PLUS'}], 'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'RARE'},
'dashboards': ['L2_CIRCUIT'], 'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'RARE'},
{'bundle': [], 'bundle-parents': ['et-4/0/0', 'et-5/0/5', 'et-8/1/2', 'et-8/1/5'], 'circuits': [ {'interface_type': 'LOGICAL', 'name': 'REDIRIS'}],
{'id': 732759, 'name': 'FRA-MAD-RARE-REDIRIS-23017-VL201', 'status': 'non-monitored', 'description': 'SRV_L2CIRCUIT CUSTOMER RARE REDIRIS #fra-mad-RARE-REDIRIS-23017-VL201 $GS-02274', 'ipv4': [],
'type': 'GEANT PLUS'}], 'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'RARE'}, 'ipv6': [], 'name': 'ae16.201', 'port_type': 'SERVICE', 'router': 'mx1.mad.es.geant.net', 'snmp-index': 642,
'dashboards': ['L2_CIRCUIT'], 'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'RARE'}, 'vlan_type': 'VLAN'}, {'bundle': [], 'bundle-parents': [], 'circuits': [
{'interface_type': 'LOGICAL', 'name': 'REDIRIS'}], {'id': 729417, 'name': 'PAR-LON2-SUPERPOP-QFX-2-GEANT', 'status': 'operational', 'type': 'GEANT - GBS'}],
'description': 'SRV_L2CIRCUIT CUSTOMER RARE REDIRIS #fra-mad-RARE-REDIRIS-23017-VL201 $GS-02274', 'ipv4': [], 'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'GEANT-IT'}, 'dashboards': ['GBS_10G'],
'ipv6': [], 'name': 'ae16.201', 'port_type': 'SERVICE', 'router': 'mx1.mad.es.geant.net', 'snmp-index': 642, 'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'GEANT-IT'}],
'vlan_type': 'VLAN'}, 'description': 'SRV_10GGBS CUSTOMER GEANT-IT #par-lon2-SUPERPOP-QFX-2-GEANT $GS-00081 |', 'ipv4': [],
'ipv6': [], 'name': 'xe-2/2/7.0', 'port_type': 'SERVICE', 'router': 'mx1.lon2.uk.geant.net', 'snmp-index': 613,
{'bundle': [], 'bundle-parents': [], 'circuits': [ 'vlan_type': 'VLAN'}, {'bundle': ['xe-0/1/0', 'xe-0/1/1'], 'bundle-parents': ['xe-0/1/0', 'xe-0/1/1'], 'circuits': [],
{'id': 729417, 'name': 'PAR-LON2-SUPERPOP-QFX-2-GEANT', 'status': 'operational', 'type': 'GEANT - GBS'}], 'dashboard_info': {'interface_type': 'AGGREGATE', 'name': 'LITNET'}, 'dashboards': ['NREN', 'RE_CUST'],
'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'GEANT-IT'}, 'dashboards': ['GBS_10G'], 'dashboards_info': [{'interface_type': 'AGGREGATE', 'name': 'LITNET'}],
'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'GEANT-IT'}], 'description': 'LAG CUSTOMER LITNET AP2 #LITNET-AP2-LAG $GA-02071 |', 'ipv4': [], 'ipv6': [], 'name': 'ae10',
'description': 'SRV_10GGBS CUSTOMER GEANT-IT #par-lon2-SUPERPOP-QFX-2-GEANT $GS-00081 |', 'ipv4': [], 'port_type': 'ACCESS', 'router': 'art1.kau.lt.geant.net', 'snmp-index': 588, 'vlan_type': 'TRUNK'}, {'bundle': [], 'bundle-parents': ['et-0/0/2'], 'circuits': [
'ipv6': [], 'name': 'xe-2/2/7.0', 'port_type': 'SERVICE', 'router': 'mx1.lon2.uk.geant.net', 'snmp-index': 613, {'id': 679356, 'name': 'LAT-AP1-IPV6', 'status': 'operational', 'type': 'GEANT IP'}],
'vlan_type': 'VLAN'}, 'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'LAT'},
'dashboards': ['NREN', 'RE_CUST'],
{'bundle': ['xe-0/1/0', 'xe-0/1/1'], 'bundle-parents': ['xe-0/1/0', 'xe-0/1/1'], 'circuits': [], 'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'LAT'}],
'dashboard_info': {'interface_type': 'AGGREGATE', 'name': 'LITNET'}, 'dashboards': ['NREN', 'RE_CUST'], 'description': 'SRV_GLOBAL CUSTOMER LAT #LAT-AP1 $GS-00484 | ASN5538',
'dashboards_info': [{'interface_type': 'AGGREGATE', 'name': 'LITNET'}], 'ipv4': ['62.40.124.237/30'], 'ipv6': ['2001:798:99:1::51/126'], 'name': 'ae10.83',
'description': 'LAG CUSTOMER LITNET AP2 #LITNET-AP2-LAG $GA-02071 |', 'ipv4': [], 'ipv6': [], 'name': 'ae10', 'port_type': 'SERVICE', 'router': 'art1.kau.lt.geant.net', 'snmp-index': 604,
'port_type': 'ACCESS', 'router': 'art1.kau.lt.geant.net', 'snmp-index': 588, 'vlan_type': 'TRUNK'}, 'vlan_type': 'VLAN'}, {'bundle': [], 'bundle-parents': ['et-2/1/2', 'et-2/1/5', 'et-11/1/0'], 'circuits': [
{'id': 707643, 'name': 'GARR-UDMILANO_EXPRESSROUTE_VLAN4086', 'status': 'operational',
{'bundle': [], 'bundle-parents': ['et-0/0/2'], 'circuits': [ 'type': 'EXPRESS ROUTE'}], 'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'GARR'},
{'id': 679356, 'name': 'LAT-AP1-IPV6', 'status': 'operational', 'type': 'GEANT IP'}], 'dashboards': ['GCS'], 'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'GARR'}],
'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'LAT'}, 'description': 'SRV_GCS CUSTOMER GARR MICROSOFT #GARR-UDMilano_ExpressRoute_Vlan4086 $GS-01148 | UNIT CONFIGURATION HAS BEEN SYSTEM GENERATED',
'dashboards': ['NREN', 'RE_CUST'], 'ipv4': [], 'ipv6': [], 'name': 'ae10.4086', 'port_type': 'SERVICE', 'router': 'art1.kau.lt.geant.net',
'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'LAT'}], 'snmp-index': 795, 'vlan_type': 'VLAN'}, {'bundle': [], 'bundle-parents': [], 'circuits': [],
'description': 'SRV_GLOBAL CUSTOMER LAT #LAT-AP1 $GS-00484 | ASN5538', 'dashboard_info': {'interface_type': 'PHYSICAL', 'name': 'BUD-ZAG'}, 'dashboards': ['INFRASTRUCTURE_BACKBONE'],
'ipv4': ['62.40.124.237/30'], 'ipv6': ['2001:798:99:1::51/126'], 'name': 'ae10.83', 'dashboards_info': [{'interface_type': 'PHYSICAL', 'name': 'BUD-ZAG'}],
'port_type': 'SERVICE', 'router': 'art1.kau.lt.geant.net', 'snmp-index': 604, 'description': 'PHY INFRASTRUCTURE BACKBONE P_ae5 | BUD-ZAG', 'ipv4': [], 'ipv6': [], 'name': 'et-7/0/2',
'vlan_type': 'VLAN'}, 'port_type': 'UNKNOWN', 'router': 'mx1.bud.hu.geant.net', 'snmp-index': 1133, 'vlan_type': 'ACCESS'},
{'bundle': [], 'bundle-parents': ['et-2/1/2', 'et-2/1/5', 'et-11/1/0'], 'circuits': [
{'id': 707643, 'name': 'GARR-UDMILANO_EXPRESSROUTE_VLAN4086', 'status': 'operational',
'type': 'EXPRESS ROUTE'}], 'dashboard_info': {'interface_type': 'LOGICAL', 'name': 'GARR'},
'dashboards': ['GCS'], 'dashboards_info': [{'interface_type': 'LOGICAL', 'name': 'GARR'}],
'description': 'SRV_GCS CUSTOMER GARR MICROSOFT #GARR-UDMilano_ExpressRoute_Vlan4086 $GS-01148 | UNIT CONFIGURATION HAS BEEN SYSTEM GENERATED',
'ipv4': [], 'ipv6': [], 'name': 'ae10.4086', 'port_type': 'SERVICE', 'router': 'art1.kau.lt.geant.net',
'snmp-index': 795, 'vlan_type': 'VLAN'},
{'bundle': [], 'bundle-parents': [], 'circuits': [],
'dashboard_info': {'interface_type': 'PHYSICAL', 'name': 'BUD-ZAG'}, 'dashboards': ['INFRASTRUCTURE_BACKBONE'],
'dashboards_info': [{'interface_type': 'PHYSICAL', 'name': 'BUD-ZAG'}],
'description': 'PHY INFRASTRUCTURE BACKBONE P_ae5 | BUD-ZAG', 'ipv4': [], 'ipv6': [], 'name': 'et-7/0/2',
'port_type': 'UNKNOWN', 'router': 'mx1.bud.hu.geant.net', 'snmp-index': 1133, 'vlan_type': 'ACCESS'},
] ]
populate_inventory( populate_inventory(
...@@ -983,33 +962,27 @@ def test_vlan_interfaces(mocker, data_config, mock_grafana, reporting_provider, ...@@ -983,33 +962,27 @@ def test_vlan_interfaces(mocker, data_config, mock_grafana, reporting_provider,
) )
_mocked_gws_indirect.return_value = [] _mocked_gws_indirect.return_value = []
# _mocked_vlan_data = mocker.patch(
# "brian_dashboard_manager.grafana.provision.get_router_dashboard_data"
# )
# _mocked_vlan_data.return_value = []
#
# _mocked_dashboard_data_dropdown = mocker.patch(
# "brian_dashboard_manager.grafana.provision.get_dashboard_data_dropdown"
# )
# _mocked_dashboard_data_dropdown.return_value = []
data_config["organizations"] = [ data_config["organizations"] = [
{"name": "Testorg1", "excluded_nrens": ["GEANT"], "excluded_dashboards": []}, {"name": "Testorg1", "excluded_nrens": ["GEANT"], "excluded_dashboards": []},
] ]
provision(data_config) provision(data_config)
folder_uid = "VLAN_Interfaces" folder_uid = "VLAN_Interfaces"
# assert len(mock_grafana.folders[folder_uid]) == 1
result = mock_grafana.dashboards_by_folder_uid[folder_uid] result = mock_grafana.dashboards_by_folder_uid[folder_uid]
assert len(result) == 3 assert len(result) == 3
# assert result[0]["title"] == "art1.kau.lt.geant.net"
assert result[0]["tags"][0] == "vlandash" assert result[0]["tags"][0] == "vlandash"
panels = mock_grafana.dashboards_by_folder_uid[folder_uid][0]["panels"] dashboards = mock_grafana.dashboards_by_folder_uid[folder_uid]
expected_types = ["text", "row"] panels = []
for dashboard in dashboards:
panels.extend(dashboard["panels"])
expected_types = ["text", "row", "text", "row", "text", "row"]
assert [p["type"] for p in panels] == expected_types assert [p["type"] for p in panels] == expected_types
assert "INFO" in panels[0]["options"]["content"] assert "INFO" in panels[0]["options"]["content"]
# assert "ae10" in panels[1]["title"] assert "ae10" in set(p['title'] for p in panels)
# assert len(panels[1]["panels"]) == 3
panel_ae10 = [p for p in panels if p['title'] == 'ae10'][0]
assert len(panel_ae10["panels"]) == 3
@responses.activate @responses.activate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment