diff mbox series

[RFC] tests: Fix test_mr_rereg_access

Message ID ebe123c1-521c-8c2c-5773-46e84641ce29@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series [RFC] tests: Fix test_mr_rereg_access | expand

Commit Message

Bob Pearson May 24, 2023, 8:23 p.m. UTC
Subject: [PATCH RFC] tests: Fix test_mr_rereg_access
Date: Wed, 24 May 2023 15:19:26 -0500
From: Bob Pearson <rpearsonhpe@gmail.com>
To: edwards@nvidia.com, idok@nvidia.com, jgg@nvidia.com
CC: Bob Pearson <rpearsonhpe@gmail.com>

The test_mr_rereg_access and test_mr_rereg_bad_flow test cases
modify the access permissions of an MR to add or remove remote
write access. This may cause a change in the value of the MR rkey
requiring that the players in the test re-exchange rkey state
after the rereg_mr call but this is not done. This patch fixes
this behavior.

Fixes: 4bc72d894481 ("tests: Add rereg MR tests")
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 tests/test_mr.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/tests/test_mr.py b/tests/test_mr.py
index 6b97e636..534df46a 100644
--- a/tests/test_mr.py
+++ b/tests/test_mr.py
@@ -115,6 +115,7 @@  class MRTest(RDMATestCase):
         access = e.IBV_ACCESS_LOCAL_WRITE | e.IBV_ACCESS_REMOTE_WRITE
         self.server.rereg_mr(flags=e.IBV_REREG_MR_CHANGE_ACCESS, access=access)
         self.client.rereg_mr(flags=e.IBV_REREG_MR_CHANGE_ACCESS, access=access)
+        self.sync_remote_attr()
         u.rdma_traffic(**self.traffic_args, send_op=e.IBV_WR_RDMA_WRITE)
 
     def test_mr_rereg_access_bad_flow(self):
@@ -129,6 +130,7 @@  class MRTest(RDMATestCase):
         u.rdma_traffic(**self.traffic_args, send_op=e.IBV_WR_RDMA_WRITE)
         access = e.IBV_ACCESS_LOCAL_WRITE
         self.server.rereg_mr(flags=e.IBV_REREG_MR_CHANGE_ACCESS, access=access)
+        self.sync_remote_attr()
         with self.assertRaisesRegex(PyverbsRDMAError, 'Remote access error'):
             u.rdma_traffic(**self.traffic_args, send_op=e.IBV_WR_RDMA_WRITE)