mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
66bf3718b4
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>
60 lines
1.0 KiB
Bash
60 lines
1.0 KiB
Bash
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
function setup() {
|
|
setup_busybox
|
|
update_config '.process.args = ["/bin/echo", "Hello World"]'
|
|
}
|
|
|
|
function teardown() {
|
|
teardown_bundle
|
|
}
|
|
|
|
@test "runc run" {
|
|
runc run test_hello
|
|
[ "$status" -eq 0 ]
|
|
|
|
runc state test_hello
|
|
[ "$status" -ne 0 ]
|
|
}
|
|
|
|
@test "runc run --keep" {
|
|
runc run --keep test_run_keep
|
|
[ "$status" -eq 0 ]
|
|
|
|
testcontainer test_run_keep stopped
|
|
|
|
runc state test_run_keep
|
|
[ "$status" -eq 0 ]
|
|
|
|
runc delete test_run_keep
|
|
|
|
runc state test_run_keep
|
|
[ "$status" -ne 0 ]
|
|
}
|
|
|
|
@test "runc run --keep (check cgroup exists)" {
|
|
# for systemd driver, the unit's cgroup path will be auto removed if container's all processes exited
|
|
requires no_systemd
|
|
[ $EUID -ne 0 ] && requires rootless_cgroup
|
|
|
|
set_cgroups_path
|
|
|
|
runc run --keep test_run_keep
|
|
[ "$status" -eq 0 ]
|
|
|
|
testcontainer test_run_keep stopped
|
|
|
|
runc state test_run_keep
|
|
[ "$status" -eq 0 ]
|
|
|
|
# check that cgroup exists
|
|
check_cgroup_value "pids.max" "max"
|
|
|
|
runc delete test_run_keep
|
|
|
|
runc state test_run_keep
|
|
[ "$status" -ne 0 ]
|
|
}
|