-
Notifications
You must be signed in to change notification settings - Fork 6
vdi export/import tests #368
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: gln/xva-export-integrity
Are you sure you want to change the base?
Conversation
230f06d to
9c9cc72
Compare
04dc842 to
40b31bf
Compare
9c9cc72 to
92c11bb
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.
Can't duplicated code be factorized ? or this is not desired in context of pytests ?
We do apply this principle in general, I don't know why not in this specific case, but I agree, we could definitely move the repeated code to a utility function, as we've done for live migration tests in the same storage test packages. |
It's just because at first there was a significant number of differences, but most of them are gone. I'll move it to a utility function |
40b31bf to
b0b5cde
Compare
5e92156 to
6fe53b8
Compare
b0b5cde to
5d82813
Compare
5d82813 to
37110a4
Compare
6fe53b8 to
17fc45a
Compare
37110a4 to
f6c3f34
Compare
17fc45a to
9ddd3f9
Compare
f6c3f34 to
ef699b4
Compare
9ddd3f9 to
26a1a1d
Compare
| imported_vm.destroy() | ||
| vm.host.ssh(f'rm -f {xva_path}') | ||
|
|
||
| ImageFormat = Literal['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.
This might have its place in lib/vdi.py?
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.
You could use it for the type of the parameter of create_vdi too
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 would be nice indeed, but validating the type from xe requires some extra work that I began in https://github.com/xcp-ng/xcp-ng-tests/pull/317/commits, and that I might re-open
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.
see #374
|
|
||
| def vdi_export_import(vm: VM, sr: SR, image_format: ImageFormat): | ||
| vdi = sr.create_vdi(image_format=image_format) | ||
| image_path = f'/tmp/{vdi.uuid}.{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.
I have seen usage of /tmp elsewhere will it make the test re-entrant ? may safer tmp dir used to avoid potential overlap
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 usage of vdi's uuid should prevent any problem on that side.
Note that this is more for the future though, as the tests are currently mostly sequential.
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.
yes it is not blocking, just something that popped to my mind while looking the code
I would be tempted to write in a more volatile space, like in a local tmp folder job directory ? this way we are sure those files will not remain if not deleted by test, it can be done in later PR more globally
ef699b4 to
8993a77
Compare
26a1a1d to
a3c5bba
Compare
8993a77 to
26128a1
Compare
a3c5bba to
6c77a9b
Compare
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
6c77a9b to
5d6a4d4
Compare
26128a1 to
22c1258
Compare
No description provided.