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
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
85efbaf9
Commit
85efbaf9
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 for side b to test interface names
parent
37484fb4
No related branches found
Branches containing commit
No related tags found
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/workflows/iptrunk/test_create_iptrunk.py
+47
-9
47 additions, 9 deletions
test/workflows/iptrunk/test_create_iptrunk.py
with
47 additions
and
9 deletions
test/workflows/iptrunk/test_create_iptrunk.py
+
47
−
9
View file @
85efbaf9
...
...
@@ -5,6 +5,7 @@ import pytest
from
gso.products
import
Iptrunk
,
ProductType
from
gso.products.product_blocks.iptrunk
import
IptrunkType
,
PhyPortCapacity
from
gso.products.product_types.router
import
RouterVendor
from
gso.services.crm
import
customer_selector
,
get_customer_by_name
from
gso.services.subscriptions
import
get_product_id_by_name
from
gso.utils.helpers
import
LAGMember
...
...
@@ -42,9 +43,22 @@ def _netbox_client_mock():
@pytest.fixture
()
def
input_form_wizard_data
(
nokia_router_subscription_factory
,
faker
):
def
input_form_wizard_data
(
request
,
juniper_router_subscription_factory
,
nokia_router_subscription_factory
,
faker
):
vendor
=
getattr
(
request
,
"
param
"
,
RouterVendor
.
NOKIA
)
router_side_a
=
nokia_router_subscription_factory
()
router_side_b
=
nokia_router_subscription_factory
()
side_b_members
=
None
# Set side b router to Juniper
if
vendor
==
RouterVendor
.
JUNIPER
:
router_side_b
=
juniper_router_subscription_factory
()
side_b_members
=
[
"
et-1/0/1
"
,
"
xe-1/0/2
"
]
else
:
router_side_b
=
nokia_router_subscription_factory
()
side_b_members
=
[
LAGMember
(
interface_name
=
f
"
Interface
{
interface
}
"
,
interface_description
=
faker
.
sentence
())
for
interface
in
range
(
5
)]
create_ip_trunk_step
=
{
"
tt_number
"
:
faker
.
tt_number
(),
...
...
@@ -71,13 +85,7 @@ def input_form_wizard_data(nokia_router_subscription_factory, faker):
create_ip_trunk_side_b_step
=
{
"
side_b_ae_iface
"
:
"
LAG4
"
,
"
side_b_ae_geant_a_sid
"
:
faker
.
geant_sid
(),
"
side_b_ae_members
"
:
[
LAGMember
(
interface_name
=
f
"
Interface
{
interface
}
"
,
interface_description
=
faker
.
sentence
(),
)
for
interface
in
range
(
5
)
],
"
side_b_ae_members
"
:
side_b_members
,
}
return
[
...
...
@@ -157,3 +165,33 @@ def test_iptrunk_creation_fails_when_lso_return_code_is_one(
assert
mock_check_ip_trunk
.
call_count
==
0
assert
mock_provision_ip_trunk
.
call_count
==
2
@pytest.mark.parametrize
(
"
input_form_wizard_data
"
,
[
RouterVendor
.
JUNIPER
],
indirect
=
True
)
@pytest.mark.workflow
()
@patch
(
"
gso.workflows.iptrunk.create_iptrunk.provisioning_proxy.check_ip_trunk
"
)
@patch
(
"
gso.workflows.iptrunk.create_iptrunk.provisioning_proxy.provision_ip_trunk
"
)
@patch
(
"
gso.workflows.iptrunk.create_iptrunk.infoblox.allocate_v6_network
"
)
@patch
(
"
gso.workflows.iptrunk.create_iptrunk.infoblox.allocate_v4_network
"
)
def
test_successful_iptrunk_creation_with_juniper_interface_names
(
mock_allocate_v4_network
,
mock_allocate_v6_network
,
mock_provision_ip_trunk
,
mock_check_ip_trunk
,
responses
,
input_form_wizard_data
,
faker
,
data_config_filename
:
PathLike
,
_netbox_client_mock
,
# noqa: PT019
test_client
,
):
mock_allocate_v4_network
.
return_value
=
faker
.
ipv4_network
()
mock_allocate_v6_network
.
return_value
=
faker
.
ipv6_network
()
product_id
=
get_product_id_by_name
(
ProductType
.
IP_TRUNK
)
initial_site_data
=
[{
"
product
"
:
product_id
},
*
input_form_wizard_data
]
result
,
process_stat
,
step_log
=
run_workflow
(
"
create_iptrunk
"
,
initial_site_data
)
for
_
in
range
(
6
):
result
,
step_log
=
assert_pp_interaction_success
(
result
,
process_stat
,
step_log
)
assert_complete
(
result
)
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