]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs/fuse_mount: fix possible chmod 1777 error
authorXiubo Li <xiubli@redhat.com>
Fri, 24 Apr 2020 02:24:01 +0000 (22:24 -0400)
committerXiubo Li <xiubli@redhat.com>
Sat, 25 Apr 2020 10:21:55 +0000 (06:21 -0400)
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 <xiubli@redhat.com>
qa/tasks/cephfs/fuse_mount.py

index 179a2dfdea519c3e1faa4da5fee86973695e452a..f46689b5b06f4fda8a46d74e4a1a5a857aade70f 100644 (file)
@@ -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