Skip to content

Commit 9dcfc35

Browse files
author
Craig O'Donnell
authored
use api.replicated.com for e2e check-internet (#660)
1 parent 8b6a2a7 commit 9dcfc35

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

e2e/cluster/cluster.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lxc.mount.auto=proc:rw sys:rw cgroup:rw
2525
lxc.cgroup.devices.allow=a
2626
lxc.cap.drop=`
2727
const checkInternet = `#!/bin/bash
28-
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/www.replicated.com/80'
28+
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/api.replicated.com/80'
2929
if [ $? == 0 ]; then
3030
exit 0
3131
fi
@@ -571,20 +571,22 @@ func NodeHasInternet(in *Input, node string) {
571571
Line: []string{"/usr/local/bin/check_internet.sh"},
572572
}
573573
var success bool
574-
for i := 0; i < 10; i++ {
574+
var lastErr error
575+
for i := 0; i < 60; i++ {
575576
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
576577
defer cancel()
577578
if err := Run(ctx, in.T, cmd); err != nil {
578-
in.T.Logf("Unable to reach internet from %s: %v", node, err)
579-
time.Sleep(30 * time.Second)
579+
lastErr = fmt.Errorf("failed to check internet: %v", err)
580+
time.Sleep(5 * time.Second)
580581
continue
581582
}
582583
success = true
583584
break
584585
}
585586
if !success {
586-
in.T.Fatalf("Unable to reach internet from %s", node)
587+
in.T.Fatalf("Timed out trying to reach internet from %s: %v", node, lastErr)
587588
}
589+
in.T.Logf("Node %s can reach the internet", node)
588590
}
589591

590592
// CreateNode creates a single node. The i here is used to create a unique

0 commit comments

Comments
 (0)