subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1622195 [3/3] - in /subversion/branches/move-tracking-2: ./ build/ notes/ notes/wc-ng/ subversion/bindings/ctypes-python/ subversion/bindings/cxxhl/ subversion/bindings/swig/ subversion/bindings/swig/include/ subversion/include/ subversion...
Date Wed, 03 Sep 2014 09:14:59 GMT
Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/relocate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/relocate_tests.py?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/cmdline/relocate_tests.py (original)
+++ subversion/branches/move-tracking-2/subversion/tests/cmdline/relocate_tests.py Wed Sep
 3 09:14:58 2014
@@ -208,17 +208,13 @@ def relocate_and_propset(sbox):
   # Create virgin repos and working copy
   svntest.main.safe_rmtree(sbox.repo_dir, 1)
   svntest.main.create_repos(sbox.repo_dir)
+  svntest.actions.guarantee_greek_repository(
+      sbox.repo_dir, svntest.main.options.server_minor_version)
 
   wc_dir = sbox.wc_dir
   repo_dir = sbox.repo_dir
   repo_url = sbox.repo_url
 
-  # import the greek tree
-  svntest.main.greek_state.write_to_disk(svntest.main.greek_dump_dir)
-  exit_code, output, errput = svntest.main.run_svn(
-    None, 'import', '-m', 'Log message for revision 1.',
-    svntest.main.greek_dump_dir, sbox.repo_url)
-
   # checkout
   svntest.main.safe_rmtree(wc_dir, 1)
   svntest.actions.run_and_verify_svn(None,
@@ -273,19 +269,15 @@ def single_file_relocate(sbox):
 
   # Create virgin repos and working copy
   svntest.main.safe_rmtree(sbox.repo_dir, 1)
-  svntest.main.create_repos(sbox.repo_dir)
+  svntest.actions.guarantee_greek_repository(
+      sbox.repo_dir, svntest.main.options.server_minor_version)
 
   wc_dir = sbox.wc_dir
   iota_path = os.path.join(sbox.wc_dir, 'iota')
   repo_dir = sbox.repo_dir
   repo_url = sbox.repo_url
   iota_url = repo_url + '/iota'
-
-  # import the greek tree
-  svntest.main.greek_state.write_to_disk(svntest.main.greek_dump_dir)
-  exit_code, output, errput = svntest.main.run_svn(
-    None, 'import', '-m', 'Log message for revision 1.',
-    svntest.main.greek_dump_dir, sbox.repo_url)
+  greek_dump_dir = sbox.add_wc_path('greek-dump')
 
   # checkout
   svntest.main.safe_rmtree(wc_dir, 1)

Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py Wed Sep
 3 09:14:58 2014
@@ -1243,6 +1243,7 @@ def fsfs_recover_handle_missing_revs_or_
 
 #----------------------------------------------------------------------
 
+@Skip(svntest.main.tests_use_prepacakaged_repository)
 def create_in_repo_subdir(sbox):
   "'svnadmin create /path/to/repo/subdir'"
 
@@ -2385,7 +2386,7 @@ def load_ignore_dates(sbox):
   load_dumpstream(sbox, dumpfile_skeleton, '--ignore-dates')
   svntest.actions.run_and_verify_svnlook("Unexpected output", ['6\n'],
                                          None, 'youngest', sbox.repo_dir)
-  for rev in range(6):
+  for rev in range(1, 6):
     exit_code, output, errput = svntest.main.run_svnlook('date', '-r', rev,
                                                          sbox.repo_dir)
     if errput:
@@ -2590,10 +2591,9 @@ def freeze_freeze(sbox):
     # FSFS repositories created with --compatible-version=1.8 and less
     # erroneously share the filesystem data (locks, shared transaction
     # data, ...) between hotcopy source and destination.  This is fixed
-    # for new FS formats, but in order to avoid SVN_ERR_RECURSIVE_LOCK
-    # for old formats, we have to manually assign a new UUID for the
-    # hotcopy destination.  As of trunk@1618024, the same applies to
-    # FSX repositories.
+    # for new FS formats, but in order to avoid a deadlock for old formats,
+    # we have to manually assign a new UUID for the hotcopy destination.
+    # As of trunk@1618024, the same applies to FSX repositories.
     svntest.actions.run_and_verify_svnadmin(None, [], None,
                                             'setuuid', second_repo_dir)
 
@@ -2896,7 +2896,7 @@ def fsfs_hotcopy_progress_old(sbox):
                                           sbox.repo_dir, inc_backup_dir)
 
 
