Run watch_notify_same_primary The config should be as follows: watch_notify_same_primary: clients: [client list] The client list should contain 1 client The test requires 3 osds. example: tasks: - ceph: - watch_notify_same_primary: clients:
(ctx, config)
| 15 | |
| 16 | @contextlib.contextmanager |
| 17 | def task(ctx, config): |
| 18 | """ |
| 19 | Run watch_notify_same_primary |
| 20 | |
| 21 | The config should be as follows: |
| 22 | |
| 23 | watch_notify_same_primary: |
| 24 | clients: [client list] |
| 25 | |
| 26 | The client list should contain 1 client |
| 27 | |
| 28 | The test requires 3 osds. |
| 29 | |
| 30 | example: |
| 31 | |
| 32 | tasks: |
| 33 | - ceph: |
| 34 | - watch_notify_same_primary: |
| 35 | clients: [client.0] |
| 36 | - interactive: |
| 37 | """ |
| 38 | log.info('Beginning watch_notify_same_primary...') |
| 39 | assert isinstance(config, dict), \ |
| 40 | "please list clients to run on" |
| 41 | |
| 42 | clients = config.get('clients', ['client.0']) |
| 43 | assert len(clients) == 1 |
| 44 | role = clients[0] |
| 45 | assert isinstance(role, str) |
| 46 | PREFIX = 'client.' |
| 47 | assert role.startswith(PREFIX) |
| 48 | (remote,) = ctx.cluster.only(role).remotes.keys() |
| 49 | manager = ctx.managers['ceph'] |
| 50 | manager.raw_cluster_cmd('osd', 'set', 'noout') |
| 51 | |
| 52 | pool = manager.create_pool_with_unique_name() |
| 53 | def obj(n): return "foo-{num}".format(num=n) |
| 54 | def start_watch(n): |
| 55 | remote.run( |
| 56 | args = [ |
| 57 | "rados", |
| 58 | "-p", pool, |
| 59 | "put", |
| 60 | obj(n), |
| 61 | "/etc/resolv.conf"], |
| 62 | logger=log.getChild('watch.{id}'.format(id=n))) |
| 63 | proc = remote.run( |
| 64 | args = [ |
| 65 | "rados", |
| 66 | "-p", pool, |
| 67 | "watch", |
| 68 | obj(n)], |
| 69 | stdin=run.PIPE, |
| 70 | stdout=StringIO(), |
| 71 | stderr=StringIO(), |
| 72 | wait=False) |
| 73 | return proc |
| 74 |
nothing calls this directly
no test coverage detected