summaryrefslogtreecommitdiffstats
path: root/qa/tasks
diff options
context:
space:
mode:
authorAvan Thakkar <athakkar@redhat.com>2024-09-03 15:15:47 +0200
committerAvan Thakkar <athakkar@redhat.com>2024-09-16 21:16:00 +0200
commitb895e596a88a9f4b0fe07dce082b369f4f04b8d2 (patch)
tree964aadfcb8d1b6a16c8a4f995eecff1f5d47628a /qa/tasks
parentmgr/nfs: add additional tests for cmount_path & user_id deletion (diff)
downloadceph-b895e596a88a9f4b0fe07dce082b369f4f04b8d2.tar.xz
ceph-b895e596a88a9f4b0fe07dce082b369f4f04b8d2.zip
doc: nit fixes for nfs doc
Signed-off-by: Avan Thakkar <athakkar@redhat.com> Fixes some doc lint and also fixed qa tests for having both 3 & 4 protocols by default in expot config.
Diffstat (limited to 'qa/tasks')
-rw-r--r--qa/tasks/cephfs/test_nfs.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py
index 4607e9ba766..932d504d47f 100644
--- a/qa/tasks/cephfs/test_nfs.py
+++ b/qa/tasks/cephfs/test_nfs.py
@@ -235,12 +235,12 @@ class TestNFS(MgrTestCase):
self._test_create_cluster()
self._create_export(export_id='1', create_fs=True)
- def _delete_export(self, pseduo_path=None):
+ def _delete_export(self, pseduo_path=None, check_in=False, user_id=None):
'''
Delete an export.
'''
self._nfs_cmd('export', 'rm', self.cluster_id, pseduo_path if pseduo_path else self.pseudo_path)
- self._check_auth_ls(self.fs_name)
+ self._check_auth_ls(self.fs_name, check_in, user_id)
def _test_list_export(self):
'''
@@ -1222,8 +1222,10 @@ class TestNFS(MgrTestCase):
"""
Test that ensure cmount_path is present in FSAL block
"""
+ self._create_cluster_with_fs(self.fs_name)
+
pseudo_path = '/test_without_cmount'
- self._create_export(export_id='1234',
+ self._create_export(export_id='1',
extra_cmd=['--pseudo-path', pseudo_path])
nfs_output = self._get_export(pseudo_path)
self.assertIn('cmount_path', nfs_output['fsal'])
@@ -1234,6 +1236,8 @@ class TestNFS(MgrTestCase):
"""
Test that exports with same FSAL share same user_id
"""
+ self._create_cluster_with_fs(self.fs_name)
+
pseudo_path_1 = '/test1'
pseudo_path_2 = '/test2'
pseudo_path_3 = '/test3'
@@ -1245,10 +1249,10 @@ class TestNFS(MgrTestCase):
fs_path_1 = self._cmd('fs', 'subvolume', 'getpath', self.fs_name, 'sub_vol_1').strip()
fs_path_2 = self._cmd('fs', 'subvolume', 'getpath', self.fs_name, 'sub_vol_2').strip()
# Both exports should have same user_id(since cmount_path=/ & fs_name is same)
- self._create_export(export_id='21',
+ self._create_export(export_id='1',
extra_cmd=['--pseudo-path', pseudo_path_1,
'--path', fs_path_1])
- self._create_export(export_id='22',
+ self._create_export(export_id='2',
extra_cmd=['--pseudo-path', pseudo_path_2,
'--path', fs_path_2])
@@ -1259,7 +1263,7 @@ class TestNFS(MgrTestCase):
self.assertEqual(nfs_output_1['fsal']['user_id'], 'nfs.test.nfs-cephfs.3746f603')
cmount_path = '/volumes'
- self._create_export(export_id='23',
+ self._create_export(export_id='3',
extra_cmd=['--pseudo-path', pseudo_path_3,
'--path', fs_path_1,
'--cmount-path', cmount_path])
@@ -1268,13 +1272,10 @@ class TestNFS(MgrTestCase):
self.assertNotEqual(nfs_output_3['fsal']['user_id'], nfs_output_1['fsal']['user_id'])
self.assertEqual(nfs_output_3['fsal']['user_id'], 'nfs.test.nfs-cephfs.32cd8545')
- self._delete_export(pseudo_path_1)
# Deleting export with same user_id should not delete the user_id
- self._check_auth_ls(self.fs_name, True, nfs_output_2['fsal']['user_id'])
- self._delete_export(pseudo_path_2)
+ self._delete_export(pseudo_path_1, True, nfs_output_1['fsal']['user_id'])
# Deleting export 22 should delete the user_id since it's only export left with that user_id
- self._check_auth_ls(self.fs_name, False, nfs_output_2['fsal']['user_id'])
+ self._delete_export(pseudo_path_2, False, nfs_output_2['fsal']['user_id'])
- self._delete_export(pseudo_path_3)
# Deleting export 23 should delete the user_id since it's only export with that user_id
- self._check_auth_ls(self.fs_name, False, nfs_output_3['fsal']['user_id'])
+ self._delete_export(pseudo_path_3, False, nfs_output_3['fsal']['user_id'])