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
5fddea40
Commit
5fddea40
authored
4 months ago
by
Neda Moeini
Browse files
Options
Downloads
Patches
Plain Diff
Add unit test for modify L2Circuits WF
parent
1c7eeff2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!307
Feature/l2circuits
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/workflows/l2_circuit/test_modify_layer_2_circuit.py
+73
-0
73 additions, 0 deletions
test/workflows/l2_circuit/test_modify_layer_2_circuit.py
with
73 additions
and
0 deletions
test/workflows/l2_circuit/test_modify_layer_2_circuit.py
0 → 100644
+
73
−
0
View file @
5fddea40
import
pytest
from
orchestrator.types
import
SubscriptionLifecycle
from
gso.products
import
ProductName
from
gso.products.product_blocks.layer_2_circuit
import
Layer2CircuitType
from
gso.products.product_types.layer_2_circuit
import
Layer2Circuit
from
test.workflows
import
assert_complete
,
extract_state
,
run_workflow
@pytest.mark.parametrize
(
"
layer_2_circuit_service_type
"
,
[
ProductName
.
GEANT_PLUS
,
ProductName
.
EXPRESSROUTE
])
@pytest.mark.workflow
()
def
test_modify_layer_2_circuit_change_policer_bandwidth
(
layer_2_circuit_service_type
,
layer_2_circuit_subscription_factory
,
faker
,
partner_factory
,
data_config_filename
,
):
subscription_id
=
layer_2_circuit_subscription_factory
(
layer_2_circuit_service_type
=
layer_2_circuit_service_type
)
subscription
=
Layer2Circuit
.
from_subscription
(
subscription_id
)
input_form_data
=
[
{
"
subscription_id
"
:
subscription_id
},
{
"
tt_number
"
:
faker
.
tt_number
(),
"
layer_2_circuit_type
"
:
Layer2CircuitType
.
TAGGED
,
"
policer_enabled
"
:
False
,
},
{
"
vlan_range_lower_bound
"
:
subscription
.
layer_2_circuit
.
vlan_range_lower_bound
,
"
vlan_range_upper_bound
"
:
subscription
.
layer_2_circuit
.
vlan_range_upper_bound
,
"
policer_bandwidth
"
:
None
,
}
]
result
,
_
,
_
=
run_workflow
(
"
modify_layer_2_circuit
"
,
input_form_data
)
assert_complete
(
result
)
assert
subscription
.
status
==
SubscriptionLifecycle
.
ACTIVE
assert
subscription
.
layer_2_circuit
.
policer_enabled
is
False
assert
subscription
.
layer_2_circuit
.
bandwidth
is
None
@pytest.mark.parametrize
(
"
layer_2_circuit_service_type
"
,
[
ProductName
.
GEANT_PLUS
,
ProductName
.
EXPRESSROUTE
])
@pytest.mark.workflow
()
def
test_modify_layer_2_circuit_change_circuit_type
(
layer_2_circuit_service_type
,
layer_2_circuit_subscription_factory
,
faker
,
partner_factory
,
data_config_filename
,
):
subscription_id
=
layer_2_circuit_subscription_factory
(
layer_2_circuit_service_type
=
layer_2_circuit_service_type
)
subscription
=
Layer2Circuit
.
from_subscription
(
subscription_id
)
input_form_data
=
[
{
"
subscription_id
"
:
subscription_id
},
{
"
tt_number
"
:
faker
.
tt_number
(),
"
layer_2_circuit_type
"
:
Layer2CircuitType
.
UNTAGGED
,
},
{
"
vlan_range_lower_bound
"
:
None
,
"
vlan_range_upper_bound
"
:
None
,
"
policer_bandwidth
"
:
subscription
.
layer_2_circuit
.
bandwidth
,
}
]
result
,
_
,
_
=
run_workflow
(
"
modify_layer_2_circuit
"
,
input_form_data
)
assert_complete
(
result
)
state
=
extract_state
(
result
)
subscription
=
Layer2Circuit
.
from_subscription
(
state
[
"
subscription_id
"
])
assert
subscription
.
status
==
SubscriptionLifecycle
.
ACTIVE
assert
subscription
.
layer_2_circuit
.
vlan_range_lower_bound
is
None
assert
subscription
.
layer_2_circuit
.
vlan_range_upper_bound
is
None
assert
subscription
.
layer_2_circuit
.
layer_2_circuit_type
==
Layer2CircuitType
.
UNTAGGED
for
layer_2_circuit_side
in
subscription
.
layer_2_circuit
.
layer_2_circuit_sides
:
assert
layer_2_circuit_side
.
sbp
.
is_tagged
is
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