| 1 |
import errno |
| 2 |
import unittest |
| 3 |
|
| 4 |
from pyverbs.pyverbs_error import PyverbsRDMAError |
| 5 |
from tests.base import RCResources, UDResources |
| 6 |
from tests.base import RDMATestCase |
| 7 |
from tests.utils import traffic |
| 8 |
|
| 9 |
from pyverbs.cq import CQ, CompChannel |
| 10 |
|
| 11 |
|
| 12 |
def create_cq_with_comp_channel(agr_obj): |
| 13 |
agr_obj.comp_channel = CompChannel(agr_obj.ctx) |
| 14 |
agr_obj.cq = CQ(agr_obj.ctx, agr_obj.num_msgs, None, agr_obj.comp_channel) |
| 15 |
agr_obj.cq.req_notify() |
| 16 |
|
| 17 |
|
| 18 |
class CqEventsUD(UDResources): |
| 19 |
def create_cq(self): |
| 20 |
create_cq_with_comp_channel(self) |
| 21 |
|
| 22 |
|
| 23 |
class CqEventsRC(RCResources): |
| 24 |
def create_cq(self): |
| 25 |
create_cq_with_comp_channel(self) |
| 26 |
|
| 27 |
|
| 28 |
class CqEventsTestCase(RDMATestCase): |
| 29 |
def setUp(self): |
| 30 |
super().setUp() |
| 31 |
self.iters = 100 |
| 32 |
|
| 33 |
def test_cq_events_ud(self): |
| 34 |
self.create_players(CqEventsUD) |
| 35 |
traffic(**self.traffic_args) |
| 36 |
|
| 37 |
def test_cq_events_rc(self): |
| 38 |
self.create_players(CqEventsRC) |
| 39 |
traffic(**self.traffic_args) |