Move tests plan from dagger dir to universe
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
26
stdlib/os/tests/container/container.cue
Normal file
26
stdlib/os/tests/container/container.cue
Normal file
@@ -0,0 +1,26 @@
|
||||
package os
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
)
|
||||
|
||||
// Test secret mount
|
||||
SimpleSecret: {
|
||||
// 'encrypted' and 'cleartext' must be set from identical values
|
||||
encrypted: dagger.#Secret @dagger(input)
|
||||
cleartext: string @dagger(input)
|
||||
|
||||
ctr: #Container & {
|
||||
secret: "/secret-in": encrypted
|
||||
command: "cat /secret-in > /secret-out"
|
||||
}
|
||||
|
||||
// Decrypted secret
|
||||
decrypted: (#File & {
|
||||
from: ctr
|
||||
path: "/secret-out"
|
||||
}).contents @dagger(output)
|
||||
|
||||
// Assertion: decrypted value must match original cleartext
|
||||
decrypted: cleartext
|
||||
}
|
25
stdlib/os/tests/os/os.cue
Normal file
25
stdlib/os/tests/os/os.cue
Normal file
@@ -0,0 +1,25 @@
|
||||
package os
|
||||
|
||||
import (
|
||||
"dagger.io/alpine"
|
||||
)
|
||||
|
||||
// Write a file to an empty dir
|
||||
EmptyDir: {
|
||||
f: #File & {
|
||||
path: "/foo.txt"
|
||||
write: data: "hello world!"
|
||||
}
|
||||
f: contents: "hello world!"
|
||||
}
|
||||
|
||||
// Read from a pre-existing file
|
||||
Read: {
|
||||
f: #File & {
|
||||
from: alpine.#Image & {
|
||||
version: "3.13.4"
|
||||
}
|
||||
path: "/etc/alpine-release"
|
||||
}
|
||||
f: contents: "3.13.4\n"
|
||||
}
|
Reference in New Issue
Block a user