Adding upstream version 2.3.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
75324c05ff
commit
b76282b820
24 changed files with 598 additions and 437 deletions
|
@ -46,6 +46,12 @@ if libnvme_location == '?'
|
|||
else
|
||||
#---------------------------------------------------------------------------
|
||||
# pylint and pyflakes
|
||||
|
||||
# There's a bug with pylint 3.X. Tests should be run with pylint
|
||||
# 2.17.7 (or less), which can be installed with:
|
||||
# python3 -m pip install --upgrade pylint==2.17.7
|
||||
|
||||
|
||||
if modules_to_lint.length() != 0
|
||||
pylint = find_program('pylint', required: false)
|
||||
pyflakes = find_program('pyflakes3', required: false)
|
||||
|
@ -59,7 +65,7 @@ else
|
|||
rcfile = srce_dir / 'pylint.rc'
|
||||
|
||||
if pylint.found()
|
||||
test('pylint', pylint, args: ['--rcfile=' + rcfile] + modules_to_lint, env: test_env)
|
||||
test('pylint', pylint, args: ['--rcfile=' + rcfile] + modules_to_lint + packages_to_lint, env: test_env)
|
||||
else
|
||||
warning('Skiping some of the tests because "pylint" is missing.')
|
||||
endif
|
||||
|
|
904
test/pylint.rc
904
test/pylint.rc
File diff suppressed because it is too large
Load diff
|
@ -194,9 +194,9 @@ class StasSysConfUnitTest(unittest.TestCase):
|
|||
],
|
||||
FNAME_4: [
|
||||
'[Host]\n',
|
||||
'nqn=file:///some/non/exisiting/file/!@#\n',
|
||||
'id=file:///some/non/exisiting/file/!@#\n',
|
||||
'symname=file:///some/non/exisiting/file/!@#\n',
|
||||
'nqn=file:///some/non/existing/file/!@#\n',
|
||||
'id=file:///some/non/existing/file/!@#\n',
|
||||
'symname=file:///some/non/existing/file/!@#\n',
|
||||
],
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/python3
|
||||
import contextlib
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
@ -9,13 +10,17 @@ class MockLibnvmeTestCase(unittest.TestCase):
|
|||
'''Testing defs.py by mocking the libnvme package'''
|
||||
|
||||
def test_libnvme_version(self):
|
||||
# For unknown reasons, this test does
|
||||
# not work when run from GitHub Actions.
|
||||
if not os.getenv('GITHUB_ACTIONS'):
|
||||
from staslib import defs
|
||||
# Ensure that we re-import staslib & staslib.defs if the current Python
|
||||
# process has them already imported.
|
||||
with contextlib.suppress(KeyError):
|
||||
sys.modules.pop('staslib.defs')
|
||||
with contextlib.suppress(KeyError):
|
||||
sys.modules.pop('staslib')
|
||||
|
||||
libnvme_ver = defs.LIBNVME_VERSION
|
||||
self.assertEqual(libnvme_ver, '?.?')
|
||||
from staslib import defs
|
||||
|
||||
libnvme_ver = defs.LIBNVME_VERSION
|
||||
self.assertEqual(libnvme_ver, '?.?')
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls): # called once before all the tests
|
||||
|
|
|
@ -679,7 +679,7 @@ class Test(unittest.TestCase):
|
|||
'host-nqn': '',
|
||||
}
|
||||
)
|
||||
match = len(ipv6_addrs) == 1 and iputil.get_ipaddress_obj(
|
||||
match = len(ipv6_addrs) >= 1 and iputil.get_ipaddress_obj(
|
||||
ipv6_addrs[0], ipv4_mapped_convert=True
|
||||
) == iputil.get_ipaddress_obj(tid.host_traddr, ipv4_mapped_convert=True)
|
||||
self.assertEqual(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue