mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-01 13:46:49 +02:00
fix exit node test
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
c047278109
commit
81b7b39d79
@ -7,6 +7,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"slices"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/google/go-cmp/cmp/cmpopts"
|
"github.com/google/go-cmp/cmp/cmpopts"
|
||||||
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
|
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
|
||||||
@ -1533,6 +1535,7 @@ func TestSubnetRouterMultiNetworkExitNode(t *testing.T) {
|
|||||||
err = user2c.Ping(webip.String(),
|
err = user2c.Ping(webip.String(),
|
||||||
tsic.WithPingUntilDirect(false),
|
tsic.WithPingUntilDirect(false),
|
||||||
tsic.WithPingCount(1),
|
tsic.WithPingCount(1),
|
||||||
|
tsic.WithPingTimeout(7*time.Second),
|
||||||
)
|
)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
@ -1563,13 +1566,7 @@ func requirePeerSubnetRoutes(t *testing.T, status *ipnstate.PeerStatus, expected
|
|||||||
if tsaddr.IsExitRoute(p) {
|
if tsaddr.IsExitRoute(p) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
for _, ip := range status.TailscaleIPs {
|
return !slices.ContainsFunc(status.TailscaleIPs, p.Contains)
|
||||||
if p.Contains(ip) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if diff := cmp.Diff(expected, got, util.PrefixComparer, cmpopts.EquateEmpty()); diff != "" {
|
if diff := cmp.Diff(expected, got, util.PrefixComparer, cmpopts.EquateEmpty()); diff != "" {
|
||||||
|
@ -1014,6 +1014,7 @@ func (t *TailscaleInContainer) Ping(hostnameOrIP string, opts ...PingOption) err
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Printf("command: %v", command)
|
||||||
log.Printf(
|
log.Printf(
|
||||||
"failed to run ping command from %s to %s, err: %s",
|
"failed to run ping command from %s to %s, err: %s",
|
||||||
t.Hostname(),
|
t.Hostname(),
|
||||||
|
Loading…
Reference in New Issue
Block a user