mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct: criuSwrk: only iterate over CriuOpts if debug is set
In case log level is less than debug, this code does nothing, so let's add a condition and skip it entirely. Add a test case to make sure this code path is hit. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -97,7 +97,7 @@ function simple_cr() {
|
||||
|
||||
for _ in $(seq 2); do
|
||||
# checkpoint the running container
|
||||
runc --criu "$CRIU" checkpoint --work-path ./work-dir test_busybox
|
||||
runc --criu "$CRIU" "$@" checkpoint --work-path ./work-dir test_busybox
|
||||
grep -B 5 Error ./work-dir/dump.log || true
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
@@ -105,7 +105,7 @@ function simple_cr() {
|
||||
testcontainer test_busybox checkpointed
|
||||
|
||||
# restore from checkpoint
|
||||
runc --criu "$CRIU" restore -d --work-path ./work-dir --console-socket "$CONSOLE_SOCKET" test_busybox
|
||||
runc --criu "$CRIU" "$@" restore -d --work-path ./work-dir --console-socket "$CONSOLE_SOCKET" test_busybox
|
||||
grep -B 5 Error ./work-dir/restore.log || true
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
@@ -118,6 +118,10 @@ function simple_cr() {
|
||||
simple_cr
|
||||
}
|
||||
|
||||
@test "checkpoint and restore (with --debug)" {
|
||||
simple_cr --debug
|
||||
}
|
||||
|
||||
@test "checkpoint and restore (cgroupns)" {
|
||||
# cgroupv2 already enables cgroupns so this case was tested above already
|
||||
requires cgroups_v1 cgroupns
|
||||
|
||||
Reference in New Issue
Block a user