From f3c40086ac2ff391b8ba1a2b30036f10d74de0b9 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 6 Nov 2022 20:22:21 +0100 Subject: [PATCH] Make TLS setup work automatically This commit injects the per-test-generated tls certs into the tailscale container and makes sure all can ping all. It does not test any of the DERP isolation yet. Signed-off-by: Kristoffer Dalby --- integration/tsic/tsic.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/integration/tsic/tsic.go b/integration/tsic/tsic.go index 16e6868f..712ad34d 100644 --- a/integration/tsic/tsic.go +++ b/integration/tsic/tsic.go @@ -176,6 +176,19 @@ func (t *TailscaleInContainer) Version() string { return t.version } +func (t *TailscaleInContainer) WaitForReady() error { + return t.pool.Retry(func() error { + // If tailscaled has not started yet, this will return a non-zero + // status code + _, err := t.Execute([]string{"tailscale", "status"}) + if err != nil { + return err + } + + return nil + }) +} + func (t *TailscaleInContainer) Execute( command []string, ) (string, string, error) {