]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/nfs:Add test for relative and just '/' pseudo path
authorVarsha Rao <varao@redhat.com>
Tue, 21 Jul 2020 09:59:35 +0000 (15:29 +0530)
committerVarsha Rao <varao@redhat.com>
Thu, 23 Jul 2020 07:33:38 +0000 (13:03 +0530)
Signed-off-by: Varsha Rao <varao@redhat.com>
qa/tasks/cephfs/test_nfs.py

index 3631c267ce12193468fc4113485f4ce307cc9c3e..9d1a0fb14ed1ce7290f07cde8ddb98582738a299 100644 (file)
@@ -361,6 +361,27 @@ class TestNFS(MgrTestCase):
             if e.exitstatus != errno.ENOENT:
                 raise
 
+    def test_export_create_with_relative_pseudo_path_and_root_directory(self):
+        '''
+        Test creating cephfs export with relative or '/' pseudo path.
+        '''
+        def check_pseudo_path(pseudo_path):
+            try:
+                self._nfs_cmd('export', 'create', 'cephfs', self.fs_name, self.cluster_id,
+                              pseudo_path)
+                self.fail(f"Export created for {pseudo_path}")
+            except CommandFailedError as e:
+                # Command should fail for test to pass
+                if e.exitstatus != errno.EINVAL:
+                    raise
+
+        self._test_create_cluster()
+        self._cmd('fs', 'volume', 'create', self.fs_name)
+        check_pseudo_path('invalidpath')
+        check_pseudo_path('/')
+        check_pseudo_path('//')
+        self._test_delete_cluster()
+
     def test_cluster_info(self):
         '''
         Test cluster info outputs correct ip and hostname