Skip to content

Commit 5fb9713

Browse files
committed
[test] add some debug
Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent b6b95f9 commit 5fb9713

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

tests/integration/checkpoint.bats

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function teardown() {
3131
ip link del dev dummy0
3232
delete_netns
3333
teardown_bundle
34+
rm -f /etc/criu/default.conf
3435
}
3536

3637
function setup_pipes() {
@@ -172,7 +173,23 @@ function simple_cr_with_netdevice() {
172173
}
173174

174175
@test "checkpoint and restore" {
175-
simple_cr
176+
ls -l /etc/criu/ || true
177+
tail /etc/criu/* || true
178+
ls -l ~/.criu/ || true
179+
tail ~/.criu/* || true
180+
criu version
181+
182+
runc -0 run -d --console-socket "$CONSOLE_SOCKET" test_busybox
183+
184+
testcontainer test_busybox running
185+
186+
for _ in $(seq 2); do
187+
runc -0 "$@" checkpoint --work-path ./work-dir test_busybox
188+
testcontainer test_busybox checkpointed
189+
190+
runc -0 "$@" restore -d --work-path ./work-dir --console-socket "$CONSOLE_SOCKET" test_busybox
191+
testcontainer test_busybox running
192+
done
176193
}
177194

178195
@test "checkpoint and restore (bind mount, destination is symlink)" {
@@ -381,22 +398,21 @@ function simple_cr_with_netdevice() {
381398

382399
@test "checkpoint and restore with container specific CRIU config" {
383400
tmp=$(mktemp /tmp/runc-criu-XXXXXX.conf)
384-
# This is the file we write to /etc/criu/default.conf
401+
# Name we write to /etc/criu/default.conf.
385402
tmplog1=$(mktemp /tmp/runc-criu-log-XXXXXX.log)
386403
unlink "$tmplog1"
387404
tmplog1=$(basename "$tmplog1")
388-
# That is the actual configuration file to be used
405+
# Actual configuration file name to be used.
389406
tmplog2=$(mktemp /tmp/runc-criu-log-XXXXXX.log)
390407
unlink "$tmplog2"
391408
tmplog2=$(basename "$tmplog2")
392-
# This adds the annotation 'org.criu.config' to set a container
393-
# specific CRIU config file.
409+
# Add the annotation to set a container specific CRIU config file.
394410
update_config '.annotations += {"org.criu.config": "'"$tmp"'"}'
395411

396-
# Tell CRIU to use another configuration file
412+
# Tell CRIU to use another configuration file.
397413
mkdir -p /etc/criu
398414
echo "log-file=$tmplog1" >/etc/criu/default.conf
399-
# Make sure the RPC defined configuration file overwrites the previous
415+
# Make sure the RPC defined configuration file overwrites the default.conf.
400416
echo "log-file=$tmplog2" >"$tmp"
401417

402418
runc -0 run -d --console-socket "$CONSOLE_SOCKET" test_busybox

0 commit comments

Comments
 (0)