contest: add checkpoint/restore integration tests#3448
contest: add checkpoint/restore integration tests#3448nayuta723 wants to merge 1 commit intoyouki-dev:mainfrom
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
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>
17b2af7 to
eccae7d
Compare
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.