]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/cephfs_mirror.py
2 Task for running cephfs mirror daemons
7 from teuthology
.orchestra
import run
8 from teuthology
import misc
9 from teuthology
.exceptions
import ConfigError
10 from teuthology
.task
import Task
11 from tasks
.ceph_manager
import get_valgrind_args
12 from tasks
.util
import get_remote_for_role
14 log
= logging
.getLogger(__name__
)
16 class CephFSMirror(Task
):
17 def __init__(self
, ctx
, config
):
18 super(CephFSMirror
, self
).__init
__(ctx
, config
)
22 super(CephFSMirror
, self
).setup()
24 self
.client
= self
.config
['client']
26 raise ConfigError('cephfs-mirror requires a client to connect')
28 self
.cluster_name
, type_
, self
.client_id
= misc
.split_role(self
.client
)
29 if not type_
== 'client':
30 raise ConfigError(f
'client role {self.client} must be a client')
31 self
.remote
= get_remote_for_role(self
.ctx
, self
.client
)
34 super(CephFSMirror
, self
).begin()
35 testdir
= misc
.get_testdir(self
.ctx
)
40 '{tdir}/archive/coverage'.format(tdir
=testdir
),
45 if 'valgrind' in self
.config
:
46 args
= get_valgrind_args(
47 testdir
, 'cephfs-mirror-{id}'.format(id=self
.client
),
48 args
, self
.config
.get('valgrind'))
57 if 'run_in_foreground' in self
.config
:
58 args
.extend(['--foreground'])
60 self
.ctx
.daemons
.add_daemon(
61 self
.remote
, 'cephfs-mirror', self
.client
,
63 logger
=self
.log
.getChild(self
.client
),
69 mirror_daemon
= self
.ctx
.daemons
.get_daemon('cephfs-mirror', self
.client
)
71 super(CephFSMirror
, self
).end()