def json_asok(self, command, service_type, service_id, timeout=None):
if timeout is None:
- timeout = 15*60
+ timeout = 300
command.insert(0, '--format=json')
proc = self.mon_manager.admin_socket(service_type, service_id, command, timeout=timeout)
response_data = proc.stdout.getvalue().strip()
from teuthology.orchestra import run
from teuthology.exceptions import CommandFailedError
from tasks.ceph_manager import get_valgrind_args
-from tasks.cephfs.mount import CephFSMount
+from tasks.cephfs.mount import CephFSMount, UMOUNT_TIMEOUT
log = logging.getLogger(__name__)
try:
ls_str = self.client_remote.sh("ls " + conn_dir,
stdout=StringIO(),
- timeout=(15*60)).strip()
+ timeout=300).strip()
except CommandFailedError:
return []
stdout=StringIO(),
stderr=StringIO(),
wait=False,
- timeout=(15*60)
+ timeout=300
)
try:
proc.wait()
stderr = StringIO()
self.client_remote.run(args=['sudo', 'chmod', '1777',
self.hostfs_mntpt],
- timeout=(15*60),
+ timeout=300,
stderr=stderr, omit_sudo=False)
break
except run.CommandFailedError:
raise
def _mountpoint_exists(self):
- return self.client_remote.run(args=["ls", "-d", self.hostfs_mntpt], check_status=False, timeout=(15*60)).exitstatus == 0
+ return self.client_remote.run(args=["ls", "-d", self.hostfs_mntpt],
+ check_status=False,
+ timeout=300).exitstatus == 0
def umount(self, cleanup=True):
"""
try:
log.info('Running fusermount -u on {name}...'.format(name=self.client_remote.name))
stderr = StringIO()
- self.client_remote.run(args=['sudo', 'fusermount', '-u',
- self.hostfs_mntpt],
- stderr=stderr,
- timeout=(30*60), omit_sudo=False)
+ self.client_remote.run(
+ args=['sudo', 'fusermount', '-u', self.hostfs_mntpt],
+ stderr=stderr, timeout=UMOUNT_TIMEOUT, omit_sudo=False)
except run.CommandFailedError:
if "mountpoint not found" in stderr.getvalue():
# This happens if the mount directory doesn't exist
self.client_remote.run(
args=['sudo', run.Raw('PATH=/usr/sbin:$PATH'), 'lsof',
run.Raw(';'), 'ps', 'auxf'],
- timeout=(60*15), omit_sudo=False)
+ timeout=UMOUNT_TIMEOUT, omit_sudo=False)
# abort the fuse mount, killing all hung processes
if self._fuse_conn:
stderr = StringIO()
# make sure its unmounted
try:
- self.client_remote.run(args=['sudo', 'umount', '-l', '-f',
- self.hostfs_mntpt],
- stderr=stderr, timeout=(60*15), omit_sudo=False)
+ self.client_remote.run(
+ args=['sudo', 'umount', '-l', '-f', self.hostfs_mntpt],
+ stderr=stderr, timeout=UMOUNT_TIMEOUT, omit_sudo=False)
except CommandFailedError:
if self.is_mounted():
raise
if cleanup:
self.cleanup()
- def umount_wait(self, force=False, require_clean=False, timeout=900):
+ def umount_wait(self, force=False, require_clean=False,
+ timeout=UMOUNT_TIMEOUT):
"""
:param force: Complete cleanly even if the MDS is offline
"""
p = self.client_remote.run(args=
['sudo', self._prefix + 'ceph', '--admin-daemon', asok_path] + args,
stdout=StringIO(), stderr=StringIO(), wait=False,
- timeout=(15*60))
+ timeout=300)
p.wait()
break
except CommandFailedError:
from teuthology.orchestra import run
from teuthology.contextutil import MaxWhileTries
-from tasks.cephfs.mount import CephFSMount
+from tasks.cephfs.mount import CephFSMount, UMOUNT_TIMEOUT
log = logging.getLogger(__name__)
-UMOUNT_TIMEOUT = 300
# internal metadata directory
DEBUGFS_META_DIR = 'meta'
mountcmd_stdout, mountcmd_stderr = StringIO(), StringIO()
try:
- self.client_remote.run(args=mount_cmd, timeout=(30*60),
+ self.client_remote.run(args=mount_cmd, timeout=300,
stdout=mountcmd_stdout,
stderr=mountcmd_stderr, omit_sudo=False)
except CommandFailedError as e:
cmd=['sudo', 'umount', self.hostfs_mntpt]
if force:
cmd.append('-f')
- self.client_remote.run(args=cmd, timeout=(15*60), omit_sudo=False)
+ self.client_remote.run(args=cmd, timeout=UMOUNT_TIMEOUT, omit_sudo=False)
except Exception as e:
log.debug('Killing processes on client.{id}...'.format(id=self.client_id))
self.client_remote.run(
args=['sudo', run.Raw('PATH=/usr/sbin:$PATH'), 'lsof',
run.Raw(';'), 'ps', 'auxf'],
- timeout=(15*60), omit_sudo=False)
+ timeout=UMOUNT_TIMEOUT, omit_sudo=False)
raise e
if self.dynamic_debug:
self.mounted = False
self.cleanup()
- def umount_wait(self, force=False, require_clean=False, timeout=900):
+ def umount_wait(self, force=False, require_clean=False,
+ timeout=UMOUNT_TIMEOUT):
"""
Unlike the fuse client, the kernel client's umount is immediate
"""
# force delete the netns and umount
log.debug('Force/lazy unmounting on client.{id}...'.format(id=self.client_id))
self.client_remote.run(args=['sudo', 'umount', '-f', '-l',
- self.mountpoint],
- timeout=(15*60), omit_sudo=False)
+ self.mountpoint], timeout=timeout,
+ omit_sudo=False)
self.mounted = False
self.cleanup()
log = logging.getLogger(__name__)
+
+UMOUNT_TIMEOUT = 300
+
+
class CephFSMount(object):
def __init__(self, ctx, test_dir, client_id, client_remote,
client_keyring_path=None, hostfs_mntpt=None,
def umount(self):
raise NotImplementedError()
- def umount_wait(self, force=False, require_clean=False, timeout=None):
+ def umount_wait(self, force=False, require_clean=False,
+ timeout=UMOUNT_TIMEOUT):
"""
:param force: Expect that the mount will not shutdown cleanly: kill
p.wait()
return p.stdout.getvalue().strip()
- def run_shell(self, args, timeout=900, **kwargs):
+ def run_shell(self, args, timeout=300, **kwargs):
args = args.split() if isinstance(args, str) else args
kwargs.pop('omit_sudo', False)
sudo = kwargs.pop('sudo', False)