]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #33576 from lxbsz/fuse
authorGregory Farnum <gfarnum@redhat.com>
Wed, 22 Apr 2020 05:12:37 +0000 (22:12 -0700)
committerGitHub <noreply@github.com>
Wed, 22 Apr 2020 05:12:37 +0000 (22:12 -0700)
unshare-ns-mount: add isolating netns for mount helper support

Reviewed-by: Jeff Layton <jlayton@redhat.com>
1  2 
doc/dev/developer_guide/running-tests-locally.rst
qa/tasks/cephfs/fuse_mount.py
qa/tasks/cephfs/kernel_mount.py
qa/tasks/cephfs/test_data_scan.py
qa/tasks/cephfs/test_volumes.py
qa/tasks/vstart_runner.py

index c4d78552839173f712b9cf77498aef6162e9e954,49cd6198f9f1c4c5caca066a82ae90051a8392e5..7a8df18e5dd25806248de8546d4bbea2132a3f4e
@@@ -246,13 -253,11 +255,14 @@@ class FuseMount(CephFSMount)
          return self.client_remote.run(args=["ls", "-d", self.mountpoint], check_status=False, cwd=self.test_dir, timeout=(15*60)).exitstatus == 0
  
      def umount(self):
 +        if not self.is_mounted():
 +            return
 +
          try:
              log.info('Running fusermount -u on {name}...'.format(name=self.client_remote.name))
+             stderr = BytesIO()
              self.client_remote.run(
-                 args=[
+                 args = [
                      'sudo',
                      'fusermount',
                      '-u',
Simple merge
Simple merge
Simple merge
index 603dfa02d4fdefd3d2fd514cf891d260ff27a713,42e09f188f72b5b37853dfa90ddcdb39b1bbfd6b..68ddab7dcac750076b736bd34b9b4e135fa8f6c9
@@@ -640,8 -628,36 +641,9 @@@ class LocalKernelMount(KernelMount)
          log.info("I think my launching pid was {0}".format(self.fuse_daemon.subproc.pid))
          return path
  
 -    def umount(self, force=False):
 -        log.debug('Unmounting client client.{id}...'.format(id=self.client_id))
 -
 -        cmd=['sudo', 'umount', self.mountpoint]
 -        if force:
 -            cmd.append('-f')
 -
 -        try:
 -            self.client_remote.run(args=cmd, timeout=(15*60), omit_sudo=False)
 -        except Exception as e:
 -            self.client_remote.run(args=[
 -                'sudo',
 -                Raw('PATH=/usr/sbin:$PATH'),
 -                'lsof',
 -                Raw(';'),
 -                'ps', 'auxf',
 -            ], timeout=(15*60), omit_sudo=False)
 -            raise e
 -
 -        rproc = self.client_remote.run(args=[
 -                'rmdir',
 -                '--',
 -                self.mountpoint,
 -            ])
 -        rproc.wait()
 -        self.mounted = False
 -
      def mount(self, mount_path=None, mount_fs_name=None, mount_options=[]):
          self.setupfs(name=mount_fs_name)
+         self.setup_netns()
  
          log.info('Mounting kclient client.{id} at {remote} {mnt}...'.format(
              id=self.client_id, remote=self.client_remote, mnt=self.mountpoint))
@@@ -1395,12 -1436,12 +1419,12 @@@ def exec_test()
                                   "mds", "allow",
                                   "mon", "allow r"])
  
 -            open("./keyring", "a").write(p.stdout.getvalue())
 +            open("./keyring", "ab").write(p.stdout.getvalue())
  
          if use_kernel_client:
-             mount = LocalKernelMount(ctx, test_dir, client_id)
+             mount = LocalKernelMount(ctx, test_dir, client_id, opt_brxnet)
          else:
-             mount = LocalFuseMount(ctx, test_dir, client_id)
+             mount = LocalFuseMount(ctx, test_dir, client_id, opt_brxnet)
  
          mounts.append(mount)
          if os.path.exists(mount.mountpoint):