Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
3d784e69
Commit
3d784e69
authored
Mar 30, 2021
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Improve upon tests in gateway package
parent
08c33918
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
network/gateway/gateway_test.go
+18
-9
18 additions, 9 deletions
network/gateway/gateway_test.go
with
18 additions
and
9 deletions
network/gateway/gateway_test.go
+
18
−
9
View file @
3d784e69
...
@@ -108,11 +108,14 @@ func TestHostPool_ManageHostPool(t *testing.T) {
...
@@ -108,11 +108,14 @@ func TestHostPool_ManageHostPool(t *testing.T) {
}
}
newNdf
:=
getTestNdf
(
t
)
// Update the ndf, removing some gateways at a cutoff
// Update the ndf, removing some gateways at a cutoff
testPool
.
ndf
.
Gateways
=
newGateways
newNdf
.
Gateways
=
newGateways
testPool
.
ndf
.
Nodes
=
newNodes
newNdf
.
Nodes
=
newNodes
testPool
.
UpdateNdf
(
newNdf
)
time
.
Sleep
(
1
*
time
.
Second
)
time
.
Sleep
(
2
*
time
.
Second
)
// Check that old gateways are not in pool
// Check that old gateways are not in pool
for
_
,
ndfGw
:=
range
testNdf
.
Gateways
{
for
_
,
ndfGw
:=
range
testNdf
.
Gateways
{
...
@@ -627,9 +630,12 @@ func TestHostPool_UpdateConns_AddGateways(t *testing.T) {
...
@@ -627,9 +630,12 @@ func TestHostPool_UpdateConns_AddGateways(t *testing.T) {
}
}
// Update the ndf, removing some gateways at a cutoff
// Update the ndf
testPool
.
ndf
.
Gateways
=
append
(
testPool
.
ndf
.
Gateways
,
newGateways
...
)
newNdf
:=
getTestNdf
(
t
)
testPool
.
ndf
.
Nodes
=
append
(
testPool
.
ndf
.
Nodes
,
newNodes
...
)
newNdf
.
Gateways
=
append
(
newNdf
.
Gateways
,
newGateways
...
)
newNdf
.
Nodes
=
append
(
newNdf
.
Nodes
,
newNodes
...
)
testPool
.
UpdateNdf
(
newNdf
)
// Update the connections
// Update the connections
err
=
testPool
.
updateConns
()
err
=
testPool
.
updateConns
()
...
@@ -699,9 +705,12 @@ func TestHostPool_UpdateConns_RemoveGateways(t *testing.T) {
...
@@ -699,9 +705,12 @@ func TestHostPool_UpdateConns_RemoveGateways(t *testing.T) {
}
}
// Update the ndf, removing some gateways at a cutoff
// Update the ndf, replacing old data entirely
testPool
.
ndf
.
Gateways
=
newGateways
newNdf
:=
getTestNdf
(
t
)
testPool
.
ndf
.
Nodes
=
newNodes
newNdf
.
Gateways
=
newGateways
newNdf
.
Nodes
=
newNodes
testPool
.
UpdateNdf
(
newNdf
)
// Update the connections
// Update the connections
err
=
testPool
.
updateConns
()
err
=
testPool
.
updateConns
()
...
...
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