-@SkipUnless(svntest.main.is_fs_type_fsfs)
+@SkipUnless(svntest.main.fs_has_unique_freeze)
 def freeze_same_uuid(sbox):
   "freeze multiple repositories with same UUID"
 
@@ -2905,10 +2905,9 @@ def freeze_same_uuid(sbox):
   first_repo_dir, _ = sbox.add_repo_path('first')
   second_repo_dir, _ = sbox.add_repo_path('second')
 
-  # Test that 'svnadmin freeze A (svnadmin freeze B)' does not deadlock or
-  # error out with SVN_ERR_RECURSIVE_LOCK for new FSFS formats, even if 'A'
-  # and 'B' share the same UUID.  Create two repositories by loading the
-  # same dump file, ...
+  # Test that 'svnadmin freeze A (svnadmin freeze B)' does not deadlock for
+  # new FSFS formats, even if 'A' and 'B' share the same UUID.  Create two
+  # repositories by loading the same dump file, ...
   svntest.main.create_repos(first_repo_dir)
   svntest.main.create_repos(second_repo_dir)
 
@@ -2920,16 +2919,11 @@ def freeze_same_uuid(sbox):
   svntest.actions.run_and_verify_load(second_repo_dir, dump_contents)
 
   # ...and execute the 'svnadmin freeze -F' command.
-  if svntest.main.options.server_minor_version < 9:
-    expected_error = ".*svnadmin: E200043:.*"
-  else:
-    expected_error = None
-
   arg_file = sbox.get_tempname()
   svntest.main.file_write(arg_file,
                           "%s\n%s\n" % (first_repo_dir, second_repo_dir))
 
