diff mbox series

[rdma-core,4/4] tests: Add query QP data in order coverage

Message ID 20210609155932.218005-5-yishaih@nvidia.com (mailing list archive)
State Not Applicable
Headers show
Series verbs: Introduce ibv_query_qp_data_in_order() verb | expand

Commit Message

Yishai Hadas June 9, 2021, 3:59 p.m. UTC
From: Shachar Kagan <skagan@nvidia.com>

Add a test which queries a QP in RTS state and check if data is
guaranteed to be in order.

Signed-off-by: Shachar Kagan <skagan@nvidia.com>
Reviewed-by: Ido Kalir <idok@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
---
 tests/test_qp.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/tests/test_qp.py b/tests/test_qp.py
index 53b1d32..a623cb3 100644
--- a/tests/test_qp.py
+++ b/tests/test_qp.py
@@ -228,6 +228,19 @@  class QPTest(PyverbsAPITestCase):
         """
         self.query_qp_common_test(e.IBV_QPT_RAW_PACKET)
 
+    def test_query_data_in_order(self):
+        """
+        Queries an UD QP data in order after moving it to RTS state.
+        Verifies that the result from the query is valid.
+        """
+        with PD(self.ctx) as pd:
+            with CQ(self.ctx, 100, None, None, 0) as cq:
+                qia = u.get_qp_init_attr(cq, self.attr)
+                qia.qp_type = e.IBV_QPT_UD
+                qp = self.create_qp(pd, qia, False, True, self.ib_port)
+                is_data_in_order = qp.query_data_in_order(e.IBV_WR_SEND)
+                self.assertIn(is_data_in_order, [0, 1], 'Data in order result is not valid')
+
     def test_modify_ud_qp(self):
         """
         Queries a UD QP after calling modify(). Verifies that its properties are