mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-23 17:51:05 +00:00
ipn: exercise logout in e2e test
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
parent
0f73070a57
commit
f5e0407e97
@ -136,6 +136,32 @@ func TestIPN(t *testing.T) {
|
|||||||
t.Error("no ping seen")
|
t.Error("no ping seen")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
drain:
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-n1.NotifyCh:
|
||||||
|
case <-n2.NotifyCh:
|
||||||
|
default:
|
||||||
|
break drain
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
n1.Backend.Logout()
|
||||||
|
|
||||||
|
t.Run("logout", func(t *testing.T) {
|
||||||
|
select {
|
||||||
|
case n := <-n1.NotifyCh:
|
||||||
|
if n.State != nil {
|
||||||
|
if *n.State != NeedsLogin {
|
||||||
|
t.Errorf("n.State=%v, want %v", n.State, NeedsLogin)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case <-time.After(3 * time.Second):
|
||||||
|
t.Fatalf("timeout waiting for logout notification")
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
type testNode struct {
|
type testNode struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user