subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1185763 - /subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
Date Tue, 18 Oct 2011 17:23:22 GMT
Author: rhuijben
Date: Tue Oct 18 17:23:21 2011
New Revision: 1185763

URL: http://svn.apache.org/viewvc?rev=1185763&view=rev
Log:
Add new XFail test to show failing upgrade on absent nodes.
(Tested on ra_svn but should also work on ra_dav, but I can't run dav tests
 right now)
* subversion/tests/cmdline/upgrade_tests.py
  (replace_sbox_repo_with_tarfile): New function.
  (upgrade_absent): New function.
  (test_list): Add upgrade_absent.

Modified:
    subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=1185763&r1=1185762&r2=1185763&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Tue Oct 18 17:23:21 2011
@@ -75,6 +75,23 @@ def replace_sbox_with_tarfile(sbox, tar_
 
   shutil.move(os.path.join(extract_dir, dir), sbox.wc_dir)
 
+def replace_sbox_repo_with_tarfile(sbox, tar_filename, dir=None):
+  try:
+    svntest.main.safe_rmtree(sbox.repo_dir)
+  except OSError, e:
+    pass
+
+  if not dir:
+    dir = tar_filename.split('.')[0]
+    
+  tarpath = os.path.join(os.path.dirname(sys.argv[0]), 'upgrade_tests_data',
+                         tar_filename)
+  t = tarfile.open(tarpath, 'r:bz2')
+  extract_dir = tempfile.mkdtemp(dir=svntest.main.temp_dir)
+  for member in t.getmembers():
+    t.extract(member, extract_dir)
+
+  shutil.move(os.path.join(extract_dir, dir), sbox.repo_dir)
 
 def check_format(sbox, expected_format):
   dot_svn = svntest.main.get_admin_name()
@@ -1181,6 +1198,35 @@ def upgrade_file_externals(sbox):
       'alpha' : {'pname3' : 'pvalue3' },
       })
 
+@Skip(svntest.main.is_ra_type_file)
+@XFail()
+def upgrade_absent(sbox):
+  "upgrade absent nodes"
+  
+  # Install wc and repos
+  replace_sbox_with_tarfile(sbox, 'upgrade_absent.tar.bz2')
+  replace_sbox_repo_with_tarfile(sbox, 'upgrade_absent_repos.tar.bz2')
+  
+  # Update config for authz
+  write_restrictive_svnserve_conf(sbox.repo_dir)
+  write_authz_file(sbox, {"/": "*=rw", "/A/B": "*=", "/A/B/E": "jrandom = rw"})
+  
+  # Attempt to use the working copy, this should give an error
+  expected_stderr = wc_is_too_old_regex
+  svntest.actions.run_and_verify_svn(None, None, expected_stderr,
+                                     'info', sbox.wc_dir)
+  # Now upgrade the working copy
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'upgrade', sbox.wc_dir)
+
+  # 
+  svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
+                                     'svn://127.0.0.1/authz_tests-2',
+                                     sbox.repo_url, sbox.wc_dir)  
+
+  # This currently fails because the absent node is incorrectly upgraded
+  sbox.simple_update()
+  
 ########################################################################
 # Run the tests
 
@@ -1230,6 +1276,7 @@ test_list = [ None,
               upgrade_with_missing_subdir,
               upgrade_locked,
               upgrade_file_externals,
+              upgrade_absent,
              ]
 
 



Mime
View raw message