From c13dfa674a07034cb68ebf645b40e3bac70193ec Mon Sep 17 00:00:00 2001 From: Dhairya Parmar Date: Tue, 11 Apr 2023 17:44:41 +0530 Subject: [PATCH] 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 (cherry picked from commit 5cc0857) --- qa/tasks/cephfs/test_nfs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 24374630fd3e1..b4cf64b1bb530 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): """ -- 2.39.5