mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-12 03:27:35 +00:00
Make WaitForTailscaleLogout a Scenario method
This commit is contained in:
@@ -469,3 +469,19 @@ func (s *Scenario) ListTailscaleClientsFQDNs(namespaces ...string) ([]string, er
|
||||
|
||||
return allFQDNs, nil
|
||||
}
|
||||
|
||||
func (s *Scenario) WaitForTailscaleLogout() {
|
||||
for _, namespace := range s.namespaces {
|
||||
for _, client := range namespace.Clients {
|
||||
namespace.syncWaitGroup.Add(1)
|
||||
|
||||
go func(c TailscaleClient) {
|
||||
defer namespace.syncWaitGroup.Done()
|
||||
|
||||
// TODO(kradalby): error handle this
|
||||
_ = c.WaitForLogout()
|
||||
}(client)
|
||||
}
|
||||
namespace.syncWaitGroup.Wait()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user