New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc pyverbs tests fixes round 2 #780
Conversation
except PyverbsRDMAError: | ||
except PyverbsRDMAError as ex: | ||
if ex.error_code == errno.EOPNOTSUPP: | ||
raise unittest.SkipTest('Create memory window of type {} is not supported'.format(mw_type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use f-strings in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
tests/test_mr.py
Outdated
except PyverbsRDMAError: | ||
except PyverbsRDMAError as ex: | ||
if ex.error_code == errno.EOPNOTSUPP: | ||
raise unittest.SkipTest('Create memory window of type {} is not supported'.format(mw_type)) | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the "pass" - it's redundant right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
@@ -71,15 +71,16 @@ def test_query_gid(self): | |||
ctx.query_gid(port_num=1, index=0) | |||
|
|||
@staticmethod | |||
def verify_device_attr(attr): | |||
def verify_device_attr(attr, device): | |||
""" | |||
Helper method that verifies correctness of some members of DeviceAttr | |||
object. | |||
:param attr: A DeviceAttr object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the device param to the docstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
tests/test_device.py
Outdated
""" | ||
Helper method that verifies correctness of some members of DeviceAttr | ||
object. | ||
:param attr: A DeviceAttr object | ||
:return: None | ||
""" | ||
assert attr.node_guid != 0 | ||
assert attr.sys_image_guid != 0 | ||
if device.node_type != 'Unknown': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean "IBV_NODE_UNKNOWN" ?
node_type is not a string (it's just printed as a string using an internal translation function)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
Skip unsupported MW type when EOPNOTSUPP is raised. Signed-off-by: Chen Brasch <cbrasch@amazon.com> Signed-off-by: Gal Pressman <galpress@amazon.com>
ibv_req_notify_cq returns the error code on failure, it doesn't set the errno. Signed-off-by: Chen Brasch <cbrasch@amazon.com> Signed-off-by: Gal Pressman <galpress@amazon.com>
Verify net interface support on RDMATestCase. Skip in case net directory is not found, instead of raising an error. Signed-off-by: Chen Brasch <cbrasch@amazon.com> Signed-off-by: Gal Pressman <galpress@amazon.com>
IBV_QP_STATE should be used on query QP instead of IBV_QP_CUR_STATE, which should only be used for modify QP commands. Signed-off-by: Chen Brasch <cbrasch@amazon.com> Signed-off-by: Gal Pressman <galpress@amazon.com>
Skip verification of a few device attributes in case the node type is unspecified/unknown. The missing IBV_NODE_UNSPECIFIED enum value was added to libibverbs_enums.pxd. Signed-off-by: Chen Brasch <cbrasch@amazon.com> Signed-off-by: Gal Pressman <galpress@amazon.com>
63c338d
to
20e13b0
Compare
Another set of pyverbs fixes which allow tests of unsupported devices to skip.