'sudo', 'chmod', '0755', '/etc/ceph', run.Raw('&&'),
'sudo', 'python',
'-c',
- 'import shutil, sys; shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))',
+ ('import shutil, sys; '
+ 'shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))'),
conf_path,
run.Raw('&&'),
'sudo', 'chmod', '0644', conf_path,
"--data-path {fpath} --journal-path {jpath} "
"--type keyvaluestore-dev "
"--log-file="
- "/var/log/ceph/objectstore_tool.\\$pid.log".
+ "/var/log/ceph/objectstore_tool.\\$pid.log ".
format(fpath=FSPATH, jpath=JPATH))
else:
prefix = ("sudo ceph-objectstore-tool "
"--data-path {fpath} --journal-path {jpath} "
"--log-file="
- "/var/log/ceph/objectstore_tool.\\$pid.log".
+ "/var/log/ceph/objectstore_tool.\\$pid.log ".
format(fpath=FSPATH, jpath=JPATH))
cmd = (prefix + "--op list-pgs").format(id=exp_osd)
proc = exp_remote.run(args=cmd, wait=True,
time.sleep(delay)
self.all_up()
+
class CephManager:
"""
Ceph manager object.
log = logging.getLogger(__name__)
+
def choose_primary(ctx, pool, num):
"""
Return primary to test on.
log.info("Choosing primary")
return ctx.manager.get_pg_primary(pool, num)
+
def choose_replica(ctx, pool, num):
"""
Return replica to test on.
log.info("Choosing replica")
return ctx.manager.get_pg_replica(pool, num)
+
def trunc(ctx, osd, pool, obj):
"""
truncate an object
osd,
['truncobj', pool, obj, '1'])
+
def dataerr(ctx, osd, pool, obj):
"""
- cause an error in the data
+ cause an error in the data
"""
log.info("injecting data err on object")
return ctx.manager.osd_admin_socket(
osd,
['injectdataerr', pool, obj])
+
def mdataerr(ctx, osd, pool, obj):
"""
cause an error in the mdata
osd,
['injectmdataerr', pool, obj])
+
def omaperr(ctx, osd, pool, obj):
"""
Cause an omap error.
"""
log.info("injecting omap err on object")
- return ctx.manager.osd_admin_socket(osd, ['setomapval', pool, obj, 'badkey', 'badval']);
+ return ctx.manager.osd_admin_socket(osd, ['setomapval', pool, obj,
+ 'badkey', 'badval'])
def repair_test_1(ctx, corrupter, chooser, scrub_type):
"""
assert not ctx.manager.pg_inconsistent(pool, 0)
log.info("done")
+
def repair_test_2(ctx, config, chooser):
"""
First creates a set of objects and
sets the omap value. It then corrupts an object, does both a scrub
and a deep-scrub, and then corrupts more objects. After that, it
repairs the pool and makes sure that the pool is consistent some
- time after a deep-scrub.
+ time after a deep-scrub.
:param chooser: primary or replica selection routine.
"""
# create object
log.info("doing put and setomapval")
ctx.manager.do_put(pool, 'file1', '/etc/hosts')
- ctx.manager.do_rados(mon, ['-p', pool, 'setomapval', 'file1', 'key', 'val'])
+ ctx.manager.do_rados(mon, ['-p', pool, 'setomapval', 'file1',
+ 'key', 'val'])
ctx.manager.do_put(pool, 'file2', '/etc/hosts')
ctx.manager.do_put(pool, 'file3', '/etc/hosts')
ctx.manager.do_put(pool, 'file4', '/etc/hosts')
ctx.manager.do_put(pool, 'file5', '/etc/hosts')
- ctx.manager.do_rados(mon, ['-p', pool, 'setomapval', 'file5', 'key', 'val'])
+ ctx.manager.do_rados(mon, ['-p', pool, 'setomapval', 'file5',
+ 'key', 'val'])
ctx.manager.do_put(pool, 'file6', '/etc/hosts')
# corrupt object
- chef:
- install:
- ceph:
- log-whitelist: ['candidate had a read error', 'deep-scrub 0 missing, 1 inconsistent objects', 'deep-scrub 0 missing, 4 inconsistent objects', 'deep-scrub 1 errors', 'deep-scrub 4 errors', '!= known omap_digest', 'repair 0 missing, 1 inconsistent objects', 'repair 0 missing, 4 inconsistent objects', 'repair 1 errors, 1 fixed', 'repair 4 errors, 4 fixed', 'scrub 0 missing, 1 inconsistent', 'scrub 1 errors', 'size 1 != known size']
+ log-whitelist:
+ - 'candidate had a read error'
+ - 'deep-scrub 0 missing, 1 inconsistent objects'
+ - 'deep-scrub 0 missing, 4 inconsistent objects'
+ - 'deep-scrub 1 errors'
+ - 'deep-scrub 4 errors'
+ - '!= known omap_digest'
+ - 'repair 0 missing, 1 inconsistent objects'
+ - 'repair 0 missing, 4 inconsistent objects'
+ - 'repair 1 errors, 1 fixed'
+ - 'repair 4 errors, 4 fixed'
+ - 'scrub 0 missing, 1 inconsistent'
+ - 'scrub 1 errors'
+ - 'size 1 != known size'
conf:
osd:
filestore debug inject read err: true