Skip to content

contest: add checkpoint/restore integration tests#3448

Open
nayuta723 wants to merge 1 commit intoyouki-dev:mainfrom
nayuta723:add-skelton-checkpoint-restore-test
Open

contest: add checkpoint/restore integration tests#3448
nayuta723 wants to merge 1 commit intoyouki-dev:mainfrom
nayuta723:add-skelton-checkpoint-restore-test

Conversation

@nayuta723
Copy link
Contributor

@nayuta723 nayuta723 commented Mar 8, 2026

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:

  • checkpoint and restore
  • checkpoint and restore (bind mount, destination is symlink)
  • checkpoint and restore (with --debug)
  • checkpoint and restore (cgroupns)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test updates
  • CI/CD related changes
  • Other (please describe):

Testing

  • Added new unit tests
  • Added new integration tests
  • Ran existing test suite
  • Tested manually (please provide steps)

Related Issues

Related #3447
Closed #3444

Additional Context

The remaining tests (pre-dump, lazy-pages, netdevice, etc.) will be added in follow-up PRs.

}
}

pub fn is_runtime_youki() -> bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #3444

@nayuta723 nayuta723 marked this pull request as draft March 8, 2026 13:05
@nayuta723 nayuta723 force-pushed the add-skelton-checkpoint-restore-test branch from b8e77a1 to 17b2af7 Compare March 8, 2026 16:23
@nayuta723 nayuta723 marked this pull request as ready for review March 8, 2026 16:24
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@nayuta723 nayuta723 force-pushed the add-skelton-checkpoint-restore-test branch from 17b2af7 to eccae7d Compare March 15, 2026 08:30
@nayuta723 nayuta723 requested review from YJDoc2 and saku3 March 17, 2026 15:21
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.

[Test]: Add is_runtime_youki() helper to contest test framework for consistent skip logic

3 participants