From: Rishabh Dave Date: Fri, 28 Jun 2024 11:26:00 +0000 (+0530) Subject: qa/cephfs: update _conduct_neg_test_for_root_squash_caps X-Git-Tag: testing/wip-rishabh-testing-20240909.104658-reef~1^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e758f37d1bc83bead173d4c7cd1c3fb5ebfb1830;p=ceph-ci.git qa/cephfs: update _conduct_neg_test_for_root_squash_caps This method was backported in commit 59c9104c54d64e449062d350346b33ad0b3371c9 with modifications instead of backporting along all commits that were needed. Now that those commmits have been backported, this method is broken and required modifications again. This is a direct commit to Reef branch since it's a direct fix and not a backport/cherry-pick. Fixes: https://tracker.ceph.com/issues/65970 Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/cephfs/caps_helper.py b/qa/tasks/cephfs/caps_helper.py index 80bc2137b3e..211605e07d6 100644 --- a/qa/tasks/cephfs/caps_helper.py +++ b/qa/tasks/cephfs/caps_helper.py @@ -348,18 +348,19 @@ class CapTester(MonCapTester, MdsCapTester): possible_errmsgs = ('permission denied', 'operation not permitted') cmdargs = ['sudo'] if sudo_write else [''] cmdargs += _cmdargs + log.info(f'test absence of {_cmdargs[0]} perm: expect failure {self.path}.') - for mount, path, data in self.test_set: - log.info(f'test absence of {_cmdargs[0]} perm: expect failure {path}.') - - # open the file and hold it. The MDS will issue CEPH_CAP_EXCL_* - # to mount - proc = mount.open_background(path) - cmdargs.append(path) - mount.negtestcmd(args=cmdargs, retval=1, errmsgs=possible_errmsgs) - cmdargs.pop(-1) - mount._kill_background(proc) - log.info(f'absence of {_cmdargs[0]} perm was tested successfully') + # open the file and hold it. The MDS will issue CEPH_CAP_EXCL_* + # to mount + proc = self.mount.open_background(self.path) + + cmdargs.append(self.path) + self.mount.negtestcmd(args=cmdargs, retval=1, errmsgs=possible_errmsgs) + cmdargs.pop(-1) + + self.mount._kill_background(proc) + + log.info(f'absence of {_cmdargs[0]} perm was tested successfully') def conduct_neg_test_for_chown_caps(self, sudo_write=True): # flip ownership to nobody. assumption: nobody's id is 65534