From: Xiubo Li Date: Fri, 24 Apr 2020 02:24:01 +0000 (-0400) Subject: qa/tasks/cephfs/fuse_mount: fix possible chmod 1777 error X-Git-Tag: wip-pdonnell-testing-20200918.022351~1439^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=211c3fbb4b031233379a31e89d776a482a8aa36b;p=ceph-ci.git qa/tasks/cephfs/fuse_mount: fix possible chmod 1777 error INFO:teuthology.orchestra.run.smithi13a2:> (cd /home/ubuntu/cephtest && exec sudo chmod 1777 /home/ubuntu/cephtest/mnt.2) INFO:teuthology.orchestra.run.smithi132.stderr:chmod: changing permissions of '/home/ubuntu/cephtest/mnt.2': Permission denied DEBUG:teuthology.orchestra.run:got remote process result: 1 Here just wait and rety for 10 times. Signed-off-by: Xiubo Li --- diff --git a/qa/tasks/cephfs/fuse_mount.py b/qa/tasks/cephfs/fuse_mount.py index 179a2dfdea5..f46689b5b06 100644 --- a/qa/tasks/cephfs/fuse_mount.py +++ b/qa/tasks/cephfs/fuse_mount.py @@ -240,15 +240,20 @@ class FuseMount(CephFSMount): # Now that we're mounted, set permissions so that the rest of the test will have # unrestricted access to the filesystem mount. - try: - stderr = StringIO() - self.client_remote.run(args=['sudo', 'chmod', '1777', self.mountpoint], timeout=(15*60), cwd=self.test_dir, stderr=stderr) - except run.CommandFailedError: - stderr = stderr.getvalue() - if "Read-only file system".lower() in stderr.lower(): - pass - else: - raise + for retry in range(10): + try: + stderr = StringIO() + self.client_remote.run(args=['sudo', 'chmod', '1777', self.mountpoint], + timeout=(15*60), cwd=self.test_dir, stderr=stderr) + break + except run.CommandFailedError: + stderr = stderr.getvalue() + if "Read-only file system".lower() in stderr.lower(): + break + elif "Permission denied".lower() in stderr.lower(): + time.sleep(5) + else: + raise def _mountpoint_exists(self): return self.client_remote.run(args=["ls", "-d", self.mountpoint], check_status=False, cwd=self.test_dir, timeout=(15*60)).exitstatus == 0