Skip to content

Commit 8b0a1a7

Browse files
committed
[test] add some debug
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1 parent 45a7cc4 commit 8b0a1a7

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ jobs:
7979
run: |
8080
sudo apt -qy install \
8181
libcap-dev libnet1-dev libnl-3-dev uuid-dev \
82-
libprotobuf-c-dev libprotobuf-dev protobuf-c-compiler protobuf-compiler
82+
libprotobuf-c-dev libprotobuf-dev protobuf-c-compiler protobuf-compiler \
83+
strace
8384
git clone --depth 1 --revision ${{ matrix.criu }} \
8485
https://github.com/checkpoint-restore/criu.git ~/criu
8586
(cd ~/criu && sudo make -j $(nproc) install-criu)

tests/integration/checkpoint.bats

Lines changed: 22 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,22 @@ 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+
181+
runc -0 run -d --console-socket "$CONSOLE_SOCKET" test_busybox
182+
183+
testcontainer test_busybox running
184+
185+
for _ in $(seq 2); do
186+
runc -0 "$@" checkpoint --work-path ./work-dir test_busybox
187+
testcontainer test_busybox checkpointed
188+
189+
runc -0 "$@" restore -d --work-path ./work-dir --console-socket "$CONSOLE_SOCKET" test_busybox
190+
testcontainer test_busybox running
191+
done
176192
}
177193

178194
@test "checkpoint and restore (bind mount, destination is symlink)" {
@@ -381,22 +397,21 @@ function simple_cr_with_netdevice() {
381397

382398
@test "checkpoint and restore with container specific CRIU config" {
383399
tmp=$(mktemp /tmp/runc-criu-XXXXXX.conf)
384-
# This is the file we write to /etc/criu/default.conf
400+
# Name we write to /etc/criu/default.conf.
385401
tmplog1=$(mktemp /tmp/runc-criu-log-XXXXXX.log)
386402
unlink "$tmplog1"
387403
tmplog1=$(basename "$tmplog1")
388-
# That is the actual configuration file to be used
404+
# Actual configuration file name to be used.
389405
tmplog2=$(mktemp /tmp/runc-criu-log-XXXXXX.log)
390406
unlink "$tmplog2"
391407
tmplog2=$(basename "$tmplog2")
392-
# This adds the annotation 'org.criu.config' to set a container
393-
# specific CRIU config file.
408+
# Add the annotation to set a container specific CRIU config file.
394409
update_config '.annotations += {"org.criu.config": "'"$tmp"'"}'
395410

396-
# Tell CRIU to use another configuration file
411+
# Tell CRIU to use another configuration file.
397412
mkdir -p /etc/criu
398413
echo "log-file=$tmplog1" >/etc/criu/default.conf
399-
# Make sure the RPC defined configuration file overwrites the previous
414+
# Make sure the RPC defined configuration file overwrites the default.conf.
400415
echo "log-file=$tmplog2" >"$tmp"
401416

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

0 commit comments

Comments
 (0)