Skip to content

integration: Move destination device initialization to the provider#447

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

integration: Move destination device initialization to the provider#447
claudiubelu wants to merge 3 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.

@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

@claudiubelu claudiubelu force-pushed the integration-provider-agnosticism branch from 4792cce to ab7ec16 Compare May 29, 2026 09:36
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.
Introduces an `BaseTestImportProvider` ABC that contains provider-specific
logic not currently defined in the import providers, meant to be used for
testing-only purposes:
- detect leaked resources
- delete deployed replicas

Adds an implementation for it, in `TestImportProvider`.
- `_load_providers_config()`: parses the YAML file present at the
  CORIOLIS_PROVIDERS_YAML environment variable, which describes the
  destination provider, its connection info, target environment, storage
  mappings. If CORIOLIS_PROVIDERS_YAML is unset, the default test
  provider will be used instead.
- `CORIOLIS_CONFIG_FILE`: optional `oslo.config` file path, so provider
  packages can register and read their own config options.
- `providers.yaml.sample`: sample file for declaring providers.
- `tox.ini`: pass all `CORIOLIS_*` env vars through; set `PBR_VERSION` to avoid
  pbr version-detection failures.
- Randomizes `instance_name` used for transfer tests to avoid conflict.
- Fixes `connection_info` reference in `test_minion_pools.py`.
- Machine Pool allocation may take longer for other providers. 600s gives
  sufficient headroom.
@claudiubelu claudiubelu force-pushed the integration-provider-agnosticism branch from ab7ec16 to 7da7ce5 Compare June 3, 2026 08:07
environment: {}

# Storage backend mapping (source identifier -> destination pool / datastore).
storage_mappings: {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we'll also need source/target environment settings.

except Exception:
pass

def uses_test_import_provider(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a bit confusing since we'd always use a test provider that implements BaseTestImportProvider.

So I guess even for Openstack for example we'd need to have a test provider.

Would uses_core_test_import_provider make sense?

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