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
e3cc3644
Verified
Commit
e3cc3644
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
add TT number and commit comment to TWAMP workflow
parent
4817665e
No related branches found
No related tags found
1 merge request
!129
Add workflow for TWAMP deployment
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/workflows/iptrunk/deploy_twamp.py
+8
-5
8 additions, 5 deletions
gso/workflows/iptrunk/deploy_twamp.py
test/workflows/iptrunk/test_deploy_twamp.py
+1
-1
1 addition, 1 deletion
test/workflows/iptrunk/test_deploy_twamp.py
with
9 additions
and
6 deletions
gso/workflows/iptrunk/deploy_twamp.py
+
8
−
5
View file @
e3cc3644
"""
"
Workflow for adding TWAMP to an existing IP trunk.
"""
"""
Workflow for adding TWAMP to an existing IP trunk.
"""
from
orchestrator.forms
import
FormPage
from
orchestrator.forms.validators
import
Label
...
...
@@ -21,19 +21,21 @@ def _initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
f
"
{
trunk
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
.
router_fqdn
}
to
"
f
"
{
trunk
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
"
# type: ignore[assignment]
)
tt_number
:
str
yield
DeployTWAMPForm
user_input
=
yield
DeployTWAMPForm
return
{
"
subscription
"
:
trunk
}
return
user_input
.
dict
()
@step
(
"
[DRY RUN] Deploy TWAMP on both sides
"
)
def
deploy_twamp_dry
(
subscription
:
Iptrunk
,
process_id
:
UUIDstr
,
callback_route
:
str
)
->
State
:
def
deploy_twamp_dry
(
subscription
:
Iptrunk
,
process_id
:
UUIDstr
,
callback_route
:
str
,
tt_number
:
str
)
->
State
:
"""
Perform a dry run of deploying the TWAMP session.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
process_id
"
:
process_id
,
"
dry_run
"
:
True
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Deploy TWAMP
"
,
}
inventory
=
(
...
...
@@ -47,12 +49,13 @@ def deploy_twamp_dry(subscription: Iptrunk, process_id: UUIDstr, callback_route:
@step
(
"
[FOR REAL] Deploy TWAMP on both sides
"
)
def
deploy_twamp_real
(
subscription
:
Iptrunk
,
process_id
:
UUIDstr
,
callback_route
:
str
)
->
State
:
def
deploy_twamp_real
(
subscription
:
Iptrunk
,
process_id
:
UUIDstr
,
callback_route
:
str
,
tt_number
:
str
)
->
State
:
"""
Deploy the TWAMP session.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
process_id
"
:
process_id
,
"
dry_run
"
:
False
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Deploy TWAMP
"
,
}
inventory
=
(
...
...
This diff is collapsed.
Click to expand it.
test/workflows/iptrunk/test_deploy_twamp.py
+
1
−
1
View file @
e3cc3644
...
...
@@ -22,7 +22,7 @@ def test_iptrunk_deploy_twamp_success(
product_id
=
iptrunk_subscription_factory
()
# Run workflow
initial_input_data
=
[{
"
subscription_id
"
:
product_id
},
{}]
initial_input_data
=
[{
"
subscription_id
"
:
product_id
},
{
"
tt_number
"
:
faker
.
tt_number
()
}]
result
,
process_stat
,
step_log
=
run_workflow
(
"
deploy_twamp
"
,
initial_input_data
)
for
_
in
range
(
2
):
...
...
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