from teuthology.orchestra import run
import ceph_client as cclient
from teuthology.orchestra.daemon import DaemonGroup
+from tasks.daemonwatchdog import DaemonWatchdog
CEPH_ROLE_TYPES = ['mon', 'mgr', 'osd', 'mds', 'rgw']
DATA_PATH = '/var/lib/ceph/{type_}/{cluster}-{id_}'
yield
+@contextlib.contextmanager
+def watchdog_setup(ctx, config):
+ ctx.ceph[config['cluster']].thrashers = []
+ ctx.ceph[config['cluster']].watchdog = DaemonWatchdog(ctx, config, ctx.ceph[config['cluster']].thrashers)
+ ctx.ceph[config['cluster']].watchdog.start()
+ yield
def get_mons(roles, ips, cluster_name,
mon_bind_msgr2=False,
cluster, type_, id_ = teuthology.split_role(role)
ctx.daemons.get_daemon(type_, id_, cluster).stop()
+ ctx.ceph[config['cluster']].watchdog.stop()
+ ctx.ceph[config['cluster']].watchdog.join()
yield
lambda: create_rbd_pool(ctx=ctx, config=config),
lambda: cephfs_setup(ctx=ctx, config=config),
lambda: run_daemon(ctx=ctx, config=config, type_='mds'),
+ lambda: watchdog_setup(ctx=ctx, config=config),
]
with contextutil.nested(*subtasks):
from teuthology import misc as teuthology
from tasks.cephfs.filesystem import MDSCluster, Filesystem
-from tasks.daemonwatchdog import DaemonWatchdog
log = logging.getLogger(__name__)
status = mds_cluster.status()
log.info('Ready to start thrashing')
- thrashers = []
-
- watchdog = DaemonWatchdog(ctx, manager, config, thrashers)
- watchdog.start()
-
manager.wait_for_clean()
assert manager.is_clean()
+
+ if 'cluster' not in config:
+ config['cluster'] = 'ceph'
+
for fs in status.get_filesystems():
thrasher = MDSThrasher(ctx, manager, config, Filesystem(ctx, fs['id']), fs['mdsmap']['max_mds'])
thrasher.start()
- thrashers.append(thrasher)
+ ctx.ceph[config['cluster']].thrashers.append(thrasher)
try:
log.debug('Yielding')
yield
finally:
log.info('joining mds_thrashers')
- for thrasher in thrashers:
+ for thrasher in ctx.ceph[config['cluster']].thrashers:
thrasher.stop()
if thrasher.e:
raise RuntimeError('error during thrashing')
thrasher.join()
log.info('done joining')
-
- watchdog.stop()
- watchdog.join()