Skip to content

integration: Move destination device initialization to the provider#447

Open
claudiubelu wants to merge 2 commits into
cloudbase:masterfrom
claudiubelu:integration-provider-agnosticism
Open

integration: Move destination device initialization to the provider#447
claudiubelu wants to merge 2 commits into
cloudbase:masterfrom
claudiubelu:integration-provider-agnosticism

Conversation

@claudiubelu
Copy link
Copy Markdown
Member

Currently, we create a destination device in the test base. However, the import provider is supposed to create the disks for transfered as required.

Moving this part into the test provider will make it easier for us to swap in other providers later on.

Currently, we create a destination device in the test base. However, the
import provider is supposed to create the disks for transfered as required.

Moving this part into the test provider will make it easier for us to
swap in other providers later on.
@claudiubelu claudiubelu force-pushed the integration-provider-agnosticism branch 2 times, most recently from d163b91 to 4792cce Compare May 28, 2026 17:01

@property
def are_disks_local(self) -> bool:
"""True if destination disks are local block devices on the test host.
Copy link
Copy Markdown
Member

@petrutlucian94 petrutlucian94 May 29, 2026

Choose a reason for hiding this comment

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

I don't like this design. It doesn't really matter if the disks are local, provider agnostic tests shouldn't directly touch resources created by the providers, otherwise they're no longer provider agnostic.

We should clearly separate provider agnostic tests from those that rely on the "test provider" and interact with the created resources (e.g. scsi debug devices).

Without a proper design and clear limitations, our tests are going to become a mess and we'll refactor them every other week. We don't want that.

For what is worth, Openstack's Tempest tests are completely driver agnostic. They do have "functional tests" that call directly into the provider, but hose are completely separate.

https://github.com/openstack/nova/tree/master/nova/tests/functional/libvirt

Introduces an `ImportProviderHarness` ABC that encapsulates all
import-provider-specific logic that cannot be expressed through static
configuration:

- `check_prerequisites()`: gate the test suite on required infrastructure
  (e.g. the data-minion Docker image).
- `prepare_transfer()`: allocate per-transfer destination resources
  (cloud volume, etc.) and return the matching destination_environment dict.
- `get_connection_info()`: for endpoint configuration.
- `check_no_resources_leaked()`: resource leak checks.
- `cleanup_deployed_instance(instance_name)`: removes VMs from completed
  deployments.

Adds an implementation for it, TestImportHarness (test_provider/harness.py).
@claudiubelu claudiubelu force-pushed the integration-provider-agnosticism branch from 4792cce to ab7ec16 Compare May 29, 2026 09:36
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.

2 participants