AwaitNeedsLogin waits for n to reach the IPN state "NeedsLogin".
()
| 1040 | |
| 1041 | // AwaitNeedsLogin waits for n to reach the IPN state "NeedsLogin". |
| 1042 | func (n *TestNode) AwaitNeedsLogin() { |
| 1043 | t := n.env.t |
| 1044 | t.Helper() |
| 1045 | if err := tstest.WaitFor(20*time.Second, func() error { |
| 1046 | st, err := n.Status() |
| 1047 | if err != nil { |
| 1048 | return err |
| 1049 | } |
| 1050 | if st.BackendState != "NeedsLogin" { |
| 1051 | return fmt.Errorf("in state %q", st.BackendState) |
| 1052 | } |
| 1053 | return nil |
| 1054 | }); err != nil { |
| 1055 | t.Fatalf("failure/timeout waiting for transition to NeedsLogin status: %v", err) |
| 1056 | } |
| 1057 | } |
| 1058 | |
| 1059 | func (n *TestNode) TailscaleForOutput(arg ...string) *exec.Cmd { |
| 1060 | cmd := n.Tailscale(arg...) |