new file mode 100644
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
+# Copyright (c) 2019, Mellanox Technologies. All rights reserved. See COPYING file
+
+rdma_python_test(tests
+ __init__.py
+ test_addr.py
+ base.py
+ test_cq.py
+ test_device.py
+ test_mr.py
+ test_pd.py
+ test_qp.py
+ utils.py
+ )
similarity index 100%
rename from pyverbs/tests/__init__.py
rename to tests/__init__.py
similarity index 100%
rename from pyverbs/tests/base.py
rename to tests/base.py
similarity index 98%
rename from pyverbs/tests/addr.py
rename to tests/test_addr.py
@@ -1,9 +1,9 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright (c) 2019 Mellanox Technologies, Inc. All rights reserved. See COPYING file
-from pyverbs.tests.base import PyverbsAPITestCase
from pyverbs.addr import GlobalRoute, AHAttr, AH
from pyverbs.pyverbs_error import PyverbsError
+from tests.base import PyverbsAPITestCase
import pyverbs.device as d
import pyverbs.enums as e
from pyverbs.pd import PD
similarity index 98%
rename from pyverbs/tests/cq.py
rename to tests/test_cq.py
@@ -7,9 +7,9 @@ import random
from pyverbs.cq import CompChannel, CQ, CqInitAttrEx, CQEX
from pyverbs.pyverbs_error import PyverbsError
-from pyverbs.tests.base import PyverbsAPITestCase
-import pyverbs.tests.utils as u
+from tests.base import PyverbsAPITestCase
import pyverbs.enums as e
+import tests.utils as u
class CQTest(PyverbsAPITestCase):
similarity index 99%
rename from pyverbs/tests/device.py
rename to tests/test_device.py
@@ -8,8 +8,8 @@ import resource
import random
from pyverbs.pyverbs_error import PyverbsError, PyverbsRDMAError
-from pyverbs.tests.base import PyverbsAPITestCase
-import pyverbs.tests.utils as u
+from tests.base import PyverbsAPITestCase
+import tests.utils as u
import pyverbs.device as d
PAGE_SIZE = resource.getpagesize()
similarity index 99%
rename from pyverbs/tests/mr.py
rename to tests/test_mr.py
@@ -7,13 +7,13 @@ from itertools import combinations as com
import random
from pyverbs.pyverbs_error import PyverbsRDMAError, PyverbsError
-from pyverbs.tests.base import PyverbsAPITestCase
+from tests.base import PyverbsAPITestCase
from pyverbs.base import PyverbsRDMAErrno
from pyverbs.mr import MR, MW, DMMR
-import pyverbs.tests.utils as u
import pyverbs.device as d
from pyverbs.pd import PD
import pyverbs.enums as e
+import tests.utils as u
MAX_IO_LEN = 1048576
similarity index 97%
rename from pyverbs/tests/pd.py
rename to tests/test_pd.py
@@ -5,7 +5,7 @@ Test module for pyverbs' pd module.
"""
import random
-from pyverbs.tests.base import PyverbsAPITestCase
+from tests.base import PyverbsAPITestCase
from pyverbs.base import PyverbsRDMAErrno
import pyverbs.device as d
from pyverbs.pd import PD
similarity index 99%
rename from pyverbs/tests/qp.py
rename to tests/test_qp.py
@@ -5,12 +5,12 @@ Test module for pyverbs' qp module.
"""
import random
-from pyverbs.tests.base import PyverbsAPITestCase
from pyverbs.qp import QPInitAttr, QPAttr, QP
-import pyverbs.tests.utils as u
+from tests.base import PyverbsAPITestCase
import pyverbs.enums as e
from pyverbs.pd import PD
from pyverbs.cq import CQ
+import tests.utils as u
class QPTest(PyverbsAPITestCase):
similarity index 100%
rename from pyverbs/tests/utils.py
rename to tests/utils.py
Unittests can be added regardless of pyverbs, change the directory hierarchy to reflect that. Signed-off-by: Noa Osherovich <noaos@mellanox.com> --- tests/CMakeLists.txt | 14 ++++++++++++++ {pyverbs/tests => tests}/__init__.py | 0 {pyverbs/tests => tests}/base.py | 0 pyverbs/tests/addr.py => tests/test_addr.py | 2 +- pyverbs/tests/cq.py => tests/test_cq.py | 4 ++-- pyverbs/tests/device.py => tests/test_device.py | 4 ++-- pyverbs/tests/mr.py => tests/test_mr.py | 4 ++-- pyverbs/tests/pd.py => tests/test_pd.py | 2 +- pyverbs/tests/qp.py => tests/test_qp.py | 4 ++-- {pyverbs/tests => tests}/utils.py | 0 10 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 tests/CMakeLists.txt rename {pyverbs/tests => tests}/__init__.py (100%) rename {pyverbs/tests => tests}/base.py (100%) rename pyverbs/tests/addr.py => tests/test_addr.py (98%) rename pyverbs/tests/cq.py => tests/test_cq.py (98%) rename pyverbs/tests/device.py => tests/test_device.py (99%) rename pyverbs/tests/mr.py => tests/test_mr.py (99%) rename pyverbs/tests/pd.py => tests/test_pd.py (97%) rename pyverbs/tests/qp.py => tests/test_qp.py (99%) rename {pyverbs/tests => tests}/utils.py (100%)