Skip to content

Commit

Permalink
Make sure all clients of a user are ready (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfont authored Apr 12, 2023
1 parent d0b3b1b commit 9836b09
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions integration/auth_oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,15 @@ func (s *AuthOIDCScenario) runTailscaleUp(

user.joinWaitGroup.Wait()

for _, client := range user.Clients {
err := client.WaitForReady()
if err != nil {
log.Printf("client %s was not ready: %s", client.Hostname(), err)

return fmt.Errorf("failed to up tailscale node: %w", err)
}
}

return nil
}

Expand Down
9 changes: 9 additions & 0 deletions integration/auth_web_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,15 @@ func (s *AuthWebFlowScenario) runTailscaleUp(
}
user.joinWaitGroup.Wait()

for _, client := range user.Clients {
err := client.WaitForReady()
if err != nil {
log.Printf("client %s was not ready: %s", client.Hostname(), err)

return fmt.Errorf("failed to up tailscale node: %w", err)
}
}

return nil
}

Expand Down
9 changes: 9 additions & 0 deletions integration/scenario.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,15 @@ func (s *Scenario) RunTailscaleUp(

user.joinWaitGroup.Wait()

for _, client := range user.Clients {
err := client.WaitForReady()
if err != nil {
log.Printf("client %s was not ready: %s", client.Hostname(), err)

return fmt.Errorf("failed to up tailscale node: %w", err)
}
}

return nil
}

Expand Down
9 changes: 9 additions & 0 deletions integration/tsic/tsic.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,15 @@ func (t *TailscaleInContainer) WaitForReady() error {
return nil
}

// ipnstate.Status.CurrentTailnet was added in Tailscale 1.22.0
// https://github.com/tailscale/tailscale/pull/3865
//
// Before that, we can check the BackendState to see if the
// tailscaled daemon is connected to the control system.
if status.BackendState == "Running" {
return nil
}

return errTailscaleNotConnected
})
}
Expand Down

0 comments on commit 9836b09

Please sign in to comment.