summaryrefslogtreecommitdiff
path: root/test/py/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/py/utils.py')
-rw-r--r--test/py/utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/py/utils.py b/test/py/utils.py
index ca80e4b0b0a..e8971502509 100644
--- a/test/py/utils.py
+++ b/test/py/utils.py
@@ -51,6 +51,19 @@ def md5sum_file(fn, max_length=None):
data = fh.read(*params)
return md5sum_data(data)
+def generate_file(file_name, file_size):
+ """ Generates a file filled with 'x'.
+
+ Args:
+ file_name: the file's name.
+ file_size: the content's length and therefore the file size.
+ """
+ content = 'x' * file_size
+
+ file = open(file_name, 'w')
+ file.write(content)
+ file.close()
+
class PersistentRandomFile:
"""Generate and store information about a persistent file containing
random data."""