Skip to content

Commit

Permalink
tests: Skip unsupported MW type on MW wrong type test
Browse files Browse the repository at this point in the history
Skip unsupported MW type when EOPNOTSUPP is raised.

Signed-off-by: Chen Brasch <cbrasch@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
  • Loading branch information
Chen Brasch authored and gal-pressman committed Jun 30, 2020
1 parent 4c83df0 commit 2aad8aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_mr.py
Expand Up @@ -219,8 +219,9 @@ def test_reg_mw_wrong_type(self):
try:
mw_type = random.randint(3, 100)
MW(pd, mw_type)
except PyverbsRDMAError:
pass
except PyverbsRDMAError as ex:
if ex.error_code == errno.EOPNOTSUPP:
raise unittest.SkipTest('Create memory window of type {} is not supported'.format(mw_type))
else:
raise PyverbsError('Created a MW with type {t}'.\
format(t=mw_type))
Expand Down

0 comments on commit 2aad8aa

Please sign in to comment.