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: v17.2.1~48^2~53 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=02e3d56787d05572567d89af4c6a11493364dbf3;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 8f3afd67129f..eec50a1bb310 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): '''