engine: exec: add mount service tests

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-12-17 15:39:32 +01:00
parent e7d8f17884
commit 85114025e6
2 changed files with 30 additions and 0 deletions

View File

@ -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

View File

@ -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"]
}
}
}