integration: Move destination device initialization to the provider#447
integration: Move destination device initialization to the provider#447claudiubelu wants to merge 2 commits into
Conversation
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.
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
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).
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.