]> git.infradead.org Git - users/hch/nvmetcli.git/commit
nvmetcli: Allow different devices for make test
authorTony Asleson <tasleson@redhat.com>
Thu, 2 Apr 2020 15:54:43 +0000 (10:54 -0500)
committerChristoph Hellwig <hch@lst.de>
Fri, 3 Apr 2020 06:48:29 +0000 (08:48 +0200)
commit35e92a1bfedf28868112165892b3eb2cd7f750ce
tree355afe283474356939a16c9950818b4f64178172
parentfd09200bba73011b4b7086c96e394ce875fdd38f
nvmetcli: Allow different devices for make test

The test_nvmet.py by default uses /dev/ram0 and /dev/ram1 for 2 of the
unit tests.  Add env. variable to allow user to specify different devices
or files.  Additionally, skip these unit tests that require devices/files
if they are not present.  Update README too.

$ sudo make test
......s...s.
----------------------------------------------------------------------
Ran 12 tests in 0.043s

OK (skipped=2)
Name                  Stmts   Miss  Cover
-----------------------------------------
nvmet/__init__.py         1      0   100%
nvmet/nvme.py           517    237    54%
nvmet/test_nvmet.py     276     63    77%
-----------------------------------------
TOTAL                   794    300    62%

$ sudo NVMET_TEST_DEVICES="/dev/sdc,/dev/sdd" make test
............
----------------------------------------------------------------------
Ran 12 tests in 0.124s

OK
Name                  Stmts   Miss  Cover
-----------------------------------------
nvmet/__init__.py         1      0   100%
nvmet/nvme.py           517    100    81%
nvmet/test_nvmet.py     276      4    99%
-----------------------------------------
TOTAL                   794    104    87%

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
README
nvmet/test_nvmet.py