subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1619764 - in /subversion/trunk/subversion/tests: cmdline/svntest/actions.py cmdline/svntest/main.py templates/greek-fsfs-v4.zip templates/greek-fsfs-v6.zip templates/greek.dump
Date Fri, 22 Aug 2014 11:57:43 GMT
Author: brane
Date: Fri Aug 22 11:57:42 2014
New Revision: 1619764

URL: http://svn.apache.org/r1619764
Log:
Teach the cmdline tests to use pre-cooked greek repositories.
One or two tests currently fail in this mode due to making
too many assumptions about the behaviour of the test harness.

* subversion/tests/cmdline/svntest/main.py
  (_unpack_precooked_repos): Helper function for unzipping
   the pre-cooked repository packages.
  (unpack_greek_repos): New; unpacks a pre-cooked greek repos.
  (create_repos): Use _unpack_precooked_repos.

* subversion/tests/cmdline/svntest/actions.py
  (setup_pristine_greek_repository,
   guarantee_greek_repository): Use the new main.unpack_greek_repos
   when in pre-cooked mode.

* subversion/tests/templates/greek-fsfs-v4.zip,
  subversion/tests/templates/greek-fsfs-v6.zip: New;
   pre-cooked repositories with the greek tree included.
* subversion/tests/templates/greek.dump: New;
   greek tree dump file for creating new pre-cooked repositories.

Added:
    subversion/trunk/subversion/tests/templates/greek-fsfs-v4.zip   (with props)
    subversion/trunk/subversion/tests/templates/greek-fsfs-v6.zip   (with props)
    subversion/trunk/subversion/tests/templates/greek.dump
Modified:
    subversion/trunk/subversion/tests/cmdline/svntest/actions.py
    subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=1619764&r1=1619763&r2=1619764&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Fri Aug 22 11:57:42 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/trunk/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1619764&r1=1619763&r2=1619764&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Fri Aug 22 11:57:42 2014
@@ -908,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
@@ -931,12 +941,8 @@ def create_repos(path, minor_version = N
   else:
     # Copy a pre-cooked FSFS repository
     assert options.fs_type == "fsfs"
-    testdir = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
-    template = os.path.join(os.path.dirname(testdir),
-                            "templates",
-                            "empty-fsfs-v%d.zip" % options.fsfs_version)
-    repozip = zipfile.ZipFile(template, 'r')
-    repozip.extractall(path)
+    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)
 

Added: subversion/trunk/subversion/tests/templates/greek-fsfs-v4.zip
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/templates/greek-fsfs-v4.zip?rev=1619764&view=auto
==============================================================================
Binary file - no diff available.

Propchange: subversion/trunk/subversion/tests/templates/greek-fsfs-v4.zip
------------------------------------------------------------------------------
    svn:mime-type = application/zip

Added: subversion/trunk/subversion/tests/templates/greek-fsfs-v6.zip
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/templates/greek-fsfs-v6.zip?rev=1619764&view=auto
==============================================================================
Binary file - no diff available.

Propchange: subversion/trunk/subversion/tests/templates/greek-fsfs-v6.zip
------------------------------------------------------------------------------
    svn:mime-type = application/zip

