Skip to content

Commit

Permalink
tests: Require being root to run test_obj_on_huge
Browse files Browse the repository at this point in the history
[ Upstream commit 0c640f4 ]

[leonro@vm ~]$  ~/build/bin/run_tests.py -v -k test_obj_on_huge
test_obj_on_huge (tests.test_mlx5_huge_page.ResourcesOnHugePageTest.test_obj_on_huge)
Test HUGE allocation type for srq cq and qp. ... ERROR

======================================================================
ERROR: test_obj_on_huge (tests.test_mlx5_huge_page.ResourcesOnHugePageTest.test_obj_on_huge)
Test HUGE allocation type for srq cq and qp.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/rdma-core/tests/test_mlx5_huge_page.py", line 60, in test_obj_on_huge
    self.create_objects()
  File "/rdma-core/tests/test_mlx5_huge_page.py", line 41, in create_objects
    self.create_cq()
  File "/rdma-core/tests/test_mlx5_huge_page.py", line 22, in create_cq
    return CQ(self.ctx, 100, None, None, 0)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "cq.pyx", line 102, in pyverbs.cq.CQ.__init__
pyverbs.pyverbs_error.PyverbsRDMAError: Failed to create a CQ. Errno: 0, Success

----------------------------------------------------------------------
Ran 1 test in 0.036s

FAILED (errors=1)

Fixes: 8d0364f ("tests: Add huge page allocation tests")
Signed-off-by: Leon Romanovsky <[email protected]>
Signed-off-by: Nicolas Morey <[email protected]>
  • Loading branch information
rleon authored and nmorey committed Jul 25, 2023
1 parent a4763b1 commit b05e4b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_mlx5_huge_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_obj_on_huge(self):
else expect to fail.
"""
self.set_env_alloc_type('HUGE')
if huge_pages_supported():
if huge_pages_supported() and u.is_root():
self.create_objects()
else:
with self.assertRaises(PyverbsRDMAError):
Expand Down

0 comments on commit b05e4b1

Please sign in to comment.