Skip to content

Commit

Permalink
tests: Skip tests with unsupported MR access flags
Browse files Browse the repository at this point in the history
The shared PD test triggers a flow that tries to create an MR through
QpExRCRDMAWrite class with access flags that might not be supported on
some devices, skip the test in that case.

Signed-off-by: Gal Pressman <galpress@amazon.com>
  • Loading branch information
gal-pressman committed Jul 14, 2020
1 parent 0593cf6 commit ab66851
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/utils.py
Expand Up @@ -4,6 +4,7 @@
Provide some useful helper function for pyverbs' tests.
"""
from itertools import combinations as com
import errno
import unittest
import random
import socket
Expand Down Expand Up @@ -267,8 +268,13 @@ def create_custom_mr(agr_obj, additional_access_flags=0, size=None):
:param size: MR's length. If None, agr_obj.msg_size is used.
"""
mr_length = size if size else agr_obj.msg_size
return MR(agr_obj.pd, mr_length,
e.IBV_ACCESS_LOCAL_WRITE | additional_access_flags)
try:
return MR(agr_obj.pd, mr_length,
e.IBV_ACCESS_LOCAL_WRITE | additional_access_flags)
except PyverbsRDMAError as ex:
if ex.error_code == errno.EOPNOTSUPP:
raise unittest.SkipTest(f'Create custom mr with additional access flags {additional_access_flags} is not supported')
raise ex

# Traffic helpers

Expand Down

0 comments on commit ab66851

Please sign in to comment.