Added: subversion/trunk/subversion/tests/templates/greek.dump
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/templates/greek.dump?rev=1619764&view=auto
==============================================================================
--- subversion/trunk/subversion/tests/templates/greek.dump (added)
+++ subversion/trunk/subversion/tests/templates/greek.dump Fri Aug 22 11:57:42 2014
@@ -0,0 +1,260 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 77e48e13-c942-4450-8676-1d60a12bd220
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2014-08-22T10:58:13.847732Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 129
+Content-length: 129
+
+K 10
+svn:author
+V 7
+jrandom
+K 8
+svn:date
+V 27
+2014-08-22T11:16:26.921067Z
+K 7
+svn:log
+V 27
+Log message for revision 1.
+PROPS-END
+
+Node-path: A
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: A/B
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: A/B/E
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: A/B/E/alpha
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 26
+Text-content-md5: d1fa4a3ced98961674a441930a51f2d3
+Text-content-sha1: b347d1da69df9a6a70433ceeaa0d46c8483e8c03
+Content-length: 36
+
+PROPS-END
+This is the file 'alpha'.
+
+
+Node-path: A/B/E/beta
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 25
+Text-content-md5: 67c756078f24f946f6ec2d00d02f50e1
+Text-content-sha1: d001710ac8e622c6d1fe59b1e265a3908acdd2a3
+Content-length: 35
+
+PROPS-END
+This is the file 'beta'.
+
+
+Node-path: A/B/F
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: A/B/lambda
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 27
+Text-content-md5: 911c7a8d869b8c1e566f57da54d889c6
+Text-content-sha1: 784a9298366863da2b65ebf82b4e1123755a2421
+Content-length: 37
+
+PROPS-END
+This is the file 'lambda'.
+
+
+Node-path: A/C
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: A/D
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: A/D/G
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: A/D/G/pi
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 23
+Text-content-md5: adddfc3e6b605b5f90ceeab11b4e8ab6
+Text-content-sha1: 411e258dc14b42701fdc29b75f653e93f8686415
+Content-length: 33
+
+PROPS-END
+This is the file 'pi'.
+
+
+Node-path: A/D/G/rho
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 24
+Text-content-md5: 82f2211cf4ab22e3555fc7b835fbc604
+Text-content-sha1: 56388a031dffbf9df7c32e1f299b1d5d7ef60881
+Content-length: 34
+
+PROPS-END
+This is the file 'rho'.
+
+
+Node-path: A/D/G/tau
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 24
+Text-content-md5: 9936e2716e469bb686deb98c280ead58
+Text-content-sha1: 62e8c07d56bee94ea4577e80414fa8805aaf0175
+Content-length: 34
+
+PROPS-END
+This is the file 'tau'.
+
+
+Node-path: A/D/H
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: A/D/H/chi
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 24
+Text-content-md5: 8f5ebad6d1f7775c2682e54417cbe4d3
+Text-content-sha1: abeac1bf62099ab66b44779198dc19f40e3244f4
+Content-length: 34
+
+PROPS-END
+This is the file 'chi'.
+
+
+Node-path: A/D/H/omega
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 26
+Text-content-md5: fe4ec8bdd3d2056db4f55b474a10fadc
+Text-content-sha1: c06e671bf15a6af55086176a0931d3b5034c82e6
+Content-length: 36
+
+PROPS-END
+This is the file 'omega'.
+
+
+Node-path: A/D/H/psi
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 24
+Text-content-md5: e81f8f68ba50e749c200cb3c9ce5d2b1
+Text-content-sha1: 9c438bde39e8ccbbd366df2638e3cb6700950204
+Content-length: 34
+
+PROPS-END
+This is the file 'psi'.
+
+
+Node-path: A/D/gamma
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 26
+Text-content-md5: 412138bd677d64cd1c32fafbffe6245d
+Text-content-sha1: 74b75d7f2e1a0292f17d5a57c570bd89783f5d1c
+Content-length: 36
+
+PROPS-END
+This is the file 'gamma'.
+
+
+Node-path: A/mu
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 23
+Text-content-md5: baf78ae06a2d5b7d9554c5f1280d3fa8
+Text-content-sha1: b4d00c56351d1a752e24d839d41a362d8da4a4c7
+Content-length: 33
+
+PROPS-END
+This is the file 'mu'.
+
+
+Node-path: iota
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 25
+Text-content-md5: 2d18c5e57e84c5b8a5e9a6e13fa394dc
+Text-content-sha1: 2c0aa9014a0cd07f01795a333d82485ef6d083e2
+Content-length: 35
+
+PROPS-END
+This is the file 'iota'.
+
+



Mime
View raw message