From: Ramana Raja Date: Fri, 11 Mar 2022 21:36:44 +0000 (-0500) Subject: cephfs/test_nfs: fix _write_to_read_only_export() X-Git-Tag: v16.2.8~58^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b45d67bf1f4d2c3f55778cad0d59cfbfc84e6b8;p=ceph.git cephfs/test_nfs: fix _write_to_read_only_export() ... to fail the test if write to read only export succeeded. Signed-off-by: Ramana Raja (cherry picked from commit 3c22f6eb716b4b4f2817566a5b14350f7dd3310e) --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 97269a32c55b..af448be5d76e 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -300,8 +300,11 @@ class TestNFS(MgrTestCase): self._test_mnt(pseudo_path, port, ip) except CommandFailedError as e: # Write to cephfs export should fail for test to pass - if e.exitstatus != errno.EPERM: - raise + self.assertEqual( + e.exitstatus, errno.EPERM, + 'invalid error code on trying to write to read-only export') + else: + self.fail('expected write to a read-only export to fail') def test_create_and_delete_cluster(self): '''