1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-07-27 13:48:02 +02:00

fix exit node test

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2025-03-19 10:07:34 +01:00
parent c047278109
commit 81b7b39d79
No known key found for this signature in database
2 changed files with 5 additions and 7 deletions

View File

@ -7,6 +7,8 @@ import (
"testing"
"time"
"slices"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
@ -1533,6 +1535,7 @@ func TestSubnetRouterMultiNetworkExitNode(t *testing.T) {
err = user2c.Ping(webip.String(),
tsic.WithPingUntilDirect(false),
tsic.WithPingCount(1),
tsic.WithPingTimeout(7*time.Second),
)
require.NoError(t, err)
}
@ -1563,13 +1566,7 @@ func requirePeerSubnetRoutes(t *testing.T, status *ipnstate.PeerStatus, expected
if tsaddr.IsExitRoute(p) {
return true
}
for _, ip := range status.TailscaleIPs {
if p.Contains(ip) {
return false
}
}
return true
return !slices.ContainsFunc(status.TailscaleIPs, p.Contains)
})
if diff := cmp.Diff(expected, got, util.PrefixComparer, cmpopts.EquateEmpty()); diff != "" {

View File

@ -1014,6 +1014,7 @@ func (t *TailscaleInContainer) Ping(hostnameOrIP string, opts ...PingOption) err
),
)
if err != nil {
log.Printf("command: %v", command)
log.Printf(
"failed to run ping command from %s to %s, err: %s",
t.Hostname(),