-
Notifications
You must be signed in to change notification settings - Fork 6
xva export import tests #367
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/migration-integrity
Are you sure you want to change the base?
Conversation
| vm.export(xva_path, compression) | ||
| # check that the zero blocks are not part of the result. Most of the data is from the random stream, so | ||
| # compression has little effect. We just check the result is between 500 and 700 MiB | ||
| size_mb = int(vm.host.ssh(f'du -sm {xva_path}').split()[0]) |
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.
du may not reflect the actual size , or maybe you need to use --apparent-size
| # check that the zero blocks are not part of the result. Most of the data is from the random stream, so | ||
| # compression has little effect. We just check the result is between 500 and 700 MiB | ||
| size_mb = int(vm.host.ssh(f'du -sm {xva_path}').split()[0]) | ||
| assert 500 < size_mb < 700, f"unexpected xva size: {size_mb}" |
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 looks empirical to me, there is no guarantee is there ?
well since the random is controlled, it should be ok
| imported_vm = None | ||
| try: | ||
| vm.export(xva_path, compression) | ||
| # check that the zero blocks are not part of the result. Most of the data is from the random stream, so |
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.
| # check that the zero blocks are not part of the result. Most of the data is from the random stream, so | |
| # check that the zero blocks are not part of the result. | |
| # Most of the data is from the pseudo-random stream, so |
| imported_vm = vm.host.import_vm(xva_path, vm.vdis[0].sr.uuid) | ||
| imported_vm.start() | ||
| imported_vm.wait_for_vm_running_and_ssh_up() | ||
| imported_vm.ssh("randstream validate -v --expected-checksum 24e905d6 /root/data") |
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.
would make a constant for 24e905d6 and 500MiB
|
|
||
| @pytest.mark.small_vm | ||
| @pytest.mark.parametrize("compression", ["none", "gzip", "zstd"]) | ||
| def test_xva_export_import(self, vm_on_lvm_sr: VM, compression): |
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 this factorized somewhere ?
|
|
||
| @pytest.fixture(scope='package') | ||
| def nfs4_sr(host, nfs4_device_config): | ||
| def nfs4_sr(host, image_format: str, nfs4_device_config): |
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 would put this extra param at the end and set a default value
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.
lgtm but I see lot of duplicated code, but Is the original intend to make tests "self sufficient" ?
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>
04dc842 to
40b31bf
Compare
No description provided.