Skip to content

Commit 1b94395

Browse files
author
Mrunal Patel
authored
Merge pull request #2476 from kolyshkin/cpt-err-log
fixups to tests/int/checkpoint.bats
2 parents 834c457 + e232a71 commit 1b94395

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/integration/checkpoint.bats

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function teardown() {
1717
function setup_pipes() {
1818
# The changes to 'terminal' are needed for running in detached mode
1919
update_config ' (.. | select(.terminal? != null)) .terminal |= false
20-
| (.. | select(.[]? == "sh")) += ["-c", "for i in `seq 10`; do read xxx || continue; echo ponG $xxx; done"]'
20+
| (.. | select(.[]? == "sh")) += ["-c", "for i in `seq 10`; do read xxx || continue; echo ponG $xxx; done"]'
2121

2222
# Create two sets of pipes
2323
# for stdout/stderr
@@ -58,9 +58,8 @@ function simple_cr() {
5858

5959
# restore from checkpoint
6060
runc --criu "$CRIU" restore -d --work-path ./work-dir --console-socket $CONSOLE_SOCKET test_busybox
61-
ret=$?
6261
cat ./work-dir/restore.log | grep -B 5 Error || true
63-
[ "$ret" -eq 0 ]
62+
[ "$status" -eq 0 ]
6463

6564
# busybox should be back up and running
6665
testcontainer test_busybox running
@@ -76,7 +75,7 @@ function simple_cr() {
7675
requires cgroups_v1
7776

7877
# enable CGROUPNS
79-
update_config '.linux.namespaces += [{"type": "cgroup"}]'
78+
update_config '.linux.namespaces += [{"type": "cgroup"}]'
8079

8180
simple_cr
8281
}
@@ -134,7 +133,7 @@ function simple_cr() {
134133
setup_pipes
135134

136135
# This should not be necessary: https://github.com/checkpoint-restore/criu/issues/575
137-
update_config '(.. | select(.readonly? != null)) .readonly |= false'
136+
update_config '(.. | select(.readonly? != null)) .readonly |= false'
138137

139138
# TCP port for lazy migration
140139
port=27277
@@ -181,7 +180,9 @@ function simple_cr() {
181180
# Killing the CRIU on the checkpoint side will let the container
182181
# continue to run if the migration failed at some point.
183182
__runc --criu "$CRIU" restore -d --work-path ./image-dir --image-path ./image-dir --lazy-pages test_busybox_restore <&60 >&51 2>&51
184-
[ $? -eq 0 ]
183+
ret=$?
184+
cat ./work-dir/restore.log | grep -B 5 Error || true
185+
[ $ret -eq 0 ]
185186

186187
# busybox should be back up and running
187188
testcontainer test_busybox_restore running
@@ -268,7 +269,7 @@ function simple_cr() {
268269
tmplog2=`basename $tmplog2`
269270
# This adds the annotation 'org.criu.config' to set a container
270271
# specific CRIU config file.
271-
update_config '.annotations += {"org.criu.config": "'"$tmp"'"}'
272+
update_config '.annotations += {"org.criu.config": "'"$tmp"'"}'
272273

273274
# Tell CRIU to use another configuration file
274275
mkdir -p /etc/criu
@@ -283,6 +284,7 @@ function simple_cr() {
283284

284285
# checkpoint the running container
285286
runc --criu "$CRIU" checkpoint --work-path ./work-dir test_busybox
287+
cat ./work-dir/dump.log | grep -B 5 Error || true
286288
[ "$status" -eq 0 ]
287289
! test -f ./work-dir/$tmplog1
288290
test -f ./work-dir/$tmplog2
@@ -293,6 +295,7 @@ function simple_cr() {
293295
test -f ./work-dir/$tmplog2 && unlink ./work-dir/$tmplog2
294296
# restore from checkpoint
295297
runc --criu "$CRIU" restore -d --work-path ./work-dir --console-socket $CONSOLE_SOCKET test_busybox
298+
cat ./work-dir/restore.log | grep -B 5 Error || true
296299
[ "$status" -eq 0 ]
297300
! test -f ./work-dir/$tmplog1
298301
test -f ./work-dir/$tmplog2

0 commit comments

Comments
 (0)