You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/12/22 14:56:20 UTC

svn commit: r1222232 - /subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py

Author: stsp
Date: Thu Dec 22 13:56:19 2011
New Revision: 1222232

URL: http://svn.apache.org/viewvc?rev=1222232&view=rev
Log:
Follow-up to r1222226: Fix hotcopy tests for BDB.

A file-per-file comparison doesn't work for BDB repositories.
So fall back to comparing output of 'svnadmin dump' for BDB.

* subversion/tests/cmdline/svnadmin_tests.py
  (check_hotcopy): Rename to ...
  (check_hotcopy_fsfs): ... this.
  (check_hotcopy_bdb): New.
  (hotcopy_dot): Call the right hotcopy checker depending on fs-type.

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

Modified: subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py?rev=1222232&r1=1222231&r2=1222232&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Thu Dec 22 13:56:19 2011
@@ -47,8 +47,17 @@ Issue = svntest.testcase.Issue_deco
 Wimp = svntest.testcase.Wimp_deco
 Item = svntest.wc.StateItem
 
-def check_hotcopy(src, dst):
-    "Verify that the SRC repository has been correcly copied to DST."
+def check_hotcopy_bdb(src, dst):
+  "Verify that the SRC BDB repository has been correcly copied to DST."
+  exit_code, origout, origerr = svntest.main.run_svnadmin("dump", src,
+                                                          '--quiet')
+  exit_code, backout, backerr = svntest.main.run_svnadmin("dump", dst,
+                                                          '--quiet')
+  if origerr or backerr or origout != backout:
+    raise svntest.Failure
+
+def check_hotcopy_fsfs(src, dst):
+    "Verify that the SRC FSFS repository has been correcly copied to DST."
     # Walk the source and compare all files to the destination
     for src_dirpath, src_dirs, src_files in os.walk(src):
       # Verify that the current directory exists in the destination
@@ -428,7 +437,10 @@ def hotcopy_dot(sbox):
 
   os.chdir(cwd)
 
-  check_hotcopy(sbox.repo_dir, backup_dir)
+  if svntest.main.is_fs_type_fsfs():
+    check_hotcopy_fsfs(sbox.repo_dir, backup_dir)
+  else:
+    check_hotcopy_bdb(sbox.repo_dir, backup_dir)
 
 #----------------------------------------------------------------------