From fdee8658dfcfdf04ca6466c5e9e58a47efc3cffa Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 27 Jul 2021 01:20:34 -0700 Subject: [PATCH] libct/int/checkpoint_test: fix ParentImage The ParentImage set by the test should be a path relative to ImagesDirectory, pointing to a parent images directory (created by pre-dump). The parent directory is created by TempDir and so its name is not constant but has a variable suffix. So, the config was pointing to a non-existent directory. This left unnoticed by criu as it assumed the parent image does not exist, and performed a full dump. Since criu PR 1403 (will be a part of criu 3.16) that is no longer the case -- the invalid parent path is treated as an error, and so our test fails like this: == RUN TestCheckpoint checkpoint_test.go:145: === /tmp/criu070876105/dump.log === checkpoint_test.go:145: open /tmp/criu070876105/dump.log: no such file or directory checkpoint_test.go:146: criu failed: type DUMP errno 56 log file: /tmp/criu070876105/dump.log --- FAIL: TestCheckpoint (0.26s) Fix this by using the actual name of the parent image dir. Fixes: 98f004182b9a23245 Signed-off-by: Kir Kolyshkin --- libcontainer/integration/checkpoint_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcontainer/integration/checkpoint_test.go b/libcontainer/integration/checkpoint_test.go index f2870ae05..0064e0000 100644 --- a/libcontainer/integration/checkpoint_test.go +++ b/libcontainer/integration/checkpoint_test.go @@ -133,10 +133,12 @@ func testCheckpoint(t *testing.T, userns bool) { ok(t, err) defer remove(imagesDir) + relParentDir, err := filepath.Rel(imagesDir, parentDir) + ok(t, err) checkpointOpts := &libcontainer.CriuOpts{ ImagesDirectory: imagesDir, WorkDirectory: imagesDir, - ParentImage: "../criu-parent", + ParentImage: relParentDir, } dumpLog := filepath.Join(checkpointOpts.WorkDirectory, "dump.log") restoreLog := filepath.Join(checkpointOpts.WorkDirectory, "restore.log")