]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
tests: Port to nose2 and unittest
authorDaniel Wagner <dwagner@suse.de>
Fri, 17 Jun 2022 08:31:42 +0000 (10:31 +0200)
committerDaniel Wagner <dwagner@suse.de>
Fri, 17 Jun 2022 10:40:09 +0000 (12:40 +0200)
commitee4519295b4074fb1f5c86c890b2ea8ea09e688d
tree763cb47d77f63a9b92dd740ae0c436bce9361c59
parent563d3a9fb2442d2f522e8f15c54134ef1af8face
tests: Port to nose2 and unittest

The test are still using nose which has been superseeded by
nose2. Update the tests to use the nose2 and unittest.

To minimize errors in most of the porting is done using sed, e.g
's/TestNVMeIO.__init__(self)/super().setUp()/g'.

While at it also update the build system and move the test files to
the build dir. This avoids in tree exectution of the Python files
which leaves the __pycache__ dir in the source tree.

This also fixes the problem, that the config file is not found when
'meson test -C .build' is used. We have the prober dir structure for
Python and nose2 to find all resources in the build root. Furthermore,
when running the tests the output is captured in the nvmetests
dir. This dir is also created under the build root dir.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
25 files changed:
tests/README
tests/meson.build
tests/nvme_attach_detach_ns_test.py
tests/nvme_compare_test.py
tests/nvme_copy_test.py
tests/nvme_create_max_ns_test.py
tests/nvme_dsm_test.py
tests/nvme_error_log_test.py
tests/nvme_flush_test.py
tests/nvme_format_test.py
tests/nvme_fw_log_test.py
tests/nvme_get_features_test.py
tests/nvme_get_lba_status_test.py
tests/nvme_id_ctrl_test.py
tests/nvme_id_ns_test.py
tests/nvme_lba_status_log_test.py
tests/nvme_read_write_test.py
tests/nvme_simple_template_test.py
tests/nvme_smart_log_test.py
tests/nvme_test.py
tests/nvme_test_io.py
tests/nvme_test_logger.py
tests/nvme_verify_test.py
tests/nvme_writeuncor_test.py
tests/nvme_writezeros_test.py