socket: add tests
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
5480fb991d
commit
408f147fab
@ -1,18 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/dagger/op"
|
||||
"alpha.dagger.io/docker"
|
||||
)
|
||||
|
||||
TestDockerSocket: #up: [
|
||||
op.#Load & {
|
||||
from: docker.#Client
|
||||
},
|
||||
|
||||
op.#Exec & {
|
||||
always: true
|
||||
mount: "/var/run/docker.sock": "docker.sock"
|
||||
args: ["docker", "info"]
|
||||
},
|
||||
]
|
@ -148,9 +148,15 @@ setup() {
|
||||
assert_output --partial "secret=mySecret;hash="
|
||||
}
|
||||
|
||||
@test "compute: docker socket" {
|
||||
skip "docker socket support disabled"
|
||||
run "$DAGGER" compute "$TESTDIR"/compute/dockersocket
|
||||
@test "core: socket" {
|
||||
dagger init
|
||||
|
||||
dagger_new_with_plan test-socket "$TESTDIR"/core/socket
|
||||
|
||||
# Set dir input
|
||||
"$DAGGER" input socket dockersocket /var/run/docker.sock
|
||||
|
||||
"$DAGGER" up
|
||||
}
|
||||
|
||||
@test "compute: exclude" {
|
||||
|
23
tests/core/socket/main.cue
Normal file
23
tests/core/socket/main.cue
Normal file
@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/dagger"
|
||||
"alpha.dagger.io/dagger/op"
|
||||
"alpha.dagger.io/alpine"
|
||||
)
|
||||
|
||||
dockersocket: dagger.#Socket & dagger.#Input
|
||||
|
||||
TestDockerSocket: #up: [
|
||||
op.#Load & {
|
||||
from: alpine.#Image & {
|
||||
package: "docker-cli": true
|
||||
}
|
||||
},
|
||||
|
||||
op.#Exec & {
|
||||
always: true
|
||||
mount: "/var/run/docker.sock": socket: dockersocket
|
||||
args: ["docker", "info"]
|
||||
},
|
||||
]
|
Reference in New Issue
Block a user