From 0c8962587f4a5b8e0731f32dd753efea977b00e6 Mon Sep 17 00:00:00 2001 From: Dhairya Parmar Date: Wed, 12 Apr 2023 13:27:53 +0530 Subject: [PATCH] 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 --- qa/tasks/cephfs/test_nfs.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index b4cf64b1bb530..28ed69059cc4d 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) -- 2.39.5