"""
if config is None:
config = {}
+ assert isinstance(config, dict), \
+ "task ceph only supports a dictionary for configuration"
flavor = None
if config.get('coverage'):
if failed:
raise RuntimeError('Stale jobs detected, aborting.')
+ coverage_dir = '/tmp/cephtest/archive/coverage'
log.info('Creating directories...')
run.wait(
ctx.cluster.run(
'/tmp/cephtest/archive/log',
'/tmp/cephtest/archive/profiling-logger',
'/tmp/cephtest/data',
+ coverage_dir,
],
wait=False,
)
log.info('Setting up mon.0...')
ctx.cluster.only('mon.0').run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cauthtool',
'--create-keyring',
'/tmp/cephtest/ceph.keyring',
)
ctx.cluster.only('mon.0').run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cauthtool',
'--gen-key',
'--name=mon.',
log.info('Creating admin key on mon.0...')
ctx.cluster.only('mon.0').run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cauthtool',
'--gen-key',
'--name=client.admin',
run.wait(
mons.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/osdmaptool',
'--clobber',
'--createsimple', '{num:d}'.format(
for id_ in teuthology.roles_of_type(roles_for_host, 'mon'):
remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cmon',
'--mkfs',
'-i', id_,
for id_ in teuthology.roles_of_type(roles_for_host, 'mon'):
proc = remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/daemon-helper',
'/tmp/cephtest/binary/usr/local/bin/cmon',
'-f',
for id_ in teuthology.roles_of_type(roles_for_host, 'osd'):
remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cauthtool',
'--create-keyring',
'--gen-key',
for id_ in teuthology.roles_of_type(roles_for_host, 'mds'):
remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cauthtool',
'--create-keyring',
'--gen-key',
for id_ in teuthology.roles_of_type(roles_for_host, 'client'):
remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cauthtool',
'--create-keyring',
'--gen-key',
)
mon0_remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cauthtool',
'/tmp/cephtest/temp.keyring',
'--name={type}.{id}'.format(
)
mon0_remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/ceph',
'-c', '/tmp/cephtest/ceph.conf',
'-k', '/tmp/cephtest/ceph.keyring',
# TODO where does this belong?
mon0_remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/ceph',
'-c', '/tmp/cephtest/ceph.conf',
'-k', '/tmp/cephtest/ceph.keyring',
)
remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/binary/usr/local/bin/cosd',
'--mkfs',
'-i', id_,
for id_ in teuthology.roles_of_type(roles_for_host, 'osd'):
proc = remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/daemon-helper',
'/tmp/cephtest/binary/usr/local/bin/cosd',
'-f',
for id_ in teuthology.roles_of_type(roles_for_host, 'mds'):
proc = remote.run(
args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
'/tmp/cephtest/daemon-helper',
'/tmp/cephtest/binary/usr/local/bin/cmds',
'-f',
try:
yield
finally:
- log.info('Shutting down mds daemons...')
- for id_, proc in mds_daemons.iteritems():
- proc.stdin.close()
- run.wait(mds_daemons.itervalues())
-
- log.info('Shutting down osd daemons...')
- for id_, proc in osd_daemons.iteritems():
- proc.stdin.close()
- run.wait(osd_daemons.itervalues())
-
- log.info('Shutting down mon daemons...')
- for id_, proc in mon_daemons.iteritems():
- proc.stdin.close()
- run.wait(mon_daemons.itervalues())
+ if config.get('coverage'):
+ # need to exit cleanly to trigger atexit coverage data writing
+ mon0_remote.run(
+ args=[
+ '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+ coverage_dir,
+ '/tmp/cephtest/binary/usr/local/bin/ceph',
+ '-c', '/tmp/cephtest/ceph.conf',
+ 'all_exit'
+ ]
+ )
+ else:
+ log.info('Shutting down mds daemons...')
+ for id_, proc in mds_daemons.iteritems():
+ proc.stdin.close()
+ run.wait(mds_daemons.itervalues())
+
+ log.info('Shutting down osd daemons...')
+ for id_, proc in osd_daemons.iteritems():
+ proc.stdin.close()
+ run.wait(osd_daemons.itervalues())
+
+ log.info('Shutting down mon daemons...')
+ for id_, proc in mon_daemons.iteritems():
+ proc.stdin.close()
+ run.wait(mon_daemons.itervalues())
log.info('Removing uninteresting files...')
run.wait(