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

added status /msr/ip-services and extra tests

parent 2dd96523
No related branches found
No related tags found
No related merge requests found
...@@ -388,6 +388,7 @@ IP_SERVICES_LIST_SCHEMA = { ...@@ -388,6 +388,7 @@ IP_SERVICES_LIST_SCHEMA = {
'name': {'type': 'string'}, 'name': {'type': 'string'},
'customer': {'type': 'string'}, 'customer': {'type': 'string'},
'type': {'type': 'string'}, 'type': {'type': 'string'},
'status': {'type': 'string'},
'pop': { 'pop': {
'type': 'object', 'type': 'object',
'properties': { 'properties': {
...@@ -398,7 +399,7 @@ IP_SERVICES_LIST_SCHEMA = { ...@@ -398,7 +399,7 @@ IP_SERVICES_LIST_SCHEMA = {
'additionalProperties': False 'additionalProperties': False
} }
}, },
'required': ['name', 'customer', 'type', 'pop'], 'required': ['name', 'customer', 'type', 'pop', 'status'],
'additionalProperties': False 'additionalProperties': False
}, },
'interface-address': { 'interface-address': {
...@@ -1508,6 +1509,7 @@ def _load_ip_services(): ...@@ -1508,6 +1509,7 @@ def _load_ip_services():
'name': _s['name'], 'name': _s['name'],
'customer': _s['customer'], 'customer': _s['customer'],
'type': _s['service_type'], 'type': _s['service_type'],
'status': _s['status'],
'pop': { 'pop': {
'name': _s['pop_name'], 'name': _s['pop_name'],
'abbrev': _s['pop_abbreviation'] 'abbrev': _s['pop_abbreviation']
......
import ipaddress
import json import json
import jsonschema import jsonschema
...@@ -418,3 +419,16 @@ def test_ip_services(client): ...@@ -418,3 +419,16 @@ def test_ip_services(client):
# sanity that there are some non-trivial elements in test data # sanity that there are some non-trivial elements in test data
assert any(len(_x['peerings']) > 0 for _x in response_data) assert any(len(_x['peerings']) > 0 for _x in response_data)
assert any(len(_x['services']) > 0 for _x in response_data) assert any(len(_x['services']) > 0 for _x in response_data)
# sanity confirmation that peerings are with the correct host
for _s in response_data:
net = ipaddress.ip_interface(_s['address']).network
for _p in _s['peerings']:
assert ipaddress.ip_address(_p['address']) in net
# sanity confirmation that no interface addresses are duplicated
ifc_keys = set()
for _s in response_data:
key = f'{_s["hostname"]}:{_s["port"]}:{_s["address"]}'
assert key not in ifc_keys
ifc_keys.add(key)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment