Skip to content

nix: add cross-version migration tests#188

Open
arctic-alpaca wants to merge 1 commit intocyberus-technology:mainfrom
arctic-alpaca:version-migration-tests
Open

nix: add cross-version migration tests#188
arctic-alpaca wants to merge 1 commit intocyberus-technology:mainfrom
arctic-alpaca:version-migration-tests

Conversation

@arctic-alpaca
Copy link
Copy Markdown
Contributor

@arctic-alpaca arctic-alpaca commented Mar 26, 2026

Adds a new input for the previous version of cloud-hypervisor and passes that to the version_migrationtest. Theversion_migrationtest just runs the existinglive_migration` tests for two different cloud-hypervisor versions.

I've limited this PR to the live_migration tests, but long_migration_with_load can be done the same way.

I'm not sure if the nix: prefix is correct here.

Link to PR for libvirt: https://gitlab.cyberus-technology.de/cyberus/cloud/libvirt/-/merge_requests/153

To verify the behavior, I used a cloud-hypervisor branch that panics on migration. In CI, this shows only the newly added tests failing (timing out), which means the current cloud-hypervisor version is untouched, but the previous version is set as expected: https://gitlab.cyberus-technology.de/cyberus/cloud/libvirt/-/merge_requests/152

@arctic-alpaca arctic-alpaca force-pushed the version-migration-tests branch 4 times, most recently from 450a80d to aa9ebec Compare March 26, 2026 13:59
@arctic-alpaca arctic-alpaca marked this pull request as ready for review March 26, 2026 15:49
version_migration = createTestSuite {
inherit enablePortForwarding;
testScriptFile = ./testsuite_migration.py;
cloud-hypervisor-controller-override = pkgs.cloud-hypervisor-prev;
Copy link
Copy Markdown
Collaborator

@hertrste hertrste Mar 27, 2026

Choose a reason for hiding this comment

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

Shouldn't it be possible to reuse the existing extraControllerConfig parameter and do something like the following? This would save us from having to pass-through those new parameters. Or do I miss something?

extraControllerConfig = [ {...}: {
  nixpkgs.overlays = [
    (
      _final: _prev:
      (lib.optionalAttrs (cloud-hypervisor-override != null)) {
        # Overwrite the default cloud-hypervisor version.
        cloud-hypervisor = cloud-hypervisor-override;
      }
    )
  ];
};
];

Sorry for the slightly off formatting of the snippet. I have not tested if the snippet works. Just to transport my thought.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll look into it 👍 I'm not very familiar with Nix yet.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'll look into it 👍 I'm not very familiar with Nix yet.

Ah okay I see :D I'll hope it works correctly because I am not 100% sure how the overlays are applied in that case. But just give it a try and if it works as expected, we can remove the custom chv-override parameter again :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Way better, thank you!

@arctic-alpaca arctic-alpaca force-pushed the version-migration-tests branch from aa9ebec to edf2484 Compare March 27, 2026 14:06
Adds a new input for the previous version of cloud-hypervisor and passes
 that to the `version_migration` test. The `version_migration` test just
  runs the existing `live_migration` tests for two different
  cloud-hypervisor versions.

On-behalf-of: SAP julian.schindel@sap.com
Signed-off-by: Julian Schindel <julian.schindel@cyberus-technology.de>
@arctic-alpaca arctic-alpaca force-pushed the version-migration-tests branch from edf2484 to 824f749 Compare March 27, 2026 14:10
@phip1611
Copy link
Copy Markdown
Member

I'm not sure if the nix: prefix is correct here.

I personally use flake for purely flake-related stuff (adding dependency, bumping) and nix for everything else which is related to nix

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants