mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-11 12:37:42 +00:00
populate serving from primary routes (#2489)
* populate serving from primary routes Depends on #2464 Fixes #2480 Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> * also exit Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> * fix route update outside of connection there was a bug where routes would not be updated if they changed while a node was connected and it was not part of an autoapprove. Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> * update expected test output, cli only shows service node Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> --------- Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
@@ -375,7 +375,7 @@ func TestHASubnetRouterFailover(t *testing.T) {
|
||||
assert.Len(t, nodes, 6)
|
||||
|
||||
assertNodeRouteCount(t, nodes[0], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[1], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[1], 1, 1, 0)
|
||||
assertNodeRouteCount(t, nodes[2], 1, 0, 0)
|
||||
|
||||
// Verify that the client has routes from the primary machine
|
||||
@@ -431,8 +431,8 @@ func TestHASubnetRouterFailover(t *testing.T) {
|
||||
assert.Len(t, nodes, 6)
|
||||
|
||||
assertNodeRouteCount(t, nodes[0], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[1], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[2], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[1], 1, 1, 0)
|
||||
assertNodeRouteCount(t, nodes[2], 1, 1, 0)
|
||||
|
||||
// Verify that the client has routes from the primary machine
|
||||
srs1 = subRouter1.MustStatus()
|
||||
@@ -645,7 +645,7 @@ func TestHASubnetRouterFailover(t *testing.T) {
|
||||
assert.Len(t, nodes, 6)
|
||||
|
||||
assertNodeRouteCount(t, nodes[0], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[1], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[1], 1, 1, 0)
|
||||
assertNodeRouteCount(t, nodes[2], 1, 0, 0)
|
||||
|
||||
// Verify that the route is announced from subnet router 1
|
||||
@@ -737,7 +737,7 @@ func TestHASubnetRouterFailover(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, nodes, 6)
|
||||
|
||||
assertNodeRouteCount(t, nodes[0], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[0], 1, 1, 0)
|
||||
assertNodeRouteCount(t, nodes[1], 1, 1, 1)
|
||||
assertNodeRouteCount(t, nodes[2], 1, 0, 0)
|
||||
|
||||
@@ -838,7 +838,7 @@ func TestEnableDisableAutoApprovedRoute(t *testing.T) {
|
||||
command = []string{
|
||||
"tailscale",
|
||||
"set",
|
||||
"--advertise-routes=",
|
||||
`--advertise-routes=`,
|
||||
}
|
||||
_, _, err = subRouter1.Execute(command)
|
||||
require.NoErrorf(t, err, "failed to remove advertised route: %s", err)
|
||||
|
Reference in New Issue
Block a user