Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information