From: Patrick Donnelly Date: Wed, 3 Mar 2021 02:45:01 +0000 (-0800) Subject: qa: skip chdir for fuse_mount X-Git-Tag: v17.1.0~2736^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e5e03d4d29020a918fd34591e9cdd78c38579e4;p=ceph.git qa: skip chdir for fuse_mount The use of chdir will muck up the use of nsenter with valgrind: 2021-03-03T02:13:49.897 DEBUG:teuthology.orchestra.run.smithi144:> sudo nsenter --net=/var/run/netns/ceph-ns--home-ubuntu-cephtest-mnt.0 cd /home/ubuntu/cephtest && sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage daemon-helper term env 'OPENSSL_ia32cap=~0x1000000000000000' valgrind --trace-children=no --child-silent-after-fork=yes '--soname-synonyms=somalloc=*tcmalloc*' --num-callers=50 --suppressions=/home/ubuntu/cephtest/valgrind.supp --xml=yes --xml-file=/var/log/ceph/valgrind/client.0.log --time-stamp=yes --vgdb=yes --exit-on-first-error=yes --error-exitcode=42 --tool=memcheck --leak-check=full --show-reachable=yes ceph-fuse -f --admin-socket '/var/run/ceph/$cluster-$name.$pid.asok' --id 0 /home/ubuntu/cephtest/mnt.0 2021-03-03T02:13:49.899 DEBUG:teuthology.orchestra.run.smithi144:> sudo modprobe fuse 2021-03-03T02:13:49.914 INFO:teuthology.orchestra.run:Running command with timeout 30 2021-03-03T02:13:49.914 DEBUG:teuthology.orchestra.run.smithi144:> sudo mount -t fusectl /sys/fs/fuse/connections /sys/fs/fuse/connections 2021-03-03T02:13:49.919 INFO:tasks.cephfs.fuse_mount.ceph-fuse.0.smithi144.stderr:nsenter: failed to execute cd: No such file or directory It's not necessary to chdir at all to do the mount, so don't. Signed-off-by: Patrick Donnelly --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index ce6fec15517..6bd5cd08af7 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -68,7 +68,7 @@ def write_conf(ctx, conf_path=DEFAULT_CONF_PATH, cluster='ceph'): teuthology.feed_many_stdins_and_close(conf_fp, writes) run.wait(writes) -def get_valgrind_args(testdir, name, preamble, v, exit_on_first_error=True): +def get_valgrind_args(testdir, name, preamble, v, exit_on_first_error=True, cd=True): """ Build a command line for running valgrind. @@ -118,10 +118,10 @@ def get_valgrind_args(testdir, name, preamble, v, exit_on_first_error=True): '--exit-on-first-error=yes', '--error-exitcode=42', ]) - args = [ - 'cd', testdir, - run.Raw('&&'), - ] + preamble + extra_args + v + args = [] + if cd: + args += ['cd', testdir, run.Raw('&&')] + args += preamble + extra_args + v log.debug('running %s under valgrind with args %s', name, args) return args diff --git a/qa/tasks/cephfs/fuse_mount.py b/qa/tasks/cephfs/fuse_mount.py index e8279d4b47c..63af6248808 100644 --- a/qa/tasks/cephfs/fuse_mount.py +++ b/qa/tasks/cephfs/fuse_mount.py @@ -63,7 +63,7 @@ class FuseMount(CephFSMount): stderr = StringIO() try: self.client_remote.run(args=script, timeout=(15*60), - cwd=self.test_dir, stderr=StringIO()) + stderr=StringIO()) except CommandFailedError: if 'file exists' not in stderr.getvalue().lower(): raise @@ -93,15 +93,14 @@ class FuseMount(CephFSMount): fuse_cmd += mntopts fuse_cmd.append(self.hostfs_mntpt) - cwd = self.test_dir if self.client_config.get('valgrind') is not None: run_cmd = get_valgrind_args( self.test_dir, 'client.{id}'.format(id=self.client_id), run_cmd, self.client_config.get('valgrind'), + cd=False ) - cwd = None # get_valgrind_args chdir for us netns_prefix = ['sudo', 'nsenter', '--net=/var/run/netns/{0}'.format(self.netns_name)] @@ -138,7 +137,6 @@ class FuseMount(CephFSMount): mountcmd_stdout, mountcmd_stderr = StringIO(), StringIO() self.fuse_daemon = self.client_remote.run( args=run_cmd, - cwd=cwd, logger=log.getChild('ceph-fuse.{id}'.format(id=self.client_id)), stdin=run.PIPE, stdout=mountcmd_stdout, @@ -218,7 +216,6 @@ class FuseMount(CephFSMount): '--', self.hostfs_mntpt, ], - cwd=self.test_dir, stdout=StringIO(), stderr=StringIO(), wait=False, @@ -269,7 +266,7 @@ class FuseMount(CephFSMount): stderr = StringIO() self.client_remote.run(args=['sudo', 'chmod', '1777', self.hostfs_mntpt], - timeout=(15*60), cwd=self.test_dir, + timeout=(15*60), stderr=stderr, omit_sudo=False) break except run.CommandFailedError: @@ -282,7 +279,7 @@ class FuseMount(CephFSMount): raise def _mountpoint_exists(self): - return self.client_remote.run(args=["ls", "-d", self.hostfs_mntpt], check_status=False, cwd=self.test_dir, timeout=(15*60)).exitstatus == 0 + return self.client_remote.run(args=["ls", "-d", self.hostfs_mntpt], check_status=False, timeout=(15*60)).exitstatus == 0 def umount(self, cleanup=True): """ @@ -299,7 +296,7 @@ class FuseMount(CephFSMount): stderr = StringIO() self.client_remote.run(args=['sudo', 'fusermount', '-u', self.hostfs_mntpt], - cwd=self.test_dir, stderr=stderr, + stderr=stderr, timeout=(30*60), omit_sudo=False) except run.CommandFailedError: if "mountpoint not found" in stderr.getvalue():