integration: Move destination device initialization to the provider#447
integration: Move destination device initialization to the provider#447claudiubelu wants to merge 3 commits into
Conversation
d163b91 to
4792cce
Compare
|
|
||
| @property | ||
| def are_disks_local(self) -> bool: | ||
| """True if destination disks are local block devices on the test host. |
There was a problem hiding this comment.
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
4792cce to
ab7ec16
Compare
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.
ab7ec16 to
7da7ce5
Compare
| environment: {} | ||
|
|
||
| # Storage backend mapping (source identifier -> destination pool / datastore). | ||
| storage_mappings: {} |
There was a problem hiding this comment.
I think we'll also need source/target environment settings.
| except Exception: | ||
| pass | ||
|
|
||
| def uses_test_import_provider(self): |
There was a problem hiding this comment.
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?
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.