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

libct/int/checkpoint_test: fix ParentImage (and bogus failure with criu 3.16) #3112

Closed

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Jul 27, 2021

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 (meaning the pre-dump was not used).

Since criu PR checkpoint-restore/criu#1403 (which 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

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>
@kolyshkin
Copy link
Contributor Author

Somewhat related: #2913

@adrianreber @liusdu PTAL

@kolyshkin kolyshkin changed the title libct/int/checkpoint_test: fix ParentImage (and criu 3.16 compatibility) libct/int/checkpoint_test: fix ParentImage (and bogus failure with criu 3.16) Jul 27, 2021
@adrianreber
Copy link
Contributor

Looks correct. Just recently I did a similar fix in Podman.

@avagin
Copy link
Contributor

avagin commented Jul 28, 2021

LGTM

@kolyshkin
Copy link
Contributor Author

OK it seems that the same bug is implicitly fixed by commit 3bc606e (which switches to a single upper temp dir and fixed criu-parent and criu subdirs, so ../criu-parent is now valid.

IOW, this is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants