]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: added test case test_nfs_export_with_invalid_path
authordparmar18 <dparmar@redhat.com>
Thu, 15 Dec 2022 12:00:07 +0000 (17:30 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Fri, 31 Mar 2023 08:21:03 +0000 (13:51 +0530)
Fixes: https://tracker.ceph.com/issues/58228
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit b0bb25024d8fad2c06138571b830afcea4994be0)

qa/tasks/cephfs/test_nfs.py

index 47b3e63a6da984c1fbfde5d8fc3280ef5cf6c8b4..709af4436e418c4aa83e138612acab2b504429b6 100644 (file)
@@ -725,3 +725,17 @@ class TestNFS(MgrTestCase):
         exec_cmd_invalid('export', 'info')
         exec_cmd_invalid('export', 'info', 'clusterid')
         exec_cmd_invalid('export', 'apply')
+
+    def test_nfs_export_with_invalid_path(self):
+        """
+        Test that nfs exports can't be created with invalid path
+        """
+        self._test_create_cluster()
+        try:
+            self._create_export(export_id='123',
+                                extra_cmd=['--pseudo-path', self.pseudo_path,
+                                           '--path', '/non_existent_dir'])
+        except CommandFailedError as e:
+            if e.exitstatus != errno.ENOENT:
+                raise
+        self._test_delete_cluster()