]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: update test cases to check for ENOTDIR instead of EINVAL
authorDhairya Parmar <dparmar@redhat.com>
Wed, 12 Apr 2023 07:57:53 +0000 (13:27 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Wed, 26 Apr 2023 10:20:18 +0000 (15:50 +0530)
- 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 <dparmar@redhat.com>
qa/tasks/cephfs/test_nfs.py

index b4cf64b1bb5300af97fd6070aa8f15aba6a31a2c..28ed69059cc4dc8b51c855a1853ce112200e6e81 100644 (file)
@@ -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)