Do several attempts to send the file
This commit is contained in:
parent
7d0da8b578
commit
5626f598ce
1 changed files with 37 additions and 15 deletions
|
@ -565,22 +565,44 @@ func (s *IntegrationTestSuite) TestTailDrop() {
|
||||||
// So curl!
|
// So curl!
|
||||||
peerAPI, ok := apiURLs[ip]
|
peerAPI, ok := apiURLs[ip]
|
||||||
assert.True(t, ok)
|
assert.True(t, ok)
|
||||||
command := []string{
|
|
||||||
"curl",
|
// We still have some issues with the test infrastructure, so
|
||||||
"--retry",
|
// lets run curl multiple times until it works.
|
||||||
"10",
|
|
||||||
"-X",
|
attempts := 0
|
||||||
"PUT",
|
var err error
|
||||||
"--upload-file",
|
for {
|
||||||
fmt.Sprintf("/tmp/file_from_%s", hostname),
|
command := []string{
|
||||||
fmt.Sprintf("%s/v0/put/file_from_%s", peerAPI, hostname),
|
"curl",
|
||||||
|
"--retry-connrefused",
|
||||||
|
"--retry-delay",
|
||||||
|
"30",
|
||||||
|
"--retry",
|
||||||
|
"10",
|
||||||
|
"--connect-timeout",
|
||||||
|
"60",
|
||||||
|
"-X",
|
||||||
|
"PUT",
|
||||||
|
"--upload-file",
|
||||||
|
fmt.Sprintf("/tmp/file_from_%s", hostname),
|
||||||
|
fmt.Sprintf("%s/v0/put/file_from_%s", peerAPI, hostname),
|
||||||
|
}
|
||||||
|
fmt.Printf("Sending file from %s (%s) to %s (%s)\n", hostname, ips[hostname], peername, ip)
|
||||||
|
_, err = executeCommand(
|
||||||
|
&tailscale,
|
||||||
|
command,
|
||||||
|
[]string{"ALL_PROXY=socks5://localhost:1055/"},
|
||||||
|
)
|
||||||
|
if err == nil {
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
time.Sleep(10 * time.Second)
|
||||||
|
attempts++
|
||||||
|
if attempts > 10 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fmt.Printf("Sending file from %s (%s) to %s (%s)\n", hostname, ips[hostname], peername, ip)
|
|
||||||
_, err := executeCommand(
|
|
||||||
&tailscale,
|
|
||||||
command,
|
|
||||||
[]string{"ALL_PROXY=socks5://localhost:1055/"},
|
|
||||||
)
|
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue