mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-26 19:41:35 +08:00

Currently only amd64 and arm64v8 tarball have been checked in testdata, while busybox bundle is downloaded on fly, and supports multiple architectures. To enable integration tests for more architectures, the hello world bundle is replaced by busybox one. Signed-off-by: Shengjing Zhu <zhsj@debian.org>
74 lines
1.7 KiB
Bash
74 lines
1.7 KiB
Bash
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
function setup() {
|
|
setup_busybox
|
|
update_config '.process.args = ["/bin/echo", "Hello World"]'
|
|
}
|
|
|
|
function teardown() {
|
|
teardown_bundle
|
|
}
|
|
|
|
function check_debug() {
|
|
[[ "$*" == *"nsexec container setup"* ]]
|
|
[[ "$*" == *"child process in init()"* ]]
|
|
[[ "$*" == *"init: closing the pipe to signal completion"* ]]
|
|
}
|
|
|
|
@test "global --debug" {
|
|
# run hello-world
|
|
runc --debug run test_hello
|
|
[ "$status" -eq 0 ]
|
|
|
|
# check expected debug output was sent to stderr
|
|
[[ "${output}" == *"level=debug"* ]]
|
|
check_debug "$output"
|
|
}
|
|
|
|
@test "global --debug to --log" {
|
|
# run hello-world
|
|
runc --log log.out --debug run test_hello
|
|
[ "$status" -eq 0 ]
|
|
|
|
# check output does not include debug info
|
|
[[ "${output}" != *"level=debug"* ]]
|
|
|
|
cat log.out >&2
|
|
# check expected debug output was sent to log.out
|
|
output=$(cat log.out)
|
|
[[ "${output}" == *"level=debug"* ]]
|
|
check_debug "$output"
|
|
}
|
|
|
|
@test "global --debug to --log --log-format 'text'" {
|
|
# run hello-world
|
|
runc --log log.out --log-format "text" --debug run test_hello
|
|
[ "$status" -eq 0 ]
|
|
|
|
# check output does not include debug info
|
|
[[ "${output}" != *"level=debug"* ]]
|
|
|
|
cat log.out >&2
|
|
# check expected debug output was sent to log.out
|
|
output=$(cat log.out)
|
|
[[ "${output}" == *"level=debug"* ]]
|
|
check_debug "$output"
|
|
}
|
|
|
|
@test "global --debug to --log --log-format 'json'" {
|
|
# run hello-world
|
|
runc --log log.out --log-format "json" --debug run test_hello
|
|
[ "$status" -eq 0 ]
|
|
|
|
# check output does not include debug info
|
|
[[ "${output}" != *"level=debug"* ]]
|
|
|
|
cat log.out >&2
|
|
# check expected debug output was sent to log.out
|
|
output=$(cat log.out)
|
|
[[ "${output}" == *'"level":"debug"'* ]]
|
|
check_debug "$output"
|
|
}
|