From 14d957012727e13fafa82a34b61d3619725a818a Mon Sep 17 00:00:00 2001 From: Kegan Dougal <7190048+kegsay@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:58:51 +0000 Subject: [PATCH] More aggressive debugging; netstat in mitmproxy --- internal/deploy/deploy.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/internal/deploy/deploy.go b/internal/deploy/deploy.go index 2a14bff..b2bf965 100644 --- a/internal/deploy/deploy.go +++ b/internal/deploy/deploy.go @@ -171,6 +171,28 @@ func RunNewDeployment(t *testing.T, shouldTCPDump bool) *SlidingSyncDeployment { rpHS1URL := externalURL(t, mitmproxyContainer, hs1ExposedPort) rpHS2URL := externalURL(t, mitmproxyContainer, hs2ExposedPort) controllerURL := externalURL(t, mitmproxyContainer, controllerExposedPort) + time.Sleep(time.Second) + execInContainer := func(c testcontainers.Container, cmd []string) { + _, r, err := c.Exec(context.Background(), cmd) + if err != nil { + panic(err) + } + output, err := io.ReadAll(r) + if err != nil { + panic(err) + } + fmt.Println(string(output)) + } + execInContainer(mitmproxyContainer, []string{ + "apt", "update", + }) + execInContainer(mitmproxyContainer, []string{ + "apt", "install", "net-tools", "-y", + }) + execInContainer(mitmproxyContainer, []string{ + "netstat", "-lp", + }) + fmt.Println("____________________________") // Make a postgres container postgresContainer, err := testcontainers.GenericContainer(context.Background(), testcontainers.GenericContainerRequest{