From 85114025e69bda2522e2dff8e0b00263fa411256 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Fri, 17 Dec 2021 15:39:32 +0100 Subject: [PATCH] engine: exec: add mount service tests Signed-off-by: Andrea Luzzardi --- tests/tasks.bats | 1 + tests/tasks/exec/mount_service.cue | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/tasks/exec/mount_service.cue diff --git a/tests/tasks.bats b/tests/tasks.bats index 88d2e163..a563d1cb 100644 --- a/tests/tasks.bats +++ b/tests/tasks.bats @@ -35,6 +35,7 @@ setup() { "$DAGGER" --europa up ./mount_fs.cue TESTSECRET="hello world" "$DAGGER" --europa up ./mount_secret.cue "$DAGGER" --europa up ./mount_tmp.cue + "$DAGGER" --europa up ./mount_service.cue "$DAGGER" --europa up ./user.cue "$DAGGER" --europa up ./workdir.cue diff --git a/tests/tasks/exec/mount_service.cue b/tests/tasks/exec/mount_service.cue new file mode 100644 index 00000000..2073b6e9 --- /dev/null +++ b/tests/tasks/exec/mount_service.cue @@ -0,0 +1,29 @@ +package main + +import ( + "alpha.dagger.io/europa/dagger/engine" +) + +engine.#Plan & { + context: services: dockerSocket: unix: "/var/run/docker.sock" + + actions: { + image: engine.#Pull & { + source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" + } + + imageWithDocker: engine.#Exec & { + input: image.output + args: ["apk", "add", "--no-cache", "docker-cli"] + } + + verify: engine.#Exec & { + input: imageWithDocker.output + mounts: docker: { + dest: "/var/run/docker.sock" + contents: context.services.dockerSocket.service + } + args: ["docker", "info"] + } + } +}