mirror of
https://github.com/juanfont/headscale.git
synced 2025-05-23 01:15:27 +02:00
fix
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
0ca68ff61b
commit
8e3201b78d
@ -169,6 +169,9 @@ func Test_fullMapResponse(t *testing.T) {
|
|||||||
tsaddr.AllIPv4(),
|
tsaddr.AllIPv4(),
|
||||||
netip.MustParsePrefix("192.168.0.0/24"),
|
netip.MustParsePrefix("192.168.0.0/24"),
|
||||||
},
|
},
|
||||||
|
PrimaryRoutes: []netip.Prefix{
|
||||||
|
netip.MustParsePrefix("192.168.0.0/24"),
|
||||||
|
},
|
||||||
HomeDERP: 0,
|
HomeDERP: 0,
|
||||||
LegacyDERPString: "127.3.3.40:0",
|
LegacyDERPString: "127.3.3.40:0",
|
||||||
Hostinfo: hiview(tailcfg.Hostinfo{
|
Hostinfo: hiview(tailcfg.Hostinfo{
|
||||||
|
@ -67,8 +67,6 @@ func TestTailNode(t *testing.T) {
|
|||||||
want: &tailcfg.Node{
|
want: &tailcfg.Node{
|
||||||
Name: "empty",
|
Name: "empty",
|
||||||
StableID: "0",
|
StableID: "0",
|
||||||
Addresses: []netip.Prefix{},
|
|
||||||
AllowedIPs: []netip.Prefix{},
|
|
||||||
HomeDERP: 0,
|
HomeDERP: 0,
|
||||||
LegacyDERPString: "127.3.3.40:0",
|
LegacyDERPString: "127.3.3.40:0",
|
||||||
Hostinfo: hiview(tailcfg.Hostinfo{}),
|
Hostinfo: hiview(tailcfg.Hostinfo{}),
|
||||||
@ -143,6 +141,9 @@ func TestTailNode(t *testing.T) {
|
|||||||
tsaddr.AllIPv4(),
|
tsaddr.AllIPv4(),
|
||||||
netip.MustParsePrefix("192.168.0.0/24"),
|
netip.MustParsePrefix("192.168.0.0/24"),
|
||||||
},
|
},
|
||||||
|
PrimaryRoutes: []netip.Prefix{
|
||||||
|
netip.MustParsePrefix("192.168.0.0/24"),
|
||||||
|
},
|
||||||
HomeDERP: 0,
|
HomeDERP: 0,
|
||||||
LegacyDERPString: "127.3.3.40:0",
|
LegacyDERPString: "127.3.3.40:0",
|
||||||
Hostinfo: hiview(tailcfg.Hostinfo{
|
Hostinfo: hiview(tailcfg.Hostinfo{
|
||||||
@ -156,10 +157,6 @@ func TestTailNode(t *testing.T) {
|
|||||||
|
|
||||||
Tags: []string{},
|
Tags: []string{},
|
||||||
|
|
||||||
PrimaryRoutes: []netip.Prefix{
|
|
||||||
netip.MustParsePrefix("192.168.0.0/24"),
|
|
||||||
},
|
|
||||||
|
|
||||||
LastSeen: &lastSeen,
|
LastSeen: &lastSeen,
|
||||||
MachineAuthorized: true,
|
MachineAuthorized: true,
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
"github.com/juanfont/headscale/hscontrol/types"
|
"github.com/juanfont/headscale/hscontrol/types"
|
||||||
"github.com/juanfont/headscale/hscontrol/util"
|
"github.com/juanfont/headscale/hscontrol/util"
|
||||||
xmaps "golang.org/x/exp/maps"
|
xmaps "golang.org/x/exp/maps"
|
||||||
|
"tailscale.com/net/tsaddr"
|
||||||
"tailscale.com/util/set"
|
"tailscale.com/util/set"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -152,6 +153,7 @@ func (pr *PrimaryRoutes) PrimaryRoutes(id types.NodeID) []netip.Prefix {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tsaddr.SortPrefixes(routes)
|
||||||
return routes
|
return routes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ func TestHASubnetRouterFailover(t *testing.T) {
|
|||||||
|
|
||||||
scenario, err := NewScenario(spec)
|
scenario, err := NewScenario(spec)
|
||||||
require.NoErrorf(t, err, "failed to create scenario: %s", err)
|
require.NoErrorf(t, err, "failed to create scenario: %s", err)
|
||||||
// defer scenario.ShutdownAssertNoPanics(t)
|
defer scenario.ShutdownAssertNoPanics(t)
|
||||||
|
|
||||||
err = scenario.CreateHeadscaleEnv(
|
err = scenario.CreateHeadscaleEnv(
|
||||||
[]tsic.Option{tsic.WithAcceptRoutes()},
|
[]tsic.Option{tsic.WithAcceptRoutes()},
|
||||||
|
Loading…
Reference in New Issue
Block a user