Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
e5a41875
Unverified
Commit
e5a41875
authored
Apr 14, 2020
by
Will Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint
parent
971cbf74
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
test/integration/wan_lan_dht_test.go
test/integration/wan_lan_dht_test.go
+7
-7
No files found.
test/integration/wan_lan_dht_test.go
View file @
e5a41875
...
@@ -104,8 +104,8 @@ func RunDHTConnectivity(conf testutil.LatencyConfig, numPeers int) error {
...
@@ -104,8 +104,8 @@ func RunDHTConnectivity(conf testutil.LatencyConfig, numPeers int) error {
wanAddr
:=
makeAddr
(
uint32
(
i
),
true
)
wanAddr
:=
makeAddr
(
uint32
(
i
),
true
)
wanPeer
.
Peerstore
.
AddAddr
(
wanPeer
.
Identity
,
wanAddr
,
peerstore
.
PermanentAddrTTL
)
wanPeer
.
Peerstore
.
AddAddr
(
wanPeer
.
Identity
,
wanAddr
,
peerstore
.
PermanentAddrTTL
)
for
_
,
p
:=
range
wanPeers
{
for
_
,
p
:=
range
wanPeers
{
mn
.
LinkPeers
(
p
.
Identity
,
wanPeer
.
Identity
)
_
,
_
=
mn
.
LinkPeers
(
p
.
Identity
,
wanPeer
.
Identity
)
wanPeer
.
PeerHost
.
Connect
(
connectionContext
,
p
.
Peerstore
.
PeerInfo
(
p
.
Identity
))
_
=
wanPeer
.
PeerHost
.
Connect
(
connectionContext
,
p
.
Peerstore
.
PeerInfo
(
p
.
Identity
))
}
}
wanPeers
=
append
(
wanPeers
,
wanPeer
)
wanPeers
=
append
(
wanPeers
,
wanPeer
)
...
@@ -120,8 +120,8 @@ func RunDHTConnectivity(conf testutil.LatencyConfig, numPeers int) error {
...
@@ -120,8 +120,8 @@ func RunDHTConnectivity(conf testutil.LatencyConfig, numPeers int) error {
lanAddr
:=
makeAddr
(
uint32
(
i
),
false
)
lanAddr
:=
makeAddr
(
uint32
(
i
),
false
)
lanPeer
.
Peerstore
.
AddAddr
(
lanPeer
.
Identity
,
lanAddr
,
peerstore
.
PermanentAddrTTL
)
lanPeer
.
Peerstore
.
AddAddr
(
lanPeer
.
Identity
,
lanAddr
,
peerstore
.
PermanentAddrTTL
)
for
_
,
p
:=
range
lanPeers
{
for
_
,
p
:=
range
lanPeers
{
mn
.
LinkPeers
(
p
.
Identity
,
lanPeer
.
Identity
)
_
,
_
=
mn
.
LinkPeers
(
p
.
Identity
,
lanPeer
.
Identity
)
lanPeer
.
PeerHost
.
Connect
(
connectionContext
,
p
.
Peerstore
.
PeerInfo
(
p
.
Identity
))
_
=
lanPeer
.
PeerHost
.
Connect
(
connectionContext
,
p
.
Peerstore
.
PeerInfo
(
p
.
Identity
))
}
}
lanPeers
=
append
(
lanPeers
,
lanPeer
)
lanPeers
=
append
(
lanPeers
,
lanPeer
)
}
}
...
@@ -171,7 +171,7 @@ StartupWait:
...
@@ -171,7 +171,7 @@ StartupWait:
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
lanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
lanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
i
=
(
i
+
1
)
%
len
(
lanPeers
)
i
=
(
i
+
1
)
%
len
(
lanPeers
)
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
lanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
lanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
testPeer
.
PeerHost
.
Network
()
.
ClosePeer
(
lanPeers
[
i
]
.
Identity
)
_
=
testPeer
.
PeerHost
.
Network
()
.
ClosePeer
(
lanPeers
[
i
]
.
Identity
)
testPeer
.
PeerHost
.
Peerstore
()
.
ClearAddrs
(
lanPeers
[
i
]
.
Identity
)
testPeer
.
PeerHost
.
Peerstore
()
.
ClearAddrs
(
lanPeers
[
i
]
.
Identity
)
}
}
}
}
...
@@ -230,7 +230,7 @@ WanStartupWait:
...
@@ -230,7 +230,7 @@ WanStartupWait:
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
wanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
wanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
i
=
(
i
+
1
)
%
len
(
wanPeers
)
i
=
(
i
+
1
)
%
len
(
wanPeers
)
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
wanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
wanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
testPeer
.
PeerHost
.
Network
()
.
ClosePeer
(
wanPeers
[
i
]
.
Identity
)
_
=
testPeer
.
PeerHost
.
Network
()
.
ClosePeer
(
wanPeers
[
i
]
.
Identity
)
testPeer
.
PeerHost
.
Peerstore
()
.
ClearAddrs
(
wanPeers
[
i
]
.
Identity
)
testPeer
.
PeerHost
.
Peerstore
()
.
ClearAddrs
(
wanPeers
[
i
]
.
Identity
)
}
}
}
}
...
@@ -254,7 +254,7 @@ WanStartupWait:
...
@@ -254,7 +254,7 @@ WanStartupWait:
// Finally, re-share the lan provided cid from a wan peer and expect a merged result.
// Finally, re-share the lan provided cid from a wan peer and expect a merged result.
i
=
rand
.
Intn
(
len
(
wanPeers
))
i
=
rand
.
Intn
(
len
(
wanPeers
))
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
wanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
if
testPeer
.
PeerHost
.
Network
()
.
Connectedness
(
wanPeers
[
i
]
.
Identity
)
==
corenet
.
Connected
{
testPeer
.
PeerHost
.
Network
()
.
ClosePeer
(
wanPeers
[
i
]
.
Identity
)
_
=
testPeer
.
PeerHost
.
Network
()
.
ClosePeer
(
wanPeers
[
i
]
.
Identity
)
testPeer
.
PeerHost
.
Peerstore
()
.
ClearAddrs
(
wanPeers
[
i
]
.
Identity
)
testPeer
.
PeerHost
.
Peerstore
()
.
ClearAddrs
(
wanPeers
[
i
]
.
Identity
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment