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

Method write_test_pattern

qa/tasks/cephfs/mount.py:1277–1289  ·  view source on GitHub ↗
(self, filename, size)

Source from the content-addressed store, hash-verified

1275 ], wait=wait)
1276
1277 def write_test_pattern(self, filename, size):
1278 log.info("Writing {0} bytes to {1}".format(size, filename))
1279 return self.run_python(dedent("""
1280 import zlib
1281 path = "{path}"
1282 with open(path, 'w') as f:
1283 for i in range(0, {size}):
1284 val = zlib.crc32(str(i).encode('utf-8')) & 7
1285 f.write(chr(val))
1286 """.format(
1287 path=os.path.join(self.hostfs_mntpt, filename),
1288 size=size
1289 )))
1290
1291 def validate_test_pattern(self, filename, size, timeout=None):
1292 log.info("Validating {0} bytes from {1}".format(size, filename))

Callers 4

test_multimds_mksnapMethod · 0.80
writeMethod · 0.80
writeMethod · 0.80
test_snapshot_removeMethod · 0.80

Calls 4

run_pythonMethod · 0.95
infoMethod · 0.45
formatMethod · 0.45
joinMethod · 0.45

Tested by 4

test_multimds_mksnapMethod · 0.64
writeMethod · 0.64
writeMethod · 0.64
test_snapshot_removeMethod · 0.64