Add integration tests that check logout and relogin
This commit is contained in:
parent
593040b73d
commit
b54c0e3d22
3 changed files with 180 additions and 2 deletions
|
@ -30,6 +30,7 @@ var (
|
|||
errTailscaleWrongPeerCount = errors.New("wrong peer count")
|
||||
errTailscaleCannotUpWithoutAuthkey = errors.New("cannot up without authkey")
|
||||
errTailscaleNotConnected = errors.New("tailscale not connected")
|
||||
errTailscaleNotLoggedOut = errors.New("tailscale not logged out")
|
||||
)
|
||||
|
||||
type TailscaleInContainer struct {
|
||||
|
@ -350,6 +351,21 @@ func (t *TailscaleInContainer) WaitForReady() error {
|
|||
})
|
||||
}
|
||||
|
||||
func (t *TailscaleInContainer) WaitForLogout() error {
|
||||
return t.pool.Retry(func() error {
|
||||
status, err := t.Status()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to fetch tailscale status: %w", err)
|
||||
}
|
||||
|
||||
if status.CurrentTailnet == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return errTailscaleNotLoggedOut
|
||||
})
|
||||
}
|
||||
|
||||
func (t *TailscaleInContainer) WaitForPeers(expected int) error {
|
||||
return t.pool.Retry(func() error {
|
||||
status, err := t.Status()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue