From: Dhairya Parmar Date: Tue, 11 Apr 2023 12:14:41 +0000 (+0530) Subject: qa: fix test_nfs_export_with_invalid_path X-Git-Tag: v19.0.0~1313^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5cc0857f4159e0f4051716d35e960a363cbde139;p=ceph-ci.git qa: fix test_nfs_export_with_invalid_path It actually didn't test the invalid path but still ended with ENOENT(which is expected in case path is invalid) as the test didn't create a fs, and it failed saying "FS nfs-cephfs not found" which too raises ENOENT and thus it always passed. Signed-off-by: Dhairya Parmar --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 24374630fd3..b4cf64b1bb5 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -826,7 +826,9 @@ class TestNFS(MgrTestCase): """ Test that nfs exports can't be created with invalid path """ - self._test_create_cluster() + mnt_pt = '/mnt' + preserve_mode = self._sys_cmd(['stat', '-c', '%a', mnt_pt]) + self._create_cluster_with_fs(self.fs_name, mnt_pt) try: self._create_export(export_id='123', extra_cmd=['--pseudo-path', self.pseudo_path, @@ -834,7 +836,7 @@ class TestNFS(MgrTestCase): except CommandFailedError as e: if e.exitstatus != errno.ENOENT: raise - self._test_delete_cluster() + self._delete_cluster_with_fs(self.fs_name, mnt_pt, preserve_mode) def test_nfs_export_creation_at_filepath(self): """