]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/cephfs: update _conduct_neg_test_for_root_squash_caps
authorRishabh Dave <ridave@redhat.com>
Fri, 28 Jun 2024 11:26:00 +0000 (16:56 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 28 Jun 2024 11:47:54 +0000 (17:17 +0530)
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 <ridave@redhat.com>
qa/tasks/cephfs/caps_helper.py

index 80bc2137b3e5d6defb5a3cd72fa4b012c95f0d1c..211605e07d68ff5359b041a8d6d50b3347bd33cf 100644 (file)
@@ -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