diff mbox series

[rdma-core,11/14] tests: Add ODP UD test

Message ID 20190819065827.26921-12-noaos@mellanox.com (mailing list archive)
State Not Applicable
Headers show
Series rdma-core tests infrastructure | expand

Commit Message

Noa Osherovich Aug. 19, 2019, 6:58 a.m. UTC
From: Maxim Chicherin <maximc@mellanox.com>

Add a TestCase for ODP/UD traffic.

Signed-off-by: Maxim Chicherin <maximc@mellanox.com>
---
 tests/test_odp.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/test_odp.py b/tests/test_odp.py
index a9f3bf4573a5..922cd0d9aad5 100644
--- a/tests/test_odp.py
+++ b/tests/test_odp.py
@@ -1,10 +1,17 @@ 
 from tests.base import RDMATestCase
 from tests.utils import requires_odp, traffic
-from tests.base import RCResources
+from tests.base import RCResources, UDResources
 from pyverbs.mr import MR
 import pyverbs.enums as e
 
 
+class OdpUD(UDResources):
+    @requires_odp('ud')
+    def create_mr(self):
+        self.mr = MR(self.pd, self.msg_size + self.GRH_SIZE ,
+                     e.IBV_ACCESS_LOCAL_WRITE | e.IBV_ACCESS_ON_DEMAND)
+
+
 class OdpRC(RCResources):
     @requires_odp('rc')
     def create_mr(self):
@@ -16,7 +23,7 @@  class OdpTestCase(RDMATestCase):
     def setUp(self):
         super(OdpTestCase, self).setUp()
         self.iters = 100
-        self.qp_dict = {'rc': OdpRC}
+        self.qp_dict = {'rc': OdpRC, 'ud': OdpUD}
 
     def create_players(self, qp_type):
         client = self.qp_dict[qp_type](self.dev_name, self.ib_port, self.gid_index)
@@ -28,3 +35,7 @@  class OdpTestCase(RDMATestCase):
     def test_odp_rc_traffic(self):
         client, server = self.create_players('rc')
         traffic(client, server, self.iters, self.gid_index, self.ib_port)
+
+    def test_odp_ud_traffic(self):
+        client, server = self.create_players('ud')
+        traffic(client, server, self.iters, self.gid_index, self.ib_port)