contest: add checkpoint/restore integration tests#3448
Conversation
| } | ||
| } | ||
|
|
||
| pub fn is_runtime_youki() -> bool { |
b8e77a1 to
17b2af7
Compare
There was a problem hiding this comment.
Can we move the do_checkpoint and do_restore functions (and any other helper functions) in the test_utils.rs where rest of the lifecycle functions are? That way those can be reused in other files/tests which we might add in future as well. It also has the fns to start the runtime command with args, which we might be able to reuse in this functions.
Also can you check once that when checkpoint/restore test/command will fail we do the correct cleanup of whatever we have created for checkpoint or restore commands?
| cleanup(&bundle, &id); | ||
| return r; | ||
| } | ||
|
|
There was a problem hiding this comment.
Please verify that runc/youki state <id> fails.
In other words, confirm that the container state is no longer available.
ref testcontainer test_busybox checkpointed
https://github.com/opencontainers/runc/blob/main/tests/integration/checkpoint.bats#L132
https://github.com/opencontainers/runc/blob/fd0388b2c4771ca6537f072d0981daa2b110fa8a/tests/integration/helpers.bash#L733
17b2af7 to
eccae7d
Compare
saku3
left a comment
There was a problem hiding this comment.
Thanks!
Overall, I think it looks fine.
It would be better to add or revise some comments.
|
|
||
| /// Used as check_fn for all ConditionalTests in this module: | ||
| /// run only when the runtime is NOT youki and CRIU is installed. | ||
| fn can_run() -> bool { |
There was a problem hiding this comment.
Add a TODO comment explaining why the test is skipped for youki.
for example
// TODO: remove this skip for youki once checkpoint/restore is supported.
| } | ||
| } | ||
|
|
||
| /// Checkpoint a running container into `image_dir`. |
There was a problem hiding this comment.
These comments seem to belong to the checkpoint_container function.
Add a new `checkpoint_restore` test group to the contest integration test suite, based on runc's checkpoint.bats. - Add `checkpoint_restore` module with four tests covering basic C/R, bind-mount-symlink, --debug flag, and cgroupns - Add `run_container`, `wait_container_running`, `checkpoint_container`, `restore_container`, and `criu_installed` to `utils/test_utils` - Export `is_runtime_youki` from `utils/support` - Move `criu_installed` from `lifecycle/util` to `utils`, making it available to all test modules - Use a RAII `ContainerGuard` for reliable cleanup and an immediately-invoked closure for the run+wait pattern Tests are skipped when running with youki or when CRIU is not installed on the host. Signed-off-by: nayuta723 <nayuta723@gmail.com>
eccae7d to
ef5f98d
Compare
|
Thanks! |
Description
Add checkpoint/restore integration tests to the contest framework,
based on runc's
tests/integration/checkpoint.bats.Tests are skipped when running with youki (checkpoint/restore not yet
implemented) and when CRIU is not installed on the host.
The following 4 tests are implemented:
Type of Change
Testing
Related Issues
Related #3447
Closed #3444
Additional Context
The remaining tests (pre-dump, lazy-pages, netdevice, etc.) will be added in follow-up PRs.