-  svntest.actions.run_and_verify_svnadmin(None, None, expected_error,
+  svntest.actions.run_and_verify_svnadmin(None, None, None,
                                           'freeze', '-F', arg_file, '--',
                                           sys.executable, '-c', 'True')
 

Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/actions.py?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/actions.py Wed Sep
 3 09:14:58 2014
@@ -76,46 +76,49 @@ def setup_pristine_greek_repository():
 
   # If there's no pristine repos, create one.
   if not os.path.exists(main.pristine_greek_repos_dir):
-    main.create_repos(main.pristine_greek_repos_dir)
+    if main.options.fsfs_version is not None:
+      main.unpack_greek_repos(main.pristine_greek_repos_dir)
+    else:
+      main.create_repos(main.pristine_greek_repos_dir)
 
-    # if this is dav, gives us access rights to import the greek tree.
-    if main.is_ra_type_dav():
-      authz_file = os.path.join(main.work_dir, "authz")
-      main.file_write(authz_file, "[/]\n* = rw\n")
-
-    # dump the greek tree to disk.
-    main.greek_state.write_to_disk(main.greek_dump_dir)
-
-    # import the greek tree, using l:foo/p:bar
-    ### todo: svn should not be prompting for auth info when using
-    ### repositories with no auth/auth requirements
-    _, output, _ = main.run_svn(None, 'import', '-m',
-                                'Log message for revision 1.',
-                                main.greek_dump_dir,
-                                main.pristine_greek_repos_url)
+      # if this is dav, gives us access rights to import the greek tree.
+      if main.is_ra_type_dav():
+        authz_file = os.path.join(main.work_dir, "authz")
+        main.file_write(authz_file, "[/]\n* = rw\n")
+
+      # dump the greek tree to disk.
+      main.greek_state.write_to_disk(main.greek_dump_dir)
+
+      # import the greek tree, using l:foo/p:bar
+      ### todo: svn should not be prompting for auth info when using
+      ### repositories with no auth/auth requirements
+      _, output, _ = main.run_svn(None, 'import', '-m',
+                                  'Log message for revision 1.',
+                                  main.greek_dump_dir,
+                                  main.pristine_greek_repos_url)
 
-    # verify the printed output of 'svn import'.
-    lastline = output.pop().strip()
-    match = re.search("(Committed|Imported) revision [0-9]+.", lastline)
-    if not match:
-      logger.error("import did not succeed, while creating greek repos.")
-      logger.error("The final line from 'svn import' was:")
-      logger.error(lastline)
-      sys.exit(1)
-    output_tree = wc.State.from_commit(output)
-
-    expected_output_tree = main.greek_state.copy(main.greek_dump_dir)
-    expected_output_tree.tweak(verb='Adding',
-                               contents=None)
+      # verify the printed output of 'svn import'.
+      lastline = output.pop().strip()
+      match = re.search("(Committed|Imported) revision [0-9]+.", lastline)
+      if not match:
+        logger.error("import did not succeed, while creating greek repos.")
+        logger.error("The final line from 'svn import' was:")
+        logger.error(lastline)
+        sys.exit(1)
+      output_tree = wc.State.from_commit(output)
+
+      expected_output_tree = main.greek_state.copy(main.greek_dump_dir)
+      expected_output_tree.tweak(verb='Adding',
+                                 contents=None)
 
-    try:
-      expected_output_tree.compare_and_display('output', output_tree)
-    except tree.SVNTreeUnequal:
-      verify.display_trees("ERROR:  output of import command is unexpected.",
-                           "OUTPUT TREE",
-                           expected_output_tree.old_tree(),
-                           output_tree.old_tree())
-      sys.exit(1)
+      try:
+        expected_output_tree.compare_and_display('output', output_tree)
+      except tree.SVNTreeUnequal:
+        verify.display_trees("ERROR:  output of import command is unexpected.",
+                             "OUTPUT TREE",
+                             expected_output_tree.old_tree(),
+                             output_tree.old_tree())
+        sys.exit(1)
 
     # Finally, disallow any changes to the "pristine" repos.
     error_msg = "Don't modify the pristine repository"
@@ -153,7 +156,12 @@ def guarantee_greek_repository(path, min
 
   # copy the pristine repository to PATH.
   main.safe_rmtree(path)
-  if main.copy_repos(main.pristine_greek_repos_dir, path, 1, 1, minor_version):
+  if (main.options.fsfs_version is not None):
+    failed = main.unpack_greek_repos(path)
+  else:
+    failed = main.copy_repos(main.pristine_greek_repos_dir,
+                             path, 1, 1, minor_version)
+  if failed:
     logger.error("copying repository failed.")
     sys.exit(1)
 

Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py Wed Sep 
3 09:14:58 2014
@@ -36,6 +36,7 @@ import xml
 import urllib
 import logging
 import hashlib
+import zipfile
 from urlparse import urlparse
 
 try:
@@ -907,6 +908,16 @@ def file_substitute(path, contents, new_
   fcontent = open(path, 'r').read().replace(contents, new_contents)
   open(path, 'w').write(fcontent)
 
+def _unpack_precooked_repos(path, template):
+  testdir = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
+  repozip = os.path.join(os.path.dirname(testdir), "templates", template)
+  zipfile.ZipFile(repozip, 'r').extractall(path)
+
+# For creating new, pre-cooked greek repositories
+def unpack_greek_repos(path):
+  template = "greek-fsfs-v%d.zip" % options.fsfs_version
+  _unpack_precooked_repos(path, template)
+
 # For creating blank new repositories
 def create_repos(path, minor_version = None):
   """Create a brand-new SVN repository at PATH.  If PATH does not yet
@@ -915,14 +926,25 @@ def create_repos(path, minor_version = N
   if not os.path.exists(path):
     os.makedirs(path) # this creates all the intermediate dirs, if necessary
 
-  opts = ("--bdb-txn-nosync",)
-  if minor_version is None or minor_version > options.server_minor_version:
-    minor_version = options.server_minor_version
-  opts += ("--compatible-version=1.%d" % (minor_version),)
-  if options.fs_type is not None:
-    opts += ("--fs-type=" + options.fs_type,)
-  exit_code, stdout, stderr = run_command(svnadmin_binary, 1, False, "create",
-                                          path, *opts)
+  if options.fsfs_version is None:
+    if options.fs_type == "bdb":
+      opts = ("--bdb-txn-nosync",)
+    else:
+      opts = ()
+    if minor_version is None or minor_version > options.server_minor_version:
+      minor_version = options.server_minor_version
+    opts += ("--compatible-version=1.%d" % (minor_version),)
+    if options.fs_type is not None:
+      opts += ("--fs-type=" + options.fs_type,)
+    exit_code, stdout, stderr = run_command(svnadmin_binary, 1, False,
+                                            "create", path, *opts)
+  else:
+    # Copy a pre-cooked FSFS repository
+    assert options.fs_type == "fsfs"
+    template = "empty-fsfs-v%d.zip" % options.fsfs_version
+    _unpack_precooked_repos(path, template)
+    exit_code, stdout, stderr = run_command(svnadmin_binary, 1, False,
+                                            "setuuid", path)
 
   # Skip tests if we can't create the repository.
   if stderr:
@@ -1335,6 +1357,9 @@ def make_log_msg():
 # Functions which check the test configuration
 # (useful for conditional XFails)
 
+def tests_use_prepacakaged_repository():
+  return options.fsfs_version is not None
+
 def is_ra_type_dav():
   return options.test_area_url.startswith('http')
 
@@ -1380,6 +1405,10 @@ def fs_has_pack():
   return is_fs_type_fsx() or \
         (is_fs_type_fsfs() and options.server_minor_version >= 6)
 
+def fs_has_unique_freeze():
+  return (is_fs_type_fsfs() and options.server_minor_version >= 9
+          or is_fs_type_bdb())
+
 def is_os_windows():
   return os.name == 'nt'
 
@@ -1505,6 +1534,8 @@ class TestSpawningThread(threading.Threa
       args.append('--fsfs-sharding=' + str(options.fsfs_sharding))
     if options.fsfs_packing:
       args.append('--fsfs-packing')
+    if options.fsfs_version:
+      args.append('--fsfs-version=' + str(options.fsfs_version))
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, False, None,
                                                        *args)
@@ -1827,6 +1858,8 @@ def _create_parser():
                     help="Run 'svnadmin pack' automatically")
   parser.add_option('--fsfs-sharding', action='store', type='int',
                     help='Default shard size (for fsfs)')
+  parser.add_option('--fsfs-version', type='int', action='store',
+                    help='FSFS version (fsfs)')
   parser.add_option('--config-file', action='store',
                     help="Configuration file for tests.")
   parser.add_option('--set-log-level', action='callback', type='str',
@@ -1896,6 +1929,25 @@ def _parse_options(arglist=sys.argv[1:])
     else:
       options.test_area_url = options.url
 
+  # Make sure the server-minor-version matches the fsfs-version parameter.
+  if options.fsfs_version:
+    if options.fsfs_version == 6:
+      if options.server_minor_version \
+        and options.server_minor_version != 8 \
+        and options.server_minor_version != SVN_VER_MINOR:
+        parser.error("--fsfs-version=6 requires --server-minor-version=8")
+      options.server_minor_version = 8
+    if options.fsfs_version == 4:
+      if options.server_minor_version \
+        and options.server_minor_version != 7 \
+        and options.server_minor_version != SVN_VER_MINOR:
+        parser.error("--fsfs-version=4 requires --server-minor-version=7")
+      options.server_minor_version = 7
+    pass
+    # ### Add more tweaks here if and when we support pre-cooked versions
+    # ### of FSFS repositories.
+  pass
+
   return (parser, args)
 
 

Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/switch_tests.py?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/move-tracking-2/subversion/tests/cmdline/switch_tests.py Wed Sep 
3 09:14:58 2014
@@ -1025,8 +1025,8 @@ def forced_switch_failures(sbox):
   main.file_write(A_C_H, "The file 'H'\n")
 
   # Test three cases where forced switch should cause a tree conflict
-  # 1) A forced switch that tries to add a file when an unversioned
-  #    directory of the same name already exists.  (Currently fails)
+  # 1) A forced switch that tries to add a directory when an unversioned
+  #    file of the same name already exists.  (Currently fails)
   # svn switch --force url/A/D A/C
   expected_output = svntest.wc.State(wc_dir, {
     'A/C/G'             : Item(status='A '),
@@ -1071,7 +1071,7 @@ def forced_switch_failures(sbox):
                                 '--ignore-ancestry')
 
 
-  # 2) A forced switch that tries to add a dir when a file of the same
+  # 2) A forced switch that tries to add a file when a dir of the same
   #    name already exists. (Tree conflict)
   # svn switch --force url/A/D/G A/B/F
   expected_output = svntest.wc.State(wc_dir, {
@@ -1099,7 +1099,7 @@ def forced_switch_failures(sbox):
 
   # svn info A/B/F/pi
   expected_stdout = verify.ExpectedOutput(
-    'Tree conflict: local file unversioned, incoming file add upon switch\n',
+    'Tree conflict: local dir unversioned, incoming file add upon switch\n',
     match_all=False)
 
   actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'info',

Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/tree_conflict_tests.py?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/branches/move-tracking-2/subversion/tests/cmdline/tree_conflict_tests.py Wed
Sep  3 09:14:58 2014
@@ -1258,7 +1258,7 @@ def actual_only_node_behaviour(sbox):
 
   # info
   expected_info = {
-    'Tree conflict': 'local file missing or deleted or moved away, incoming file edit upon
merge.*',
+    'Tree conflict': 'local missing or deleted or moved away, incoming file edit upon merge.*',
     'Name': 'foo',
     'Schedule': 'normal',
     'Node Kind': 'none',

Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/branches/move-tracking-2/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Wed
Sep  3 09:14:58 2014
@@ -41,6 +41,16 @@
 
 /*** Helper Functions ***/
 
+static void
+ignore_fs_warnings(void *baton, svn_error_t *err)
+{
+#ifdef SVN_DEBUG
+  SVN_DBG(("Ignoring FS warning %s\n",
+           svn_error_symbolic_name(err ? err->apr_err : 0)));
+#endif
+  return;
+}
+
 /* Write the format number and maximum number of files per directory
    to a new format file in PATH, overwriting a previously existing
    file.  Use POOL for temporary allocation.
@@ -1184,10 +1194,6 @@ revprop_caching_on_off(const svn_test_op
   if (strcmp(opts->fs_type, "fsfs") != 0)
     return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL);
 
-  /* Revision property caching requires named atomics. */
-  if (!svn_named_atomic__is_supported())
-    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL);
-
   /* Open two filesystem objects, enable revision property caching
    * in one of them. */
   SVN_ERR(svn_test__create_fs(&fs1, REPO_NAME, opts, pool));
@@ -1197,6 +1203,11 @@ revprop_caching_on_off(const svn_test_op
 
   SVN_ERR(svn_fs_open2(&fs2, svn_fs_path(fs1, pool), fs_config, pool, pool));
 
+  /* With inefficient named atomics, the filesystem will output a warning
+     and disable the revprop caching, but we still would like to test
+     these cases.  Ignore the warning(s). */
+  svn_fs_set_warning_func(fs2, ignore_fs_warnings, NULL);
+
   SVN_ERR(svn_fs_revision_prop(&value, fs2, 0, "svn:date", pool));
   another_value_for_avoiding_warnings_from_a_broken_api = value;
   SVN_ERR(svn_fs_change_rev_prop2(
@@ -1217,6 +1228,94 @@ revprop_caching_on_off(const svn_test_op
 #undef REPO_NAME
 
 /* ------------------------------------------------------------------------ */
+
+static svn_error_t *
+id_parser_test(const svn_test_opts_t *opts,
+               apr_pool_t *pool)
+{
+ #define LONG_MAX_STR #LONG_MAX
+  
+  /* Verify the revision number parser (e.g. first element of a txn ID) */
+  svn_fs_fs__id_part_t id_part;
+  SVN_ERR(svn_fs_fs__id_txn_parse(&id_part, "0-0"));
+
+#if LONG_MAX == 2147483647L
+  SVN_ERR(svn_fs_fs__id_txn_parse(&id_part, "2147483647-0"));
+
+  /* Trigger all sorts of overflow conditions. */
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "2147483648-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "21474836470-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "21474836479-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "4294967295-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "4294967296-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "4294967304-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "4294967305-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "42949672950-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "42949672959-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+
+  /* 0x120000000 = 4831838208.
+   * 483183820 < 10*483183820 mod 2^32 = 536870904 */
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "4831838208-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+#else
+  SVN_ERR(svn_fs_fs__id_txn_parse(&id_part, "9223372036854775807-0"));
+
+  /* Trigger all sorts of overflow conditions. */
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "9223372036854775808-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "92233720368547758070-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "92233720368547758079-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "18446744073709551615-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "18446744073709551616-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "18446744073709551624-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "18446744073709551625-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "184467440737095516150-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "184467440737095516159-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+
+  /* 0x12000000000000000 = 20752587082923245568.
+   * 2075258708292324556 < 10*2075258708292324556 mod 2^32 = 2305843009213693944 */
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part,
+                                                "20752587082923245568-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+#endif
+
+  /* Invalid characters */
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "2e4-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+  SVN_TEST_ASSERT_ERROR(svn_fs_fs__id_txn_parse(&id_part, "2-4-0"),
+                        SVN_ERR_FS_MALFORMED_TXN_ID);
+
+  return SVN_NO_ERROR;
+}
+
+#undef REPO_NAME
+
 
 /* The test table.  */
 
@@ -1255,8 +1354,10 @@ static struct svn_test_descriptor_t test
                        "upgrade txns started before svnadmin upgrade"),
     SVN_TEST_OPTS_PASS(metadata_checksumming,
                        "metadata checksums being checked"),
-    SVN_TEST_OPTS_XFAIL(revprop_caching_on_off,
-                        "change revprops with enabled and disabled caching"),
+    SVN_TEST_OPTS_PASS(revprop_caching_on_off,
+                       "change revprops with enabled and disabled caching"),
+    SVN_TEST_OPTS_PASS(id_parser_test,
+                       "id parser test"),
     SVN_TEST_NULL
   };
 

Propchange: subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/bit-array-test.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/translate-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/translate-test.c?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/translate-test.c (original)
+++ subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/translate-test.c Wed
Sep  3 09:14:58 2014
@@ -223,15 +223,12 @@ random_eol_marker(void)
 static svn_error_t *
 create_file(const char *fname, const char *eol_str, apr_pool_t *pool)
 {
-  apr_status_t apr_err;
   apr_file_t *f;
   apr_size_t i, j;
 
-  apr_err = apr_file_open(&f, fname,
+  SVN_ERR(svn_io_file_open(&f, fname,
                           (APR_WRITE | APR_CREATE | APR_EXCL | APR_BINARY),
-                          APR_OS_DEFAULT, pool);
-  if (apr_err)
-    return svn_error_create(apr_err, NULL, fname);
+                          APR_OS_DEFAULT, pool));
 
   for (i = 0; i < (sizeof(lines) / sizeof(*lines)); i++)
     {
@@ -243,45 +240,13 @@ create_file(const char *fname, const cha
          fprintf() doing a newline conversion? */
       for (j = 0; this_eol_str[j]; j++)
         {
-          apr_err = apr_file_putc(this_eol_str[j], f);
-          if (apr_err)
-            return svn_error_create(apr_err, NULL, fname);
+          SVN_ERR(svn_io_file_putc(this_eol_str[j], f, pool));
         }
     }
 
-  apr_err = apr_file_close(f);
-  if (apr_err)
-    return svn_error_create(apr_err, NULL, fname);
-
-  return SVN_NO_ERROR;
-}
-
-
-/* If FNAME is a regular file, remove it; if it doesn't exist at all,
-   return success.  Otherwise, return error. */
-static svn_error_t *
-remove_file(const char *fname, apr_pool_t *pool)
-{
-  apr_status_t apr_err;
-  apr_finfo_t finfo;
-
-  if (apr_stat(&finfo, fname, APR_FINFO_TYPE, pool) == APR_SUCCESS)
-    {
-      if (finfo.filetype == APR_REG)
-        {
-          apr_err = apr_file_remove(fname, pool);
-          if (apr_err)
-            return svn_error_create(apr_err, NULL, fname);
-        }
-      else
-        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
-                                 "non-file '%s' is in the way", fname);
-    }
-
-  return SVN_NO_ERROR;
+  return svn_error_trace(svn_io_file_close(f, pool));
 }
 
-
 /* Set up, run, and verify the results of a substitution.
  *
  * Create a file TEST_NAME.src using global `lines' as the initial
@@ -331,8 +296,8 @@ substitute_and_verify(const char *test_n
   apr_pool_t *subpool = svn_pool_create(pool);
 
   /** Clean up from previous tests, set up src data, and convert. **/
-  SVN_ERR(remove_file(src_fname, pool));
-  SVN_ERR(remove_file(dst_fname, pool));
+  SVN_ERR(svn_io_remove_file2(src_fname, TRUE, pool));
+  SVN_ERR(svn_io_remove_file2(dst_fname, TRUE, pool));
   SVN_ERR(create_file(src_fname, src_eol, pool));
 
   if (rev)
@@ -395,7 +360,7 @@ substitute_and_verify(const char *test_n
       else
         {
           svn_error_clear(err);
-          SVN_ERR(remove_file(src_fname, pool));
+          SVN_ERR(svn_io_remove_file2(src_fname, FALSE, pool));
           return SVN_NO_ERROR;
         }
 
@@ -769,8 +734,8 @@ substitute_and_verify(const char *test_n
     }
 
   /* Clean up this test, since successful. */
-  SVN_ERR(remove_file(src_fname, pool));
-  SVN_ERR(remove_file(dst_fname, pool));
+  SVN_ERR(svn_io_remove_file2(src_fname, FALSE, pool));
+  SVN_ERR(svn_io_remove_file2(dst_fname, FALSE, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/conflict-data-test.c Wed
Sep  3 09:14:58 2014
@@ -289,10 +289,11 @@ test_read_write_tree_conflicts(const svn
 
   SVN_ERR(svn_test__sandbox_create(&sbox, "read_write_tree_conflicts", opts, pool));
   parent_abspath = svn_dirent_join(sbox.wc_abspath, "A", pool);
-  SVN_ERR(svn_wc__db_op_add_directory(sbox.wc_ctx->db, parent_abspath,
-                                      NULL /*props*/, NULL, pool));
   child1_abspath = svn_dirent_join(parent_abspath, "foo", pool);
   child2_abspath = svn_dirent_join(parent_abspath, "bar", pool);
+  SVN_ERR(sbox_wc_mkdir(&sbox, "A"));
+  SVN_ERR(sbox_wc_mkdir(&sbox, "A/bar"));
+  sbox_file_write(&sbox, "A/foo", "");
 
   conflict1 = tree_conflict_create(child1_abspath, svn_node_file,
                                    svn_wc_operation_merge,

Propchange: subversion/branches/move-tracking-2/subversion/tests/manual/README
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/branches/move-tracking-2/subversion/tests/svn_test_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/svn_test_fs.c?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/svn_test_fs.c (original)
+++ subversion/branches/move-tracking-2/subversion/tests/svn_test_fs.c Wed Sep  3 09:14:58
2014
@@ -106,7 +106,6 @@ create_fs(svn_fs_t **fs_p,
           int server_minor_version,
           apr_pool_t *pool)
 {
-  apr_finfo_t finfo;
   apr_hash_t *fs_config = make_fs_config(fs_type, server_minor_version, pool);
 
   /* If there's already a repository named NAME, delete it.  Doing
@@ -114,18 +113,7 @@ create_fs(svn_fs_t **fs_p,
      failure for postmortem analysis, but also that tests can be
      re-run without cleaning out the repositories created by prior
      runs.  */
-  if (apr_stat(&finfo, name, APR_FINFO_TYPE, pool) == APR_SUCCESS)
-    {
-      if (finfo.filetype == APR_DIR)
-        SVN_ERR_W(svn_io_remove_dir2(name, TRUE, NULL, NULL, pool),
-                  apr_psprintf(pool,
-                               "cannot create fs '%s' there is already "
-                               "a directory of that name", name));
-      else
-        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
-                                 "cannot create fs '%s' there is already "
-                                 "a file of that name", name);
-    }
+  SVN_ERR(svn_io_remove_dir2(name, TRUE, NULL, NULL, pool));
 
   SVN_ERR(svn_fs_create(fs_p, name, fs_config, pool));
   if (! *fs_p)
@@ -216,7 +204,6 @@ svn_test__create_repos(svn_repos_t **rep
                        const svn_test_opts_t *opts,
                        apr_pool_t *pool)
 {
-  apr_finfo_t finfo;
   svn_repos_t *repos;
   svn_boolean_t must_reopen;
   apr_hash_t *fs_config = make_fs_config(opts->fs_type,
@@ -227,17 +214,7 @@ svn_test__create_repos(svn_repos_t **rep
      failure for postmortem analysis, but also that tests can be
      re-run without cleaning out the repositories created by prior
      runs.  */
-  if (apr_stat(&finfo, name, APR_FINFO_TYPE, pool) == APR_SUCCESS)
-    {
-      if (finfo.filetype == APR_DIR)
-        SVN_ERR_W(svn_io_remove_dir2(name, TRUE, NULL, NULL, pool),
-                  apr_psprintf(pool,
-                               "cannot create repos '%s' there is already "
-                               "a directory of that name", name));
-      else
-        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
-                                 "there is already a file named '%s'", name);
-    }
+  SVN_ERR(svn_io_remove_dir2(name, TRUE, NULL, NULL, pool));
 
   SVN_ERR(svn_repos_create(&repos, name, NULL, NULL, NULL,
                            fs_config, pool));

Modified: subversion/branches/move-tracking-2/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/svn_test_main.c?rev=1622195&r1=1622194&r2=1622195&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/svn_test_main.c (original)
+++ subversion/branches/move-tracking-2/subversion/tests/svn_test_main.c Wed Sep  3 09:14:58
2014
@@ -103,7 +103,8 @@ enum test_options_e {
   srcdir_opt,
   mode_filter_opt,
   sqlite_log_opt,
-  parallel_opt
+  parallel_opt,
+  fsfs_version_opt
 };
 
 static const apr_getopt_option_t cl_options[] =
@@ -116,6 +117,8 @@ static const apr_getopt_option_t cl_opti
                     N_("specify test config file ARG")},
   {"fs-type",       fstype_opt, 1,
                     N_("specify a filesystem backend type ARG")},
+  {"fsfs-version",  fsfs_version_opt, 1,
+                    N_("specify the FSFS version ARG")},
   {"list",          list_opt, 0,
                     N_("lists all the tests with their short description")},
   {"mode-filter",   mode_filter_opt, 1,
@@ -301,6 +304,7 @@ log_results(const char *progname,
       svn_error_clear(err);
       err = SVN_NO_ERROR;
       skip = TRUE;
+      xfail = FALSE; /* Or all XFail tests reporting SKIP would be failing */
     }
 
   /* Failure means unexpected results -- FAIL or XPASS. */
@@ -422,13 +426,6 @@ do_test_num(const char *progname,
         err = (*desc->func2)(pool);
       else
         err = (*desc->func_opts)(opts, pool);
-
-      if (err && err->apr_err == SVN_ERR_TEST_SKIPPED)
-        {
-          svn_error_clear(err);
-          err = SVN_NO_ERROR;
-          skip = TRUE;
-        }
     }
   else
     err = svn_error_create(SVN_ERR_TEST_FAILED, NULL,
@@ -479,7 +476,7 @@ static void * APR_THREAD_FUNC
 test_thread(apr_thread_t *thread, void *data)
 {
   svn_boolean_t skip, xfail, wimp;
-  svn_error_t *err = NULL;
+  svn_error_t *err;
   const struct svn_test_descriptor_t *desc;
   svn_boolean_t run_this_test; /* This test's mode matches DESC->MODE. */
   test_params_t *params = data;
@@ -512,7 +509,7 @@ test_thread(apr_thread_t *thread, void *
 
       /* Do test */
       if (skip || !run_this_test)
-        ; /* pass */
+        err = NULL; /* pass */
       else if (desc->func2)
         err = (*desc->func2)(pool);
       else



Mime
View raw message