From 58f5bbe9fdd35544704ce7cc7afbd346d5e0889e Mon Sep 17 00:00:00 2001 From: David Robertson Date: Mon, 6 Jun 2022 20:22:34 +0100 Subject: [PATCH 1/3] Use `host-gateway` to ensure servers can reach host --- internal/docker/deployer.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/docker/deployer.go b/internal/docker/deployer.go index 8582954f..dd722f3d 100644 --- a/internal/docker/deployer.go +++ b/internal/docker/deployer.go @@ -177,10 +177,11 @@ func deployImage( var err error if runtime.GOOS == "linux" { - // By default docker for linux does not expose this, so do it now. - // When https://github.com/moby/moby/pull/40007 lands in Docker 20, we should - // change this to be `host.docker.internal:host-gateway` - extraHosts = []string{HostnameRunningComplement + ":172.17.0.1"} + // Ensure that the homservers under test can contact the host, so they can + // interact with a complement-controlled test server. + // Note: this feature of docker landed in Docker 20.10, + // see https://github.com/moby/moby/pull/40007 + extraHosts = []string{"host.docker.internal:host-gateway"} } for _, m := range cfg.HostMounts { From 9995a27247254ee68863432d631ccaf763b7e13f Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 7 Jun 2022 10:28:32 +0100 Subject: [PATCH 2/3] typo fix Co-authored-by: reivilibre --- internal/docker/deployer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/docker/deployer.go b/internal/docker/deployer.go index dd722f3d..5dc9c9cd 100644 --- a/internal/docker/deployer.go +++ b/internal/docker/deployer.go @@ -177,7 +177,7 @@ func deployImage( var err error if runtime.GOOS == "linux" { - // Ensure that the homservers under test can contact the host, so they can + // Ensure that the homeservers under test can contact the host, so they can // interact with a complement-controlled test server. // Note: this feature of docker landed in Docker 20.10, // see https://github.com/moby/moby/pull/40007 From b83b774361043f366ea5bde23cba889284cca619 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 14 Jun 2022 11:52:28 +0100 Subject: [PATCH 3/3] Note that Docker >= 20.10 is required. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3c6955b..b0c65d24 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Complement is a black box integration testing framework for Matrix homeservers. ## Running -You need to have Go and Docker installed, as well as `libolm3` and `libolm-dev`. Then: +You need to have Go and Docker >= 20.10 installed, as well as `libolm3` and `libolm-dev`. Then: ``` $ COMPLEMENT_BASE_IMAGE=some-matrix/homeserver-impl go test -v ./tests/...