Skip to content
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

Merged
merged 5 commits into from Jun 30, 2020

Conversation

gal-pressman
Copy link
Contributor

Another set of pyverbs fixes which allow tests of unsupported devices to skip.

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))
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

"""
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':
Copy link
Contributor

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

Chen Brasch added 5 commits June 30, 2020 12:27
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>
@rleon rleon merged commit be9938f into linux-rdma:master Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants