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: v18.1.0~106^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fbe107904dbf51abc12a17e21684b8d479f21941;p=ceph-ci.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 0c89625) --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index b4cf64b1bb5..28ed69059cc 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -852,8 +852,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) @@ -875,7 +874,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)