-
Notifications
You must be signed in to change notification settings - Fork 6
Add tests for corruption recovery on LINSTOR SR #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
klmp200
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, lgtm
|
|
||
| @pytest.fixture(scope='function') | ||
| def host_and_corrupted_vdi_on_linstor_sr(host, linstor_sr, vm_ref): | ||
| vm: VM = host.import_vm(vm_ref, sr_uuid=linstor_sr.uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be created in a fixture
That would avoid the big try/catch at the end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need the VM lifetime to be directly tied to the fixture's lifetime and since we already have a vm_on_linstor_sr fixture with the "innapropriate" scope we would have double the fixture with different scopes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth a comment ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break when vm_ref is a UUID referring to an existing VM. This also totally bypasses local cache for imported VMs.
If it's best to import a VM and you don't care which VM, that there's no advantage in , then you should import one of the mini VMs without depending on vm_ref, as we already do in some storage tests:
vm = host.import_vm(vm_image('mini-linux-x86_64-bios'), sr_uuid=sr.uuid)
On the contrary, if you want the test to run with any VM we can test (as part of a "multi" job), then maybe you should still rely on the imported_vm fixture, but then copy it to the SR where you need it.
And if what you want is actually an empty VM with just a disk that you can break, then maybe it's time we implemented creating a VM from scratch, without relying on an XVA.
Worth a discussion.
e65c96c to
5af35f6
Compare
rzr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few remarks but not my expertise (yet)
5af35f6 to
76186f2
Compare
70925ed to
d1fafa5
Compare
Tests DRBD's corruption recovery using drbdadm verify and invalidate-remote commands as well as basic VM operations (startup, snapshot, shutdown) Signed-off-by: Mathieu Labourier <mathieu.labourier@vates.tech>
6ebf72d to
d6b53e9
Compare
| pool: Pool = host.pool | ||
| master: Host = pool.master | ||
|
|
||
| def get_vdi_volume_name_from_linstor() -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the helper functions local to the fixture definition. There's no chance we could reuse them in other tests? This makes the fixture definition rather big.
| vm.destroy(verify=True) | ||
|
|
||
| @pytest.fixture(scope='function') | ||
| def host_and_corrupted_vdi_on_linstor_sr(host: Host, linstor_sr: SR, vm_ref: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May this function-scope fixture be reused in future tests? If yes, I think conftest.py is the right location for it. If not, it would be better defined close to the only function that currently requires it.
|
|
||
| @pytest.fixture(scope='function') | ||
| def host_and_corrupted_vdi_on_linstor_sr(host, linstor_sr, vm_ref): | ||
| vm: VM = host.import_vm(vm_ref, sr_uuid=linstor_sr.uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break when vm_ref is a UUID referring to an existing VM. This also totally bypasses local cache for imported VMs.
If it's best to import a VM and you don't care which VM, that there's no advantage in , then you should import one of the mini VMs without depending on vm_ref, as we already do in some storage tests:
vm = host.import_vm(vm_image('mini-linux-x86_64-bios'), sr_uuid=sr.uuid)
On the contrary, if you want the test to run with any VM we can test (as part of a "multi" job), then maybe you should still rely on the imported_vm fixture, but then copy it to the SR where you need it.
And if what you want is actually an empty VM with just a disk that you can break, then maybe it's time we implemented creating a VM from scratch, without relying on an XVA.
Worth a discussion.
Tests DRBD's corruption recovery using drbdadm verify and invalidate-remote commands as well as basic VM operations (startup, snapshot, shutdown)