-
Notifications
You must be signed in to change notification settings - Fork 5
feat(coalesce): Add tests for coalesce #290
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
72580ab
to
8cdbea9
Compare
For the failing test: waiting for #291 to be resolved. |
action="append", | ||
default=[], | ||
help="Format of VDI to execute tests on." | ||
"Example: vhd,qcow2" |
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.
Making this a CLI parameter means you're deporting the test job definition outside pytest. When rishi wanted to do the same for thin vs thick in the context of XOSTOR tests, we asked him to rework the tests so they actually test both formats.
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.
It's to allow to test only one type by hand, the objectives for tests is to keep the default which at the moment is vhd
but will be ["vhd", "qcow2"]
eventually.
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.
pytest already has test selection mechanisms:
- path to test files
-k
-m
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.
As long as the parameter is not necessary in jobs.py
, fine by me. We won't have SR types that only support VHD or only support QCOW2 at some point?
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.
The parameter default to VHD when not given meaning it's not needed to change jobs.py. But I will need to add the new coalesce tests in jobs.py either way and it's the only test at the moment that will use vdi-type
I'm not sure to see how the other selection mechanisms from pytest could work in this case.
@@ -75,6 +75,13 @@ def pytest_addoption(parser): | |||
"4KiB blocksize to be formatted and used in storage tests. " | |||
"Set it to 'auto' to let the fixtures auto-detect available disks." | |||
) | |||
parser.addoption( | |||
"--image-format", |
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.
When you work in the context of storage everyday, maybe it's a clear name, but otherwise it might be too generic a name. Both image
and format
can be many things.
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.
It's why I added vdi-image-format
as suggestion.
But I wonder if we should not use the naming volume-image-format
instead.
No preference.
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.
And vdi-type
looked consistent with sm
's terminology 🤔
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.
# xe vdi-list params=type | sort | uniq
type ( RO) : CBT metadata
type ( RO) : HA statefile
type ( RO) : Redo log
type ( RO) : User
Not really consistent. In this example here, type is completly different.
- On the XAPI side, we have a
vdi_type
stored in the sm-config attribute. Here you can have the VHD/AIO value. However there are weird situations like:sm-config (MRO) : type: raw; vdi_type: aio
. - Regarding the new QCOW2 format we discussed internally to use a new attribute image-format.
type
is completely ambiguous depending on what you are talking about and the context in which it is used. - In the SMAPIv3, vdi type is completly removed (same for VDI, we use
volume
instead). Andimage-format
is used.
I thought it would take a bit longer before it showed again! |
Add a vdi-type parameter to parametrize the vdi_type fixture, it default to vhd at the moment, will be used to run test on other vdi type, e.g. qcow2. The tests create a VDI, connect it to Dom0 then use the tapdev to write random data somewhere in it. It then compare the data of the VDI to the original data we have to see if it has changed. The test create snapshot/clone before deleting them and waiting for the coalesce to have happened by observing sm-config:vhd-parent before checking the integrity of the data. Signed-off-by: Damien Thenot <[email protected]>
The tests create a VDI, connect it to Dom0 then use the tapdev to write random data somewhere in it.
It then compare the data of the VDI to the original data we have to see if it has changed.
The test create snapshot/clone before deleting them and waiting for the coalesce to have happened by observing
sm-config:vhd-parent
before checking the integrity of the data.Also add
--vdi-type
parameter that default tovhd
to prepare to tests multiple VDI types, i.e. qcow2.