From 6b45d67bf1f4d2c3f55778cad0d59cfbfc84e6b8 Mon Sep 17 00:00:00 2001 From: Ramana Raja Date: Fri, 11 Mar 2022 16:36:44 -0500 Subject: [PATCH] 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) --- qa/tasks/cephfs/test_nfs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 97269a32c55bb..af448be5d76e3 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): ''' -- 2.39.5