qa/tasks/test_nfs: have TestNFS inherit from CephFSTestCase#52556
qa/tasks/test_nfs: have TestNFS inherit from CephFSTestCase#52556
Conversation
|
I guess this is caused by commit f8f2154. |
Done. I've left reply on this tracker and I've created a new ticket for the failure to reported there. I'll raise a PR for it ASAP. |
qa/tasks/cephfs/test_nfs.py
Outdated
|
|
||
| # TODO Add test for cluster update when ganesha can be deployed on multiple ports. | ||
| class TestNFS(MgrTestCase): | ||
| class TestNFS(MgrTestCase, RunCephCmd): |
There was a problem hiding this comment.
at least a different error now
2023-08-08T06:47:14.895 INFO:tasks.cephfs_test_runner:ERROR: test_cluster_info (tasks.cephfs.test_nfs.TestNFS)
2023-08-08T06:47:14.895 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2023-08-08T06:47:14.895 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2023-08-08T06:47:14.896 INFO:tasks.cephfs_test_runner: File "/home/teuthworker/src/git.ceph.com_ceph-c_b438b973c217f09b2e276d43fa768d437079c176/qa/tasks/cephfs/test_nfs.py", line 579, in test_cluster_info
2023-08-08T06:47:14.896 INFO:tasks.cephfs_test_runner: self._test_create_cluster()
2023-08-08T06:47:14.896 INFO:tasks.cephfs_test_runner: File "/home/teuthworker/src/git.ceph.com_ceph-c_b438b973c217f09b2e276d43fa768d437079c176/qa/tasks/cephfs/test_nfs.py", line 157, in _test_create_cluster
2023-08-08T06:47:14.896 INFO:tasks.cephfs_test_runner: cluster_create = self._nfs_complete_cmd(
2023-08-08T06:47:14.896 INFO:tasks.cephfs_test_runner: File "/home/teuthworker/src/git.ceph.com_ceph-c_b438b973c217f09b2e276d43fa768d437079c176/qa/tasks/cephfs/test_nfs.py", line 26, in _nfs_complete_cmd
2023-08-08T06:47:14.897 INFO:tasks.cephfs_test_runner: return self.run_ceph_cmd(args=f"nfs {cmd}", stdout=StringIO(),
2023-08-08T06:47:14.897 INFO:tasks.cephfs_test_runner: File "/home/teuthworker/src/git.ceph.com_ceph-c_b438b973c217f09b2e276d43fa768d437079c176/qa/tasks/cephfs/cephfs_test_case.py", line 58, in run_ceph_cmd
2023-08-08T06:47:14.897 INFO:tasks.cephfs_test_runner: return self.mon_manager.run_cluster_cmd(**kwargs)
2023-08-08T06:47:14.897 INFO:tasks.cephfs_test_runner:AttributeError: 'NoneType' object has no attribute 'run_cluster_cmd'
There was a problem hiding this comment.
There was a problem hiding this comment.
This class will either need to have it's own version of _init_mon_manager or we'll need it to inherit from CephFSTestCase directly I think
There was a problem hiding this comment.
or just revert to old behavior if those don't work out anyway
There was a problem hiding this comment.
This class will either need to have it's own version of
_init_mon_manageror we'll need it to inherit fromCephFSTestCasedirectly I think
trying the second of these two options now
The TestNFS was recently updated to use run_ceph_cmd but
doesn't actually have access to it, resulting in
======================================================================
ERROR: test_cluster_info (tasks.cephfs.test_nfs.TestNFS)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/teuthworker/src/git.ceph.com_ceph-c_4ae2a76aad461f2c9f6a1456c25df23ec97a5b2f/qa/tasks/cephfs/test_nfs.py", line 578, in test_cluster_info
self._test_create_cluster()
File "/home/teuthworker/src/git.ceph.com_ceph-c_4ae2a76aad461f2c9f6a1456c25df23ec97a5b2f/qa/tasks/cephfs/test_nfs.py", line 156, in _test_create_cluster
cluster_create = self._nfs_complete_cmd(
File "/home/teuthworker/src/git.ceph.com_ceph-c_4ae2a76aad461f2c9f6a1456c25df23ec97a5b2f/qa/tasks/cephfs/test_nfs.py", line 25, in _nfs_complete_cmd
return self.run_ceph_cmd(args=f"nfs {cmd}", stdout=StringIO(),
AttributeError: 'TestNFS' object has no attribute 'run_ceph_cmd'
----------------------------------------------------------------------
The function we need is specified in the new RunCephCmd class,
which CephFSTestCase inherits from as well. We can't directly
inherit from RunCephCmd because that would skip the set up function
in CephFSTestCase which sets up the `mon_manager` attribute resulting in
File "<ceph-dir>/qa/tasks/cephfs/test_nfs.py", line 26, in _nfs_complete_cmd
return self.run_ceph_cmd(args=f"nfs {cmd}", stdout=StringIO(),
File "<ceph-dir>/qa/tasks/cephfs/cephfs_test_case.py", line 58, in run_ceph_cmd
return self.mon_manager.run_cluster_cmd(**kwargs)
AttributeError: 'NoneType' object has no attribute 'run_cluster_cmd'
Fixes: https://tracker.ceph.com/issues/62084
Signed-off-by: Adam King <adking@redhat.com>
cfe02b8 to
f220cf7
Compare
|
@adk3798 I feel we should revert back |
|
similar issue |
|
@dparmar18's point is correct, inheriting entire CephFSTestCase just for inheriting 3 helpers is a little too much. However, the solution he proposes would defeat the purpose of PR #50569. The correct thing to do IMO is to import RunCephCmd directly or indirectly. I'll propose a rough patch in a short time. |
|
Following patch should fix it. It does 3 things -
|
|
|
||
| # TODO Add test for cluster update when ganesha can be deployed on multiple ports. | ||
| class TestNFS(MgrTestCase): | ||
| class TestNFS(MgrTestCase, CephFSTestCase): |
There was a problem hiding this comment.
inheriting the full class doesn't work either
2023-08-09T15:33:45.851 INFO:tasks.cephfs_test_runner:test_cluster_info (tasks.cephfs.test_nfs.TestNFS) ... ERROR
2023-08-09T15:33:45.852 INFO:tasks.cephfs_test_runner:
2023-08-09T15:33:45.852 INFO:tasks.cephfs_test_runner:======================================================================
2023-08-09T15:33:45.853 INFO:tasks.cephfs_test_runner:ERROR: test_cluster_info (tasks.cephfs.test_nfs.TestNFS)
2023-08-09T15:33:45.853 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2023-08-09T15:33:45.854 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2023-08-09T15:33:45.854 INFO:tasks.cephfs_test_runner: File "/home/teuthworker/src/git.ceph.com_ceph-c_1c7f5f4949aae52e52d69742399b261751d96650/qa/tasks/cephfs/test_nfs.py", line 39, in setUp
2023-08-09T15:33:45.854 INFO:tasks.cephfs_test_runner: super(TestNFS, self).setUp()
2023-08-09T15:33:45.855 INFO:tasks.cephfs_test_runner: File "/home/teuthworker/src/git.ceph.com_ceph-c_1c7f5f4949aae52e52d69742399b261751d96650/qa/tasks/cephfs/cephfs_test_case.py", line 152, in setUp
2023-08-09T15:33:45.855 INFO:tasks.cephfs_test_runner: if len(self.mds_cluster.mds_ids) < self.MDSS_REQUIRED:
2023-08-09T15:33:45.856 INFO:tasks.cephfs_test_runner:AttributeError: 'NoneType' object has no attribute 'mds_ids'
2023-08-09T15:33:45.856 INFO:tasks.cephfs_test_runner:
2023-08-09T15:33:45.856 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
So we're left with either going back to old behavior or @rishabh-d-dave 's patch.
yeah this makes sense since RunCephCmd is not only CephFS specific but should be enabled to be used from anywhere |
|
PR #52924 has been merged. |
|
@adk3798 Let's close this PR? |
yeah |
The TestNFS was recently updated to use run_ceph_cmd but doesn't actually have access to it, resulting in
The function we need is specified in the new RunCephCmd class, so I think inheriting from there should fix this.
Fixes: https://tracker.ceph.com/issues/62084
The run_ceph_cmd function was added in #50569
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows