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
3771f48d
Commit
3771f48d
authored
4 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
refactored a bit
in the end wasn't necessary, and there was no net change
parent
ce70a02b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_worker_utils.py
+54
-46
54 additions, 46 deletions
test/test_worker_utils.py
with
54 additions
and
46 deletions
test/test_worker_utils.py
+
54
−
46
View file @
3771f48d
...
...
@@ -91,55 +91,61 @@ def test_build_juniper_peering_db(mocked_worker_module):
# same as inventory_provider.juniper.PEERING_LIST_SCHEMA,
# but with "hostname" in every returned record
LOGICAL_SYSTEM_PEERING_SCHEMA
=
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
logical-system
"
:
{
"
type
"
:
"
string
"
},
"
group
"
:
{
"
type
"
:
"
string
"
},
"
description
"
:
{
"
type
"
:
"
string
"
},
"
address
"
:
{
"
type
"
:
"
string
"
},
"
remote-asn
"
:
{
"
type
"
:
"
integer
"
},
"
local-asn
"
:
{
"
type
"
:
"
integer
"
},
"
hostname
"
:
{
"
type
"
:
"
string
"
}
},
# local/remote-asn and/or description are not always present,
# just based on empirical tests - not a problem
"
required
"
:
[
"
logical-system
"
,
"
group
"
,
"
address
"
],
"
additionalProperties
"
:
False
}
TOP_LEVEL_PEERING_SCHEMA
=
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
group
"
:
{
"
type
"
:
"
string
"
},
"
description
"
:
{
"
type
"
:
"
string
"
},
"
address
"
:
{
"
type
"
:
"
string
"
},
"
remote-asn
"
:
{
"
type
"
:
"
integer
"
},
"
local-asn
"
:
{
"
type
"
:
"
integer
"
},
"
hostname
"
:
{
"
type
"
:
"
string
"
}
},
# lots of internal peerings - so maybe no explicit asn's
"
required
"
:
[
"
group
"
,
"
address
"
],
"
additionalProperties
"
:
False
}
INSTANCE_PEERING
=
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
instance
"
:
{
"
type
"
:
"
string
"
},
"
group
"
:
{
"
type
"
:
"
string
"
},
"
description
"
:
{
"
type
"
:
"
string
"
},
"
address
"
:
{
"
type
"
:
"
string
"
},
"
remote-asn
"
:
{
"
type
"
:
"
integer
"
},
"
local-asn
"
:
{
"
type
"
:
"
integer
"
},
"
hostname
"
:
{
"
type
"
:
"
string
"
}
},
# description and-or local-asn is not always present,
# just based on empirical tests - not a problem
"
required
"
:
[
"
instance
"
,
"
group
"
,
"
address
"
,
"
remote-asn
"
],
"
additionalProperties
"
:
False
}
PEERING_LIST_SCHEMA
=
{
"
$schema
"
:
"
http://json-schema.org/draft-07/schema#
"
,
"
definitions
"
:
{
"
top-level-peering
"
:
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
group
"
:
{
"
type
"
:
"
string
"
},
"
description
"
:
{
"
type
"
:
"
string
"
},
"
address
"
:
{
"
type
"
:
"
string
"
},
"
remote-asn
"
:
{
"
type
"
:
"
integer
"
},
"
local-asn
"
:
{
"
type
"
:
"
integer
"
},
"
hostname
"
:
{
"
type
"
:
"
string
"
}
},
# lots of internal peerings - so maybe no explicit asn's
"
required
"
:
[
"
group
"
,
"
address
"
],
"
additionalProperties
"
:
False
},
"
instance-peering
"
:
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
instance
"
:
{
"
type
"
:
"
string
"
},
"
group
"
:
{
"
type
"
:
"
string
"
},
"
description
"
:
{
"
type
"
:
"
string
"
},
"
address
"
:
{
"
type
"
:
"
string
"
},
"
remote-asn
"
:
{
"
type
"
:
"
integer
"
},
"
local-asn
"
:
{
"
type
"
:
"
integer
"
},
"
hostname
"
:
{
"
type
"
:
"
string
"
}
},
# description and-or local-asn is not always present,
# just based on empirical tests - not a problem
"
required
"
:
[
"
instance
"
,
"
group
"
,
"
address
"
,
"
remote-asn
"
],
"
additionalProperties
"
:
False
},
"
logical-system-peering
"
:
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
logical-system
"
:
{
"
type
"
:
"
string
"
},
"
group
"
:
{
"
type
"
:
"
string
"
},
"
description
"
:
{
"
type
"
:
"
string
"
},
"
address
"
:
{
"
type
"
:
"
string
"
},
"
remote-asn
"
:
{
"
type
"
:
"
integer
"
},
"
local-asn
"
:
{
"
type
"
:
"
integer
"
},
"
hostname
"
:
{
"
type
"
:
"
string
"
}
},
# local/remote-asn and/or description are not always present,
# just based on empirical tests - not a problem
"
required
"
:
[
"
logical-system
"
,
"
group
"
,
"
address
"
],
"
additionalProperties
"
:
False
},
"
top-level-peering
"
:
TOP_LEVEL_PEERING_SCHEMA
,
"
instance-peering
"
:
INSTANCE_PEERING
,
"
logical-system-peering
"
:
LOGICAL_SYSTEM_PEERING_SCHEMA
,
"
peering
"
:
{
"
oneOf
"
:
[
{
"
$ref
"
:
"
#/definitions/top-level-peering
"
},
...
...
@@ -154,6 +160,8 @@ def test_build_juniper_peering_db(mocked_worker_module):
db
=
backend_db
()
# also forces initialization
# remove the juniper-peerings:* items that
# will be created by _build_juniper_peering_db
def
_x
(
k
):
if
not
k
.
startswith
(
'
juniper-peerings
'
):
return
False
...
...
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