mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Add $RUNC_USE_SYSTEMD to use systemd cgroup driver in tests
This allows us to test runc using libcontainer's systemd driver, by passing an extra `--systemd-cgroup` argument to the calls to runc. Tested: $ sudo make localintegration TESTPATH='/exec.bats' RUNC_USE_SYSTEMD=1 And confirmed that systemd was in use by looking at creation and removal of libcontainer_<pid>_systemd_test_default.slice test slices. Also introduced a breakage in systemd cgroup driver and confirmed that the tests failed as expected. Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
@@ -133,7 +133,7 @@ function teardown() {
|
||||
runc run -d --console-socket $CONSOLE_SOCKET test_busybox
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
run bash -c "cat hello > preserve-fds.test; exec 3<preserve-fds.test; $RUNC --log /proc/self/fd/2 --root $ROOT exec --preserve-fds=1 test_busybox cat /proc/self/fd/3"
|
||||
run bash -c "cat hello > preserve-fds.test; exec 3<preserve-fds.test; $RUNC ${RUNC_USE_SYSTEMD:+--systemd-cgroup} --log /proc/self/fd/2 --root $ROOT exec --preserve-fds=1 test_busybox cat /proc/self/fd/3"
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
[[ "${output}" == *"hello"* ]]
|
||||
|
||||
@@ -61,7 +61,7 @@ function runc() {
|
||||
|
||||
# Raw wrapper for runc.
|
||||
function __runc() {
|
||||
"$RUNC" --log /proc/self/fd/2 --root "$ROOT" "$@"
|
||||
"$RUNC" ${RUNC_USE_SYSTEMD+--systemd-cgroup} --log /proc/self/fd/2 --root "$ROOT" "$@"
|
||||
}
|
||||
|
||||
# Wrapper for runc spec, which takes only one argument (the bundle path).
|
||||
|
||||
Reference in New Issue
Block a user