From c0e5fbba993bdbd8efb9f9ca2f0ad5e59586fb78 Mon Sep 17 00:00:00 2001 From: Chris Crone Date: Tue, 13 Apr 2021 15:11:14 +0200 Subject: [PATCH] local.e2e: Reduce number of test images Signed-off-by: Chris Crone --- local/e2e/compose/fixtures/attach-restart/compose.yaml | 4 ++-- .../compose/fixtures/build-test/nginx-build/Dockerfile | 2 +- .../fixtures/build-test/nginx-build2/Dockerfile | 2 +- .../compose/fixtures/cascade-stop-test/compose.yaml | 4 ++-- local/e2e/compose/fixtures/ipc-test/compose.yaml | 6 +++--- local/e2e/compose/fixtures/logs-test/compose.yaml | 4 ++-- local/e2e/compose/fixtures/network-test/compose.yaml | 2 +- local/e2e/compose/fixtures/restart-test/compose.yml | 2 +- local/e2e/compose/fixtures/run-test/compose.yml | 4 ++-- .../fixtures/simple-build-test/nginx-build/Dockerfile | 2 +- .../compose/fixtures/simple-composefile/compose.yml | 4 ++-- local/e2e/compose/fixtures/start-stop/compose.yml | 4 ++-- .../fixtures/volume-test/nginx-build/Dockerfile | 2 +- .../e2e/compose/fixtures/wrong-composefile/compose.yml | 2 +- local/e2e/compose/ipc_test.go | 2 +- local/e2e/container/container_test.go | 10 +++++----- 16 files changed, 28 insertions(+), 28 deletions(-) diff --git a/local/e2e/compose/fixtures/attach-restart/compose.yaml b/local/e2e/compose/fixtures/attach-restart/compose.yaml index 0253fa03c..d628e6930 100644 --- a/local/e2e/compose/fixtures/attach-restart/compose.yaml +++ b/local/e2e/compose/fixtures/attach-restart/compose.yaml @@ -1,9 +1,9 @@ services: simple: - image: busybox:1.31.0-uclibc + image: alpine command: sh -c "sleep 5" another: - image: busybox:1.31.0-uclibc + image: alpine command: sh -c "sleep 0.1 && echo world && /bin/false" deploy: restart_policy: diff --git a/local/e2e/compose/fixtures/build-test/nginx-build/Dockerfile b/local/e2e/compose/fixtures/build-test/nginx-build/Dockerfile index 87925203e..dd79c0e4a 100644 --- a/local/e2e/compose/fixtures/build-test/nginx-build/Dockerfile +++ b/local/e2e/compose/fixtures/build-test/nginx-build/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM nginx +FROM nginx:alpine ARG FOO LABEL FOO=$FOO diff --git a/local/e2e/compose/fixtures/build-test/nginx-build2/Dockerfile b/local/e2e/compose/fixtures/build-test/nginx-build2/Dockerfile index b717000d5..f8a39faca 100644 --- a/local/e2e/compose/fixtures/build-test/nginx-build2/Dockerfile +++ b/local/e2e/compose/fixtures/build-test/nginx-build2/Dockerfile @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM nginx +FROM nginx:alpine COPY static2 /usr/share/nginx/html diff --git a/local/e2e/compose/fixtures/cascade-stop-test/compose.yaml b/local/e2e/compose/fixtures/cascade-stop-test/compose.yaml index 5473670f7..1274fc537 100644 --- a/local/e2e/compose/fixtures/cascade-stop-test/compose.yaml +++ b/local/e2e/compose/fixtures/cascade-stop-test/compose.yaml @@ -1,7 +1,7 @@ services: should_fail: - image: busybox:1.27.2 + image: alpine command: ls /does_not_exist sleep: # will be killed - image: busybox:1.27.2 + image: alpine command: ping localhost diff --git a/local/e2e/compose/fixtures/ipc-test/compose.yaml b/local/e2e/compose/fixtures/ipc-test/compose.yaml index 3ce737642..0659dd96a 100644 --- a/local/e2e/compose/fixtures/ipc-test/compose.yaml +++ b/local/e2e/compose/fixtures/ipc-test/compose.yaml @@ -1,13 +1,13 @@ services: service: - image: busybox + image: alpine command: top ipc: "service:shareable" container: - image: busybox + image: alpine command: top ipc: "container:ipc_mode_container" shareable: - image: busybox + image: alpine command: top ipc: shareable diff --git a/local/e2e/compose/fixtures/logs-test/compose.yaml b/local/e2e/compose/fixtures/logs-test/compose.yaml index dac5610bf..2b2c4c3bb 100644 --- a/local/e2e/compose/fixtures/logs-test/compose.yaml +++ b/local/e2e/compose/fixtures/logs-test/compose.yaml @@ -1,7 +1,7 @@ services: ping: - image: busybox:1.27.2 + image: alpine command: ping localhost -c 1 hello: - image: busybox:1.31.0-uclibc + image: alpine command: echo hello diff --git a/local/e2e/compose/fixtures/network-test/compose.yaml b/local/e2e/compose/fixtures/network-test/compose.yaml index bb49f318b..0045ec7b5 100644 --- a/local/e2e/compose/fixtures/network-test/compose.yaml +++ b/local/e2e/compose/fixtures/network-test/compose.yaml @@ -1,6 +1,6 @@ services: mydb: - image: mysql + image: mariadb network_mode: "service:db" environment: - MYSQL_ALLOW_EMPTY_PASSWORD=yes diff --git a/local/e2e/compose/fixtures/restart-test/compose.yml b/local/e2e/compose/fixtures/restart-test/compose.yml index dd87ec205..34038d5c0 100644 --- a/local/e2e/compose/fixtures/restart-test/compose.yml +++ b/local/e2e/compose/fixtures/restart-test/compose.yml @@ -1,4 +1,4 @@ services: restart: - image: busybox + image: alpine command: ash -c "if [[ -f /tmp/restart.lock ]] ; then sleep infinity; else touch /tmp/restart.lock; fi" diff --git a/local/e2e/compose/fixtures/run-test/compose.yml b/local/e2e/compose/fixtures/run-test/compose.yml index 7b6e3ac6b..0168dc240 100644 --- a/local/e2e/compose/fixtures/run-test/compose.yml +++ b/local/e2e/compose/fixtures/run-test/compose.yml @@ -8,13 +8,13 @@ services: networks: - backnet db: - image: nginx + image: nginx:alpine networks: - backnet volumes: - data:/test front: - image: nginx + image: nginx:alpine networks: - frontnet networks: diff --git a/local/e2e/compose/fixtures/simple-build-test/nginx-build/Dockerfile b/local/e2e/compose/fixtures/simple-build-test/nginx-build/Dockerfile index 87925203e..dd79c0e4a 100644 --- a/local/e2e/compose/fixtures/simple-build-test/nginx-build/Dockerfile +++ b/local/e2e/compose/fixtures/simple-build-test/nginx-build/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM nginx +FROM nginx:alpine ARG FOO LABEL FOO=$FOO diff --git a/local/e2e/compose/fixtures/simple-composefile/compose.yml b/local/e2e/compose/fixtures/simple-composefile/compose.yml index 0d38631a2..8b0b49ea1 100644 --- a/local/e2e/compose/fixtures/simple-composefile/compose.yml +++ b/local/e2e/compose/fixtures/simple-composefile/compose.yml @@ -1,7 +1,7 @@ services: simple: - image: busybox:1.27.2 + image: alpine command: top another: - image: busybox:1.31.0-uclibc + image: alpine command: top diff --git a/local/e2e/compose/fixtures/start-stop/compose.yml b/local/e2e/compose/fixtures/start-stop/compose.yml index 7ee4c1575..15f69b2e3 100644 --- a/local/e2e/compose/fixtures/start-stop/compose.yml +++ b/local/e2e/compose/fixtures/start-stop/compose.yml @@ -1,5 +1,5 @@ services: simple: - image: nginx + image: nginx:alpine another: - image: nginx + image: nginx:alpine diff --git a/local/e2e/compose/fixtures/volume-test/nginx-build/Dockerfile b/local/e2e/compose/fixtures/volume-test/nginx-build/Dockerfile index bf1088fcd..a05029ea4 100644 --- a/local/e2e/compose/fixtures/volume-test/nginx-build/Dockerfile +++ b/local/e2e/compose/fixtures/volume-test/nginx-build/Dockerfile @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM nginx +FROM nginx:alpine diff --git a/local/e2e/compose/fixtures/wrong-composefile/compose.yml b/local/e2e/compose/fixtures/wrong-composefile/compose.yml index 323e11026..b1c12a692 100644 --- a/local/e2e/compose/fixtures/wrong-composefile/compose.yml +++ b/local/e2e/compose/fixtures/wrong-composefile/compose.yml @@ -1,4 +1,4 @@ services: simple: - image: nginx + image: nginx:alpine wrongField: test diff --git a/local/e2e/compose/ipc_test.go b/local/e2e/compose/ipc_test.go index 4ee4d918f..5ef53d466 100644 --- a/local/e2e/compose/ipc_test.go +++ b/local/e2e/compose/ipc_test.go @@ -32,7 +32,7 @@ func TestIPC(t *testing.T) { const projectName = "ipc_e2e" var cid string t.Run("create ipc mode container", func(t *testing.T) { - res := c.RunDockerCmd("run", "-d", "--rm", "--ipc=shareable", "--name", "ipc_mode_container", "busybox", "top") + res := c.RunDockerCmd("run", "-d", "--rm", "--ipc=shareable", "--name", "ipc_mode_container", "alpine", "top") cid = strings.Trim(res.Stdout(), "\n") }) diff --git a/local/e2e/container/container_test.go b/local/e2e/container/container_test.go index 103cdbd97..6bb43df97 100644 --- a/local/e2e/container/container_test.go +++ b/local/e2e/container/container_test.go @@ -53,7 +53,7 @@ func TestLocalBackendRun(t *testing.T) { t.Run("run", func(t *testing.T) { t.Parallel() - res := c.RunDockerCmd("run", "-d", "nginx") + res := c.RunDockerCmd("run", "-d", "nginx:alpine") containerName := strings.TrimSpace(res.Combined()) t.Cleanup(func() { _ = c.RunDockerOrExitError("rm", "-f", containerName) @@ -64,7 +64,7 @@ func TestLocalBackendRun(t *testing.T) { t.Run("run rm", func(t *testing.T) { t.Parallel() - res := c.RunDockerCmd("run", "--rm", "-d", "nginx") + res := c.RunDockerCmd("run", "--rm", "-d", "nginx:alpine") containerName := strings.TrimSpace(res.Combined()) t.Cleanup(func() { _ = c.RunDockerOrExitError("rm", "-f", containerName) @@ -81,7 +81,7 @@ func TestLocalBackendRun(t *testing.T) { }) t.Run("run with ports", func(t *testing.T) { - res := c.RunDockerCmd("run", "-d", "-p", "85:80", "nginx") + res := c.RunDockerCmd("run", "-d", "-p", "85:80", "nginx:alpine") containerName := strings.TrimSpace(res.Combined()) t.Cleanup(func() { _ = c.RunDockerOrExitError("rm", "-f", containerName) @@ -101,7 +101,7 @@ func TestLocalBackendRun(t *testing.T) { fields := strings.Fields(line) if fields[0] == nginxID { nginxFound = true - assert.Equal(t, fields[1], "nginx", res.Combined()) + assert.Equal(t, fields[1], "nginx:alpine", res.Combined()) assert.Equal(t, fields[2], "/docker-entrypoint.sh", res.Combined()) assert.Equal(t, fields[len(fields)-1], "0.0.0.0:85->80/tcp", res.Combined()) } @@ -109,7 +109,7 @@ func TestLocalBackendRun(t *testing.T) { assert.Assert(t, nginxFound, res.Stdout()) res = c.RunDockerCmd("ps", "--format", "json") - res.Assert(t, icmd.Expected{Out: `"Image":"nginx","Status":"Up Less than a second","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Ports":["0.0.0.0:85->80/tcp"`}) + res.Assert(t, icmd.Expected{Out: `"Image":"nginx:alpine","Status":"Up Less than a second","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Ports":["0.0.0.0:85->80/tcp"`}) res = c.RunDockerCmd("ps", "--quiet") res.Assert(t, icmd.Expected{Out: nginxID + "\n"})