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
a1e5999a
Commit
a1e5999a
authored
2 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
added status /msr/ip-services and extra tests
parent
2dd96523
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/msr.py
+3
-1
3 additions, 1 deletion
inventory_provider/routes/msr.py
test/test_msr_routes.py
+14
-0
14 additions, 0 deletions
test/test_msr_routes.py
with
17 additions
and
1 deletion
inventory_provider/routes/msr.py
+
3
−
1
View file @
a1e5999a
...
@@ -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
'
]
...
...
This diff is collapsed.
Click to expand it.
test/test_msr_routes.py
+
14
−
0
View file @
a1e5999a
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
)
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