summaryrefslogtreecommitdiffstats
path: root/qa/tasks/cephfs/fuse_mount.py
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2020-04-24 04:24:01 +0200
committerXiubo Li <xiubli@redhat.com>2020-04-25 12:21:55 +0200
commit211c3fbb4b031233379a31e89d776a482a8aa36b (patch)
treec95b60998c9ba807f5311451c6a0382f4c2e48b6 /qa/tasks/cephfs/fuse_mount.py
parentqa/tasks/vstart_runner: remove the stdin str type check (diff)
downloadceph-211c3fbb4b031233379a31e89d776a482a8aa36b.tar.xz
ceph-211c3fbb4b031233379a31e89d776a482a8aa36b.zip
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 <xiubli@redhat.com>
Diffstat (limited to '')
-rw-r--r--qa/tasks/cephfs/fuse_mount.py23
1 files changed, 14 insertions, 9 deletions
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