Skip to content

Commit fdee865

Browse files
committed
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: 98f0041 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1 parent 23c6e4f commit fdee865

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libcontainer/integration/checkpoint_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ func testCheckpoint(t *testing.T, userns bool) {
133133
ok(t, err)
134134
defer remove(imagesDir)
135135

136+
relParentDir, err := filepath.Rel(imagesDir, parentDir)
137+
ok(t, err)
136138
checkpointOpts := &libcontainer.CriuOpts{
137139
ImagesDirectory: imagesDir,
138140
WorkDirectory: imagesDir,
139-
ParentImage: "../criu-parent",
141+
ParentImage: relParentDir,
140142
}
141143
dumpLog := filepath.Join(checkpointOpts.WorkDirectory, "dump.log")
142144
restoreLog := filepath.Join(checkpointOpts.WorkDirectory, "restore.log")

0 commit comments

Comments
 (0)