-
Notifications
You must be signed in to change notification settings - Fork 24
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
ovirt-img: command testing #134
base: master
Are you sure you want to change the base?
Conversation
8e84a59
to
88a629b
Compare
80b2748
to
05a380b
Compare
05a380b
to
bc3faea
Compare
bc3faea
to
b05c430
Compare
@barpavel could you please try the test described in this branch and provide some feedback? You can test it with your local engine setup, similar to how you would test python sdk scripts. If you have any questions, it will be a good indicative that the documentation would need some improvement :) |
Add the required testing infrastructure to test ovirt-img command with a local setup. Engine configuration needs to be set in a configuration file, and then the tests will read this configuration and run normally through tox. The test are run through a new tox environment, namely client (as it tests commands contained in the client folder): tox -e client It will read the configuration in the default location run the tests in the test/client folder. Configuration location can be set through an env variable: CLIENT_TEST_CONF=/path/to/test.conf tox -e client Currently, it only tests upload and download commands, with different formats and comparing resulting images. Example: $ CLIENT_TEST_CONF=~/.config/ovirt-img.conf tox -e client -- --log-cli-level=debug collected 2 items test/client/upload_download_test.py::test_upload_download[raw] Formatting '/var/tmp/imageio-tests/test_upload_download_raw_0/image.raw', fmt=raw size=10737418240 12:26:37,374 INFO (MainThread) [test] Upload raw image to SD nfs-01 [ 100% ] 10.00 GiB, 19.08 s, 536.59 MiB/s | upload completed 12:26:56,595 INFO (MainThread) [test] Download image d27c0e2f-35d1-4106-96e6-215022e022bf [ 100% ] 10.00 GiB, 2.47 s, 4.05 GiB/s | download completed 12:26:59,202 INFO (MainThread) [test] Comparing images 12:26:59,539 INFO (MainThread) [test] Upload raw image to SD iscsi-01 [ 100% ] 10.00 GiB, 24.73 s, 414.15 MiB/s | upload completed 12:27:24,405 INFO (MainThread) [test] Download image a3b48896-33bc-4f62-b3af-159b56686a29 [ 100% ] 10.00 GiB, 4.73 s, 2.11 GiB/s | download completed 12:27:29,277 INFO (MainThread) [test] Comparing images PASSED test/client/upload_download_test.py::test_upload_download[qcow2] Formatting '/var/tmp/imageio-tests/test_upload_download_qcow2_0/image.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=10737418240 lazy_refcounts=off refcount_bits=16 12:27:30,103 INFO (MainThread) [test] Upload qcow2 image to SD nfs-01 [ 100% ] 10.00 GiB, 11.92 s, 858.81 MiB/s | upload completed 12:27:42,175 INFO (MainThread) [test] Download image 9cb8da7a-6169-4020-8233-9f20aeeef56e [ 100% ] 10.00 GiB, 2.44 s, 4.09 GiB/s | download completed 12:27:44,765 INFO (MainThread) [test] Comparing images 12:27:45,956 INFO (MainThread) [test] Upload qcow2 image to SD iscsi-01 [ 100% ] 10.00 GiB, 29.13 s, 351.49 MiB/s | upload completed 12:28:15,236 INFO (MainThread) [test] Download image ae41f54d-0345-40ac-bf40-197430c671f5 [ 100% ] 10.00 GiB, 2.92 s, 3.43 GiB/s | download completed 12:28:18,290 INFO (MainThread) [test] Comparing images PASSED Fixes: oVirt#124 Signed-off-by: Albert Esteve <aesteve@redhat.com>
b05c430
to
359ba23
Compare
On my system, with locally running ovirt, the test seems to be too slow to complete within the timeout, when ran for the first time. Maybe my internet connection is not fast enough. Maybe we could use a smaller image? client run-test: commands[0] | pytest -vs --timeout 200 --log-cli-level=debug test/client test/client/upload_download_test.py::test_upload_download[raw] [ 0.9] Downloading: http://builder.libguestfs.org/fedora-36.xz
|
[SOLVED]: the problem below happened because of a misconfiguration. After fixing that, and making more space, it continues past that (but then later fails the download test because there's also not enough space for that). Also, the test freezes for me, maybe because I don't have enough space to upload the image:
-------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------- |
@rokkbert thank you for trying the test! The initial timeout is due to About the freeze, no sure the reason. How much free space do you have in the nfs1 SD? Does it consistently freeze in the same step? |
Yes, the second time it is fast. Maybe not worth the effort of finding a workaround, but maybe the image could be downloaded in advance, before the test and its timeout become active.
Makes sense.
I think 400-500 seconds would be enough for my case, but internet in germany isn't that fast, so maybe not even an issue for others. ;-)
Reason was that I made a mistake in the configuration :) But now I'm out of space on my test-VM, which is a bit more work to fix. |
After changing the tmp-path in tox.ini to somewhere with more space the tests run successfully. I just get 2 deprecation warnings, everything else is fine: .tox/client/lib/python3.6/site-packages/_pytest/config/init.py:1196 .tox/client/lib/python3.6/site-packages/userstorage/config.py:21 |
Warnings are "ok", is not related to this PR. The pytest flags in Again, thanks for testing! |
I mean this path, basetemp, in tox.ini: |
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 works for me and looks fine.
Add the required testing infrastructure to test
ovirt-img command with a local setup.
Engine configuration needs to be set in a configuration
file, and then the tests will read this configuration
and run normally through tox.
The test are run through a new tox environment, namely
client (as it tests commands contained in the client
folder):
tox -e client
It will read the configuration in the default location
run the tests in the test/client folder.
Configuration location can be set through an env
variable:
CLIENT_TEST_CONF=/path/to/test.conf tox -e client
Currently, it only tests upload and download commands,
with different formats and comparing resulting images.
Example:
Fixes: #124
Signed-off-by: Albert Esteve aesteve@redhat.com