From: Dhairya Parmar Date: Wed, 12 Apr 2023 07:57:53 +0000 (+0530) Subject: qa: update test cases to check for ENOTDIR instead of EINVAL X-Git-Tag: v16.2.14~124^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6342bf5d952b55382cd52613aa250504dac91f29;p=ceph.git qa: update test cases to check for ENOTDIR instead of EINVAL - test_nfs_export_creation_at_filepath: ENOTDIR is raised instead of EINVAL which is better aligned with the nature of the failure - test_nfs_export_creation_at_symlink: ENOTDIR is raised instead of ENOENT since the code can now check if the path is symlink but won't follow it. Signed-off-by: Dhairya Parmar (cherry picked from commit 0c8962587f4a5b8e0731f32dd753efea977b00e6) --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index e277158a1b9..b77660fd5f3 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -833,8 +833,7 @@ class TestNFS(MgrTestCase): '--path', '/testfile']) except CommandFailedError as e: - # NotADirectoryError is raised as EINVAL - if e.exitstatus != errno.EINVAL: + if e.exitstatus != errno.ENOTDIR: raise self.ctx.cluster.run(args=['rm', '-rf', '/mnt/testfile']) self._delete_cluster_with_fs(self.fs_name, mnt_pt, preserve_mode) @@ -856,7 +855,7 @@ class TestNFS(MgrTestCase): '--path', f'{mnt_pt}/testdir_symlink']) except CommandFailedError as e: - if e.exitstatus != errno.ENOENT: + if e.exitstatus != errno.ENOTDIR: raise self.ctx.cluster.run(args=['rm', '-rf', f'{mnt_pt}/*']) self._delete_cluster_with_fs(self.fs_name, mnt_pt, preserve_mode)