Author: philip
Date: Wed Mar 14 14:26:04 2018
New Revision: 1826721
URL: http://svn.apache.org/viewvc?rev=1826721&view=rev
Log:
Add a regression test for issue 4722, a commit checksum fail in 1.9.7.
* subversion/tests/cmdline/commit_tests.py
(commit_issue4722_checksum): New.
(test_list): Add new test.
Modified:
subversion/trunk/subversion/tests/cmdline/commit_tests.py
Modified: subversion/trunk/subversion/tests/cmdline/commit_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/commit_tests.py?rev=1826721&r1=1826720&r2=1826721&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/commit_tests.py Wed Mar 14
14:26:04 2018
@@ -3113,6 +3113,39 @@ def commit_xml(sbox):
sbox.simple_append('index.html', '<Q></R>', True)
sbox.simple_commit()
+@Issue(4722)
+def commit_issue4722_checksum(sbox):
+ "commit that triggered checksum failure"
+
+ sbox.build()
+
+ # This bug only ever affected FSFS in 1.9.7. The test could be
+ # considered a bit "fragile" as any change to the on-disk
+ # representation may well make it pass trivially. On the other hand
+ # it should still pass irrespective of that representation, and for
+ # all other repository types.
+
+ # Enough data to allow the bug to occur
+ with open(sbox.ospath('f'), 'w') as fp:
+ for i in range(0, 2001):
+ fp.write('abcdefghijklmnopqrstuvwxyz')
+ sbox.simple_add('f')
+ sbox.simple_commit()
+
+ # Just the right data to trigger the bug
+ with open(sbox.ospath('f'), 'w') as fp:
+ for i in range(0, 8713):
+ fp.write(str(i))
+ fp.write("11111")
+ sbox.simple_commit()
+
+ # Trigger deduplication which is when the bug occurred
+ with open(sbox.ospath('f'), 'w') as fp:
+ for i in range(0, 2001):
+ fp.write('abcdefghijklmnopqrstuvwxyz')
+ sbox.simple_commit()
+
+
########################################################################
# Run the tests
@@ -3190,6 +3223,7 @@ test_list = [ None,
commit_mergeinfo_ood,
mkdir_conflict_proper_error,
commit_xml,
+ commit_issue4722_checksum,
]
if __name__ == '__main__':