ipn/ipnlocal: add state change test for key expiry

Updates tailscale/corp#31478

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
This commit is contained in:
James Sanderson 2025-09-05 14:52:44 +01:00 committed by James 'zofrex' Sanderson
parent 46369f06af
commit 046b8830c7

View File

@ -1349,6 +1349,21 @@ func TestEngineReconfigOnStateChange(t *testing.T) {
Hosts: hostsFor(node3), Hosts: hostsFor(node3),
}, },
}, },
{
name: "Start/Connect/Login/Expire",
steps: func(t *testing.T, lb *LocalBackend, cc func() *mockControl) {
mustDo(t)(lb.Start(ipn.Options{}))
mustDo2(t)(lb.EditPrefs(connect))
cc().authenticated(node3)
cc().send(nil, "", false, &netmap.NetworkMap{
Expiry: time.Now().Add(-time.Minute),
})
},
wantState: ipn.NeedsLogin,
wantCfg: &wgcfg.Config{},
wantRouterCfg: &router.Config{},
wantDNSCfg: &dns.Config{},
},
} }
for _, tt := range tests { for _, tt := range tests {