log.info("Client client.%s config is %s" % (self.client_id,
self.client_config))
- self._create_mntpt()
+ self._create_mntpt(cwd=self.test_dir)
retval = self._run_mount_cmd(mntopts, check_status)
if retval:
self.mounted = True
- def _create_mntpt(self):
- stderr = StringIO()
- # Use 0000 mode to prevent undesired modifications to the mountpoint on
- # the local file system.
- script = f'mkdir -m 0000 -p -v {self.hostfs_mntpt}'.split()
- try:
- self.client_remote.run(args=script, timeout=(15*60),
- stderr=stderr)
- except CommandFailedError:
- if 'file exists' not in stderr.getvalue().lower():
- raise
-
def _run_mount_cmd(self, mntopts, check_status):
mount_cmd = self._get_mount_cmd(mntopts)
mountcmd_stdout, mountcmd_stderr = StringIO(), StringIO()
return mount_cmd
- @property
- def _nsenter_args(self):
- return ['nsenter', f'--net=/var/run/netns/{self.netns_name}']
-
def _add_valgrind_args(self, mount_cmd):
if self.client_config.get('valgrind') is not None:
mount_cmd = get_valgrind_args(
self.mounted = True
- def _create_mntpt(self):
- stderr = StringIO()
- try:
- self.client_remote.run(args=['mkdir', '-p', self.hostfs_mntpt],
- timeout=(5*60), stderr=stderr)
- except CommandFailedError:
- if 'file exists' not in stderr.getvalue().lower():
- raise
-
def _run_mount_cmd(self, mntopts, check_status):
mount_cmd = self._get_mount_cmd(mntopts)
mountcmd_stdout, mountcmd_stderr = StringIO(), StringIO()
return mount_cmd
- @property
- def _nsenter_args(self):
- return ['nsenter', f'--net=/var/run/netns/{self.netns_name}']
-
- def _set_filemode_on_mntpt(self):
- stderr = StringIO()
- try:
- self.client_remote.run(
- args=['sudo', 'chmod', '1777', self.hostfs_mntpt],
- stderr=stderr, timeout=(5*60))
- except CommandFailedError:
- # the client does not have write permissions in the caps it holds
- # for the Ceph FS that was just mounted.
- if 'permission denied' in stderr.getvalue().lower():
- pass
-
def umount(self, force=False):
if not self.is_mounted():
self.cleanup()
self.fs.wait_for_daemons()
log.info('Ready to start {}...'.format(type(self).__name__))
+ def _create_mntpt(self, cwd=None):
+ stderr = StringIO()
+ # Use 0000 mode to prevent undesired modifications to the mountpoint on
+ # the local file system.
+ script = f'mkdir -m 0000 -p -v {self.hostfs_mntpt}'.split()
+ try:
+ self.client_remote.run(args=script, timeout=(15*60),
+ stderr=stderr)
+ except CommandFailedError:
+ if 'file exists' not in stderr.getvalue().lower():
+ raise
+
+ @property
+ def _nsenter_args(self):
+ return ['nsenter', f'--net=/var/run/netns/{self.netns_name}']
+
+ def _set_filemode_on_mntpt(self):
+ stderr = StringIO()
+ try:
+ self.client_remote.run(
+ args=['sudo', 'chmod', '1777', self.hostfs_mntpt],
+ stderr=stderr, timeout=(5*60))
+ except CommandFailedError:
+ # the client does not have write permissions in the caps it holds
+ # for the Ceph FS that was just mounted.
+ if 'permission denied' in stderr.getvalue().lower():
+ pass
+
def _setup_brx_and_nat(self):
# The ip for ceph-brx should be
ip = IP(self.ceph_brx_net)[-2]