MCPcopy Create free account
hub / github.com/ceph/ceph / task

Function task

qa/tasks/ceph_objectstore_tool.py:162–245  ·  view source on GitHub ↗

Run ceph_objectstore_tool test The config should be as follows:: ceph_objectstore_tool: objects: 20 # pgnum: 12 crimson_objectstore_tool: true # use crimson-objectstore-tool instead of ceph-objectstore-tool gc_before_rest

(ctx, config)

Source from the content-addressed store, hash-verified

160
161@contextlib.contextmanager
162def task(ctx, config):
163 """
164 Run ceph_objectstore_tool test
165
166 The config should be as follows::
167
168 ceph_objectstore_tool:
169 objects: 20 # <number of objects>
170 pgnum: 12
171 crimson_objectstore_tool: true # use crimson-objectstore-tool instead of ceph-objectstore-tool
172 gc_before_restart: true # run crimson-objectstore-tool --op gc before restarting OSDs
173 """
174
175 if config is None:
176 config = {}
177 assert isinstance(config, dict), \
178 'ceph_objectstore_tool task only accepts a dict for configuration'
179
180 # Set global CRIMSON flags based on configuration
181 global CRIMSON
182 global CRIMSON_DEVICE_TYPE
183 CRIMSON = config.get('crimson_objectstore_tool', False)
184 log.info('crimson_objectstore_tool is {}...'.format(CRIMSON))
185
186 log.debug(config)
187 log.debug(ctx)
188 clients = ctx.cluster.only(teuthology.is_type('client'))
189 assert len(clients.remotes) > 0, 'Must specify at least 1 client'
190 (cli_remote, _) = clients.remotes.popitem()
191 log.debug(cli_remote)
192
193 # clients = dict(teuthology.get_clients(ctx=ctx, roles=config.keys()))
194 # client = clients.popitem()
195 # log.info(client)
196 osds = ctx.cluster.only(teuthology.is_type('osd'))
197 log.info("OSDS")
198 log.info(osds)
199 log.info(osds.remotes)
200
201 manager = ctx.managers['ceph']
202 while (len(manager.get_osd_status()['up']) !=
203 len(manager.get_osd_status()['raw'])):
204 time.sleep(10)
205 while (len(manager.get_osd_status()['in']) !=
206 len(manager.get_osd_status()['up'])):
207 time.sleep(10)
208 manager.raw_cluster_cmd('osd', 'set', 'noout')
209 manager.raw_cluster_cmd('osd', 'set', 'nodown')
210
211 if CRIMSON:
212 CRIMSON_DEVICE_TYPE = manager.get_config('osd', 0, 'seastore_main_device_type')
213 log.info('seastore_main_device_type is {}...'.format(CRIMSON_DEVICE_TYPE))
214
215 PGNUM = config.get('pgnum', 12)
216 log.info("pgnum: {num}".format(num=PGNUM))
217
218 ERRORS = 0
219

Callers

nothing calls this directly

Calls 13

create_replicated_poolFunction · 0.90
create_ec_poolFunction · 0.90
test_objectstoreFunction · 0.85
onlyMethod · 0.80
get_osd_statusMethod · 0.80
raw_cluster_cmdMethod · 0.80
getMethod · 0.45
infoMethod · 0.45
formatMethod · 0.45
debugMethod · 0.45
sleepMethod · 0.45
get_configMethod · 0.45

Tested by

no test coverage detected