Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/int: fix error handling and logging #2548

Merged
merged 1 commit into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions tests/integration/checkpoint.bats
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function simple_cr() {

# run busybox
__runc run -d test_busybox <&${in_r} >&${out_w} 2>&${out_w}
[ $? -eq 0 ]

testcontainer test_busybox running

Expand All @@ -120,8 +119,8 @@ function simple_cr() {
testcontainer test_busybox checkpointed

# restore from checkpoint
__runc --criu "$CRIU" restore -d --work-path ./work-dir --image-path ./image-dir test_busybox <&${in_r} >&${out_w} 2>&${out_w}
ret=$?
ret=0
__runc --criu "$CRIU" restore -d --work-path ./work-dir --image-path ./image-dir test_busybox <&${in_r} >&${out_w} 2>&${out_w} || ret=$?
cat ./work-dir/restore.log | grep -B 5 Error || true
[ $ret -eq 0 ]

Expand Down Expand Up @@ -149,7 +148,6 @@ function simple_cr() {

# run busybox
__runc run -d test_busybox <&${in_r} >&${out_w} 2>&${out_w}
[ $? -eq 0 ]

testcontainer test_busybox running

Expand Down Expand Up @@ -191,8 +189,8 @@ function simple_cr() {
# in time when the last page is lazily transferred to the destination.
# Killing the CRIU on the checkpoint side will let the container
# continue to run if the migration failed at some point.
__runc --criu "$CRIU" restore -d --work-path ./image-dir --image-path ./image-dir --lazy-pages test_busybox_restore <&${in_r} >&${out_w} 2>&${out_w}
ret=$?
ret=0
__runc --criu "$CRIU" restore -d --work-path ./image-dir --image-path ./image-dir --lazy-pages test_busybox_restore <&${in_r} >&${out_w} 2>&${out_w} || ret=$?
cat ./work-dir/restore.log | grep -B 5 Error || true
[ $ret -eq 0 ]

Expand All @@ -204,10 +202,8 @@ function simple_cr() {
[[ ${output} == "ok" ]]

wait $cpt_pid
[ $? -eq 0 ]

wait $lp_pid
[ $? -eq 0 ]
PIDS_TO_KILL=()

check_pipes
Expand Down Expand Up @@ -253,9 +249,8 @@ function simple_cr() {

# restore from checkpoint; this should restore the container into the existing network namespace
runc --criu "$CRIU" restore -d --work-path ./work-dir --console-socket $CONSOLE_SOCKET test_busybox
ret=$?
cat ./work-dir/restore.log | grep -B 5 Error || true
[ "$ret" -eq 0 ]
[ "$status" -eq 0 ]

# busybox should be back up and running
testcontainer test_busybox running
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/hooks.bats
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ function teardown() {

echo "Checking create-runtime library"
echo $output | grep $HOOKLIBCR
[ "$?" -eq 0 ]

echo "Checking create-container library"
echo $output | grep $HOOKLIBCC
[ "$?" -eq 0 ]
}