Do simple I/O tests to the iscsi interface before putting a
filesystem on it.
"""
+ rem.run(
+ args=[
+ 'udevadm',
+ 'settle',
+ ])
test_phrase = 'The time has come the walrus said to speak of many things.'
lnkpath = tgt_devname_get(ctx, image_name)
proc = rem.run(args=['mktemp'], stdout=StringIO(),)
])
if proc.exitstatus == 0:
tgtd_list.append((rem, rem_name))
- rem.run(
- args=[
- 'udevadm',
- 'settle',
- ])
general_io_test(ctx, rem, host)
+ try:
with contextutil.nested(
lambda: generic_mkfs(ctx=ctx, config={host: {'fs_type': 'xfs'}},
devname_rtn=tgt_devname_rtn),
lambda: generic_mount(ctx=ctx, config={host: None},
devname_rtn=tgt_devname_rtn),
):
- pass
- try:
- yield
+ yield
finally:
for rem_info in tgtd_list:
rem = rem_info[0]
'node',
'--logout',
])
- rem.run(
- args=[
- 'sudo',
- 'iscsiadm',
- '-m',
- 'discovery',
- '-p',
- rem_name,
- '-o',
- 'delete',
- ])
-
@contextlib.contextmanager
def task(ctx, config):
if _id in start_tgtd:
if not rem in tgtd_list:
tgtd_list.append(rem)
+ size = ctx.config.get('image_size', 10240)
rem.run(
args=[
'rbd',
'create',
'iscsi-image',
'--size',
- '500',
+ str(size),
])
rem.run(
args=[
client.0:
client.3:
+ An image blocksize size can also be specified::
+
+ tasks:
+ - ceph:
+ - tgt:
+ image_size = 20480
+
The general flow of things here is:
1. Find clients on which tgt is supposed to run (start_tgtd)
2. Remotely start up tgt daemon
The iscsi administration is handled by the iscsi task.
"""
+ if config:
+ config = {key : val for key, val in config.items()
+ if key.startswith('client')}
+ # config at this point should only contain keys starting with 'client'
start_tgtd = []
remotes = ctx.cluster.only(teuthology.is_type('client')).remotes
log.info(remotes)
- if config == None:
+ if not config:
start_tgtd = ['client.{id}'.format(id=id_)
for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
else: