Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
danet
goSDN
Commits
f1afcd49
Commit
f1afcd49
authored
1 year ago
by
Katharina Renk
Browse files
Options
Downloads
Patches
Plain Diff
added force-push func
parent
620d5808
No related branches found
No related tags found
2 merge requests
!784
Draft: Resolve "Integration test for Lab01"
,
!757
Draft: Resolve "Integration test for Lab01"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
integration-tests/lab_tests/lab01/lab01_test.go
+2
-13
2 additions, 13 deletions
integration-tests/lab_tests/lab01/lab01_test.go
integration-tests/lab_tests/utils/labUtils.go
+19
-0
19 additions, 0 deletions
integration-tests/lab_tests/utils/labUtils.go
with
21 additions
and
13 deletions
integration-tests/lab_tests/lab01/lab01_test.go
+
2
−
13
View file @
f1afcd49
...
...
@@ -170,16 +170,8 @@ func TestLab01(t *testing.T) {
t
.
Error
(
err
)
}
// Commit the change.
commitChange
:=
lab_utils
.
CommitOrConfirmChange
(
setResp
.
GetResponses
()[
0
]
.
GetId
(),
mnepb
.
Operation_OPERATION_COMMIT
,
pndID
)
_
,
err
=
mneService
.
SetChangeList
(
ctx
,
commitChange
)
if
err
!=
nil
{
t
.
Error
(
err
)
}
// Confirm the change.
confirmChange
:=
lab_utils
.
CommitOrConfirmChange
(
setResp
.
GetResponses
()[
0
]
.
GetId
(),
mnepb
.
Operation_OPERATION_CONFIRM
,
pndID
)
_
,
err
=
mneService
.
SetChangeList
(
ctx
,
confirmChange
)
// Force-push changes
err
=
lab_utils
.
ForcePush
(
setResp
.
GetResponses
()[
0
]
.
GetId
(),
pndID
,
mneService
,
ctx
)
if
err
!=
nil
{
t
.
Error
(
err
)
}
...
...
@@ -188,9 +180,7 @@ func TestLab01(t *testing.T) {
}
else
if
strings
.
Contains
(
mne
.
configEntries
[
i
]
.
leaf
,
"route"
)
{
fmt
.
Println
(
"to be continued"
)
}
}
}
// Commit Confirm
...
...
@@ -202,5 +192,4 @@ func TestLab01(t *testing.T) {
// Check if the routing configuration has been changed
// Ping to check connection between both managed network elements.
}
This diff is collapsed.
Click to expand it.
integration-tests/lab_tests/utils/labUtils.go
+
19
−
0
View file @
f1afcd49
package
lab_utils
import
(
"context"
"os"
mnepb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement"
...
...
@@ -33,6 +34,24 @@ func CommitOrConfirmChange(cid string, operation mnepb.Operation, pndID string)
return
sclr
}
func
ForcePush
(
cid
string
,
pndID
string
,
mneService
mnepb
.
NetworkElementServiceClient
,
ctx
context
.
Context
)
error
{
// Commit
commitChange
:=
CommitOrConfirmChange
(
cid
,
mnepb
.
Operation_OPERATION_COMMIT
,
pndID
)
_
,
err
:=
mneService
.
SetChangeList
(
ctx
,
commitChange
)
if
err
!=
nil
{
return
err
}
// Confirm
confirmChange
:=
CommitOrConfirmChange
(
cid
,
mnepb
.
Operation_OPERATION_CONFIRM
,
pndID
)
_
,
err
=
mneService
.
SetChangeList
(
ctx
,
confirmChange
)
if
err
!=
nil
{
return
err
}
return
nil
}
func
SetHostnamePathListRequestSingleMne
(
mneId
string
,
newHostname
string
,
operation
mnepb
.
ApiOperation
)
(
*
mnepb
.
SetPathListRequest
,
error
)
{
hostnamePath
,
err
:=
ygot
.
StringToStructuredPath
(
"/system/config/hostname"
)
if
err
!=
nil
{
...
...
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