[PATCH rdma-core 3/3] tests: Some cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some classes' constructors were modified to include 'not None'
parameters. Checking these scenarios gives no additional coverage as
it checks Python/Cython and not rdma-core.
Remove these test cases.

Adding TSO header to a QP's init_attr_ex increases send WQE size. In
some executions of the test, the randomized value of max_send_sge is
too high combined with TSO.
Decrease number of send SGEs in case of TSO to avoid these failures.

Signed-off-by: Noa Osherovich <noaos@xxxxxxxxxxxx>
Reviewed-by: Edward Srouji <edwards@xxxxxxxxxxxx>
---
 tests/test_mr.py | 14 --------------
 tests/test_pd.py | 12 ------------
 tests/test_qp.py |  2 --
 tests/utils.py   |  3 +++
 4 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/tests/test_mr.py b/tests/test_mr.py
index 1b5482884be6..742c6032b1b3 100644
--- a/tests/test_mr.py
+++ b/tests/test_mr.py
@@ -45,20 +45,6 @@ class MRTest(PyverbsAPITestCase):
                     with MR(pd, u.get_mr_length(), f) as mr:
                         mr.close()
 
-    @staticmethod
-    def test_reg_mr_bad_flow():
-        """
-        Verify that trying to register a MR with None PD fails
-        """
-        try:
-            # Use the simplest access flags necessary
-            MR(None, random.randint(0, 10000), e.IBV_ACCESS_LOCAL_WRITE)
-        except TypeError as te:
-            assert 'expected pyverbs.pd.PD' in te.args[0]
-            assert 'got NoneType' in te.args[0]
-        else:
-            raise PyverbsRDMAErrno('Created a MR with None PD')
-
     def test_dereg_mr_twice(self):
         """
         Verify that explicit call to MR's close() doesn't fail
diff --git a/tests/test_pd.py b/tests/test_pd.py
index a8d6eb2fb69f..d1b9c7e8a94f 100755
--- a/tests/test_pd.py
+++ b/tests/test_pd.py
@@ -40,18 +40,6 @@ class PDTest(PyverbsAPITestCase):
                 with PD(ctx) as pd:
                     pd.close()
 
-    @staticmethod
-    def test_create_pd_none_ctx():
-        """
-        Verify that PD can't be created with a None context
-        """
-        try:
-            PD(None)
-        except TypeError as te:
-            assert 'must not be None' in te.args[0]
-        else:
-            raise PyverbsRDMAErrno('Created a PD with None context')
-
     def test_destroy_pd_twice(self):
         """
         Test bad flow cases in destruction of a PD object
diff --git a/tests/test_qp.py b/tests/test_qp.py
index 35a20adec5f1..e7fc447937fd 100644
--- a/tests/test_qp.py
+++ b/tests/test_qp.py
@@ -154,8 +154,6 @@ class QPTest(PyverbsAPITestCase):
             with PD(ctx) as pd:
                 with CQ(ctx, 100, None, None, 0) as cq:
                     for i in range(1, attr.phys_port_cnt + 1):
-                        qpts = [e.IBV_QPT_UD, e.IBV_QPT_RAW_PACKET] \
-                            if is_eth(ctx, i) else [e.IBV_QPT_UD]
                         qia = get_qp_init_attr_ex(cq, pd, attr, attr_ex,
                                                   e.IBV_QPT_UD)
                         with QP(ctx, qia, QPAttr()) as qp:
diff --git a/tests/utils.py b/tests/utils.py
index ab30f6692951..c45170dbd329 100755
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -227,6 +227,9 @@ def random_qp_init_attr_ex(attr_ex, attr, qpt=None):
                 random.randint(16, int(attr_ex.tso_caps.max_tso / 400))
     qia = QPInitAttrEx(qp_type=qpt, cap=qp_cap, sq_sig_all=sig, comp_mask=mask,
                        create_flags=cflags, max_tso_header=max_tso)
+    if mask & e.IBV_QP_INIT_ATTR_MAX_TSO_HEADER:
+        # TSO increases send WQE size, let's be on the safe side
+        qia.cap.max_send_sge = 2
     return qia
 
 
-- 
2.21.0





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux