]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: fix test_nfs_export_with_invalid_path
authorDhairya Parmar <dparmar@redhat.com>
Tue, 11 Apr 2023 12:14:41 +0000 (17:44 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Tue, 2 May 2023 09:50:12 +0000 (15:20 +0530)
It actually didn't test the invalid path but still ended with
ENOENT(which is expected in case path is invalid) as the test
didn't create a fs, and it failed saying "FS nfs-cephfs not found"
which too raises ENOENT and thus it always passed.

Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit 5cc0857)

qa/tasks/cephfs/test_nfs.py

index 24374630fd3e12a1ca90ab230369dd860ca9db6e..b4cf64b1bb5300af97fd6070aa8f15aba6a31a2c 100644 (file)
@@ -826,7 +826,9 @@ class TestNFS(MgrTestCase):
         """
         Test that nfs exports can't be created with invalid path
         """
-        self._test_create_cluster()
+        mnt_pt = '/mnt'
+        preserve_mode = self._sys_cmd(['stat', '-c', '%a', mnt_pt])
+        self._create_cluster_with_fs(self.fs_name, mnt_pt)
         try:
             self._create_export(export_id='123',
                                 extra_cmd=['--pseudo-path', self.pseudo_path,
@@ -834,7 +836,7 @@ class TestNFS(MgrTestCase):
         except CommandFailedError as e:
             if e.exitstatus != errno.ENOENT:
                 raise
-        self._test_delete_cluster()
+        self._delete_cluster_with_fs(self.fs_name, mnt_pt, preserve_mode)
 
     def test_nfs_export_creation_at_filepath(self):
         """