When you run 'make test' using python 3 the unit test
test_invalid_input fails with:
Traceback (most recent call last):
File "/someuser/projects/nvmetcli/nvmet/test_nvmet.py", line 395, in
test_invalid_input
for i in range(l))
File "/someuser/projects/nvmetcli/nvmet/test_nvmet.py", line 395, in
<genexpr>
for i in range(l))
AttributeError: module 'string' has no attribute 'lowercase'
Python 3 does not have 'string.lowercase' ref.
https://docs.python.org/3/library/string.html
Python 2 does ref.
https://docs.python.org/2/library/string.html
Both have "string.ascii_lowercase" so lets leverage that to
support both.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
nqn='/', mode='create')
for l in [ 257, 512, 1024, 2048 ]:
- toolong = ''.join(random.choice(string.lowercase)
+ toolong = ''.join(random.choice(string.ascii_lowercase)
for i in range(l))
self.assertRaises(nvme.CFSError, nvme.Subsystem,
nqn=toolong, mode='create')