Skip to content

Commit

Permalink
Merge pull request #802 from Kamalheib/raw_qp
Browse files Browse the repository at this point in the history
tests: Skip test if create Raw Packet QP is not supported
  • Loading branch information
rleon committed Aug 4, 2020
2 parents 93cadc5 + 0c441dc commit 6428c7b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
7 changes: 6 additions & 1 deletion tests/test_mlx5_lag_affinity.py
Expand Up @@ -24,7 +24,12 @@ def create_cq(self):
def create_qp(self):
qia = QPInitAttr(e.IBV_QPT_RAW_PACKET, rcq=self.cq, scq=self.cq,
cap=QPCap())
qp = QP(self.pd, qia)
try:
qp = QP(self.pd, qia)
except PyverbsRDMAError as ex:
if ex.error_code == errno.EOPNOTSUPP:
raise unittest.SkipTest("Create Raw Packet QP is not supported")
raise ex
qp.to_init(QPAttr())
return qp

Expand Down
18 changes: 14 additions & 4 deletions tests/test_qp.py
Expand Up @@ -65,8 +65,13 @@ def test_create_qp_no_attr(self):
assert qp.qp_state == e.IBV_QPS_RESET, 'UD QP should have been in RESET'
if u.is_eth(ctx, i) and u.is_root():
qia.qp_type = e.IBV_QPT_RAW_PACKET
with QP(pd, qia) as qp:
assert qp.qp_state == e.IBV_QPS_RESET, 'Raw Packet QP should have been in RESET'
try:
with QP(pd, qia) as qp:
assert qp.qp_state == e.IBV_QPS_RESET, 'Raw Packet QP should have been in RESET'
except PyverbsRDMAError as ex:
if ex.error_code == errno.EOPNOTSUPP:
raise unittest.SkipTest("Create Raw Packet QP is not supported")
raise ex

def test_create_qp_with_attr_connected(self):
"""
Expand Down Expand Up @@ -112,8 +117,13 @@ def test_create_qp_with_attr(self):
assert qp.qp_state == e.IBV_QPS_RTS, 'UD QP should have been in RTS'
if u.is_eth(ctx, i) and u.is_root():
qia.qp_type = e.IBV_QPT_RAW_PACKET
with QP(pd, qia, QPAttr()) as qp:
assert qp.qp_state == e.IBV_QPS_RTS, 'Raw Packet QP should have been in RTS'
try:
with QP(pd, qia, QPAttr()) as qp:
assert qp.qp_state == e.IBV_QPS_RTS, 'Raw Packet QP should have been in RTS'
except PyverbsRDMAError as ex:
if ex.error_code == errno.EOPNOTSUPP:
raise unittest.SkipTest("Create Raw Packet QP is not supported")
raise ex

def test_create_qp_ex_no_attr_connected(self):
"""
Expand Down

0 comments on commit 6428c7b

Please sign in to comment.