]> git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/watch_notify_stress.py
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / qa / tasks / watch_notify_stress.py
1 """
2 test_stress_watch task
3 """
4 import contextlib
5 import logging
6 import proc_thrasher
7
8 from teuthology.orchestra import run
9
10 log = logging.getLogger(__name__)
11
12
13 @contextlib.contextmanager
14 def task(ctx, config):
15 """
16 Run test_stress_watch
17
18 The config should be as follows:
19
20 test_stress_watch:
21 clients: [client list]
22
23 example:
24
25 tasks:
26 - ceph:
27 - test_stress_watch:
28 clients: [client.0]
29 - interactive:
30 """
31 log.info('Beginning test_stress_watch...')
32 assert isinstance(config, dict), \
33 "please list clients to run on"
34 testwatch = {}
35
36 remotes = []
37
38 for role in config.get('clients', ['client.0']):
39 assert isinstance(role, basestring)
40 PREFIX = 'client.'
41 assert role.startswith(PREFIX)
42 id_ = role[len(PREFIX):]
43 (remote,) = ctx.cluster.only(role).remotes.iterkeys()
44 remotes.append(remote)
45
46 args =['CEPH_CLIENT_ID={id_}'.format(id_=id_),
47 'CEPH_ARGS="{flags}"'.format(flags=config.get('flags', '')),
48 'daemon-helper',
49 'kill',
50 'multi_stress_watch foo foo'
51 ]
52
53 log.info("args are %s" % (args,))
54
55 proc = proc_thrasher.ProcThrasher({}, remote,
56 args=[run.Raw(i) for i in args],
57 logger=log.getChild('testwatch.{id}'.format(id=id_)),
58 stdin=run.PIPE,
59 wait=False
60 )
61 proc.start()
62 testwatch[id_] = proc
63
64 try:
65 yield
66 finally:
67 log.info('joining watch_notify_stress')
68 for i in testwatch.itervalues():
69 i.join()