Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
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
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
a7a74241
Commit
a7a74241
authored
1 year ago
by
Hakan Calim
Committed by
Neda Moeini
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
NAT-329
: added juniper router factory
parent
0d035f24
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!122
Feature/nat 329 interface names should validated 3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/fixtures.py
+50
-0
50 additions, 0 deletions
test/fixtures.py
with
50 additions
and
0 deletions
test/fixtures.py
+
50
−
0
View file @
a7a74241
...
...
@@ -124,6 +124,56 @@ def nokia_router_subscription_factory(site_subscription_factory, faker):
return
subscription_create
@pytest.fixture
()
def
juniper_router_subscription_factory
(
site_subscription_factory
,
faker
):
def
subscription_create
(
description
=
None
,
start_date
=
"
2023-05-24T00:00:00+00:00
"
,
router_fqdn
=
None
,
router_ts_port
=
None
,
router_access_via_ts
=
None
,
router_lo_ipv4_address
=
None
,
router_lo_ipv6_address
=
None
,
router_lo_iso_address
=
None
,
router_role
=
RouterRole
.
PE
,
router_site
=
None
,
status
:
SubscriptionLifecycle
|
None
=
None
,
)
->
UUIDstr
:
description
=
description
or
faker
.
text
(
max_nb_chars
=
30
)
router_fqdn
=
router_fqdn
or
faker
.
domain_name
(
levels
=
4
)
router_ts_port
=
router_ts_port
or
faker
.
random_int
(
min
=
1
,
max
=
49151
)
router_access_via_ts
=
router_access_via_ts
or
faker
.
boolean
()
router_lo_ipv4_address
=
router_lo_ipv4_address
or
ipaddress
.
IPv4Address
(
faker
.
ipv4
())
router_lo_ipv6_address
=
router_lo_ipv6_address
or
ipaddress
.
IPv6Address
(
faker
.
ipv6
())
router_lo_iso_address
=
router_lo_iso_address
or
faker
.
word
()
router_site
=
router_site
or
site_subscription_factory
()
product_id
=
subscriptions
.
get_product_id_by_name
(
ProductType
.
JUNIPER_ROUTER
)
router_subscription
=
RouterInactive
.
from_product_id
(
product_id
,
customer_id
=
CUSTOMER_ID
,
insync
=
True
)
router_subscription
.
router
.
router_fqdn
=
router_fqdn
router_subscription
.
router
.
router_ts_port
=
router_ts_port
router_subscription
.
router
.
router_access_via_ts
=
router_access_via_ts
router_subscription
.
router
.
router_lo_ipv4_address
=
router_lo_ipv4_address
router_subscription
.
router
.
router_lo_ipv6_address
=
router_lo_ipv6_address
router_subscription
.
router
.
router_lo_iso_address
=
router_lo_iso_address
router_subscription
.
router
.
router_role
=
router_role
router_subscription
.
router
.
router_site
=
Site
.
from_subscription
(
router_site
).
site
router_subscription
=
SubscriptionModel
.
from_other_lifecycle
(
router_subscription
,
SubscriptionLifecycle
.
ACTIVE
)
router_subscription
.
description
=
description
router_subscription
.
start_date
=
start_date
if
status
:
router_subscription
.
status
=
status
router_subscription
.
save
()
db
.
session
.
commit
()
return
str
(
router_subscription
.
subscription_id
)
return
subscription_create
@pytest.fixture
()
def
iptrunk_side_subscription_factory
(
nokia_router_subscription_factory
,
faker
):
def
subscription_create
(
...
...
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