This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master in repository sanlock.
commit 68b5d5cdb037299cd6d629bcf15867330f1d5093 Author: Nir Soffer nirsof@gmail.com AuthorDate: Fri Apr 19 18:24:36 2019 +0300
tests: Allow testing large files
util.create_file() was filling the file with "x". This works for small files but prevent testing big files. Change to create sparse file so we can test easily large files and offsets.
Tests that want to fill areas on storage can access the file directly. We don't have such tests yet.
Signed-off-by: Nir Soffer nsoffer@redhat.com --- tests/util.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/tests/util.py b/tests/util.py index 2259473..a6b53e3 100644 --- a/tests/util.py +++ b/tests/util.py @@ -97,11 +97,9 @@ def wait_for_termination(p, timeout): time.sleep(0.05)
-def create_file(path, size, poison=b"x", guard=b"X", guard_size=4096): +def create_file(path, size, guard=b"X", guard_size=4096): """ - Create file filled with poison byte. - - To create an empty file, set poison to None. + Create sparse file of size bytes.
If guard is set, add a guard area after the end of the file and fill it with guard bytes. This allows testing that the code under test do not write @@ -109,11 +107,9 @@ def create_file(path, size, poison=b"x", guard=b"X", guard_size=4096): """ with io.open(path, "wb") as f: f.truncate(size) - if poison: - f.write(poison * size) if guard: f.seek(size) - f.write(guard * 4096) + f.write(guard * guard_size)
def check_guard(path, size, guard=b"X", guard_size=4096):
sanlock-devel@lists.fedorahosted.org