subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1846503 - in /subversion/trunk/subversion/tests/cmdline: svnrdump_tests.py svnrdump_tests_data/bad-date-r0.dump svnrdump_tests_data/bad-date-r1.dump
Date Tue, 13 Nov 2018 12:42:13 GMT
Author: julianfoad
Date: Tue Nov 13 12:42:13 2018
New Revision: 1846503

URL: http://svn.apache.org/viewvc?rev=1846503&view=rev
Log:
Add a regression test for svnrdump's validation of revprops.

Adds test coverage for issue SVN-4780 "Factor out the dumpstream loader
editor driver".

* subversion/tests/cmdline/svnrdump_tests_data/bad-date-r0.dump
  subversion/tests/cmdline/svnrdump_tests_data/bad-date-r1.dump
  New files.

* subversion/tests/cmdline/svnrdump_tests.py
  (load_invalid_svn_date_revprop_in_r0,
   load_invalid_svn_date_revprop_in_r1): New tests.
  (test_list): Run them.

Added:
    subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r0.dump
    subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r1.dump
Modified:
    subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py?rev=1846503&r1=1846502&r2=1846503&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py Tue Nov 13 12:42:13 2018
@@ -991,6 +991,36 @@ def load_non_deltas_with_props(sbox):
     actual = map(str.strip, out)
     svntest.verify.compare_and_display_lines(None, 'PROPS', expected, actual)
 
+def load_invalid_svn_date_revprop_in_r0(sbox):
+  "load: invalid svn:date revprop in r0"
+  svnrdump_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
+                                    'svnrdump_tests_data')
+  sbox.build(create_wc=False, empty=True)
+  svntest.actions.enable_revprop_changes(sbox.repo_dir)
+  expected_err = svntest.verify.RegexListOutput(
+                   ['.* E125005: Wrong or unexpected property value.*'],
+                   match_all=False)
+  dumpfile = "bad-date-r0.dump"
+  dumpfile_path = os.path.join(svnrdump_tests_dir, dumpfile)
+  run_and_verify_svnrdump_load(dumpfile_path,
+                               [], expected_err, 1,
+                               sbox.repo_url)
+
+def load_invalid_svn_date_revprop_in_r1(sbox):
+  "load: invalid svn:date revprop in r1"
+  svnrdump_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
+                                    'svnrdump_tests_data')
+  sbox.build(create_wc=False, empty=True)
+  svntest.actions.enable_revprop_changes(sbox.repo_dir)
+  expected_err = svntest.verify.RegexListOutput(
+                   ['.* E125005: Wrong or unexpected property value.*'],
+                   match_all=False)
+  dumpfile = "bad-date-r0.dump"
+  dumpfile_path = os.path.join(svnrdump_tests_dir, dumpfile)
+  run_and_verify_svnrdump_load(dumpfile_path,
+                               [], expected_err, 1,
+                               sbox.repo_url)
+
 ########################################################################
 # Run the tests
 
@@ -1052,6 +1082,8 @@ test_list = [ None,
               load_non_deltas_replace_copy_with_props,
               dump_replace_with_copy,
               load_non_deltas_with_props,
+              load_invalid_svn_date_revprop_in_r0,
+              load_invalid_svn_date_revprop_in_r1,
              ]
 
 if __name__ == '__main__':

Added: subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r0.dump
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r0.dump?rev=1846503&view=auto
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r0.dump (added)
+++ subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r0.dump Tue Nov
13 12:42:13 2018
@@ -0,0 +1,14 @@
+SVN-fs-dump-format-version: 3
+
+UUID: 0e893bae-2d4c-452c-8616-b774d5b9104e
+
+Revision-number: 0
+Prop-content-length: 36
+Content-length: 36
+
+K 8
+svn:date
+V 8
+bad date
+PROPS-END
+

Added: subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r1.dump
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r1.dump?rev=1846503&view=auto
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r1.dump (added)
+++ subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/bad-date-r1.dump Tue Nov
13 12:42:13 2018
@@ -0,0 +1,24 @@
+SVN-fs-dump-format-version: 3
+
+UUID: 0e893bae-2d4c-452c-8616-b774d5b9104e
+
+Revision-number: 0
+Prop-content-length: 36
+Content-length: 36
+
+K 8
+property
+V 8
+anything
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 36
+Content-length: 36
+
+K 8
+svn:date
+V 8
+bad date
+PROPS-END
+



Mime
View raw message