subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1144381 - in /subversion/trunk: Makefile.in subversion/tests/cmdline/svnmucc_tests.py subversion/tests/cmdline/svntest/actions.py subversion/tests/cmdline/svntest/main.py
Date Fri, 08 Jul 2011 16:50:39 GMT
Author: philip
Date: Fri Jul  8 16:50:39 2011
New Revision: 1144381

URL: http://svn.apache.org/viewvc?rev=1144381&view=rev
Log:
Add testsuite support for running svnmucc, use it to add a test
for issue 3953: mod_dav_svn not rejecting bogus mergeinfo.

* subversion/tests/cmdline/svnmucc_tests.py: New.

* subversion/tests/cmdline/svntest/main.py
  (svnmucc_binary, run_svnmucc): New.
  (execute_tests): Set svnmucc_binary.

* subversion/tests/cmdline/svntest/actions.py
  (run_and_verify_svnmucc, run_and_verify_svnmucc2): New.

* Makefile.in
  (check, davcheck, svncheck, svnserveautocheck, svncheck6,
   svnsshcheck, bdbcheck): Add svnmucc as a dependency.

Added:
    subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py   (with props)
Modified:
    subversion/trunk/Makefile.in
    subversion/trunk/subversion/tests/cmdline/svntest/actions.py
    subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/trunk/Makefile.in?rev=1144381&r1=1144380&r2=1144381&view=diff
==============================================================================
--- subversion/trunk/Makefile.in (original)
+++ subversion/trunk/Makefile.in Fri Jul  8 16:50:39 2011
@@ -446,7 +446,7 @@ check-javahl: javahl javahl-compat
 # "make check CLEANUP=true" will clean up directories for successful tests.
 # "make check TESTS=subversion/tests/cmdline/basic_tests.py"
 #  will perform only basic tests (likewise for other tests).
-check: bin @TRANSFORM_LIBTOOL_SCRIPTS@ $(TEST_DEPS) @BDB_TEST_DEPS@
+check: bin @TRANSFORM_LIBTOOL_SCRIPTS@ $(TEST_DEPS) @BDB_TEST_DEPS@ svnmucc
 	@if test "$(PYTHON)" != "none"; then                                 \
 	  flags="--verbose";                                                 \
 	  if test "$(CLEANUP)" != ""; then                                   \
@@ -495,38 +495,38 @@ check: bin @TRANSFORM_LIBTOOL_SCRIPTS@ $
 
 # First, set up Apache as documented in
 # subversion/tests/cmdline/README.
-davcheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@ apache-mod
+davcheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@ apache-mod svnmucc
 	@$(MAKE) check BASE_URL=http://localhost
 
 # Automatically configure and run Apache httpd on a random port, and then
 # run make check.
-davautocheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@ apache-mod
+davautocheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@ apache-mod svnmucc
 	@# Takes MODULE_PATH, USE_HTTPV1 and SVN_PATH_AUTHZ in the environment.
 	@APXS=$(APXS) bash $(top_srcdir)/subversion/tests/cmdline/davautocheck.sh
 
 # First, run:
 #   subversion/svnserve/svnserve -d -r `pwd`/subversion/tests/cmdline
-svncheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@
+svncheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@ svnmucc
 	@$(MAKE) check BASE_URL=svn://127.0.0.1
 
 # 'make svnserveautocheck' runs svnserve for you and kills it.
-svnserveautocheck: svnserve bin $(TEST_DEPS) @BDB_TEST_DEPS@
+svnserveautocheck: svnserve bin $(TEST_DEPS) @BDB_TEST_DEPS@ svnmucc
 	@env PYTHON=$(PYTHON) THREADED=$(THREADED) \
 	  $(top_srcdir)/subversion/tests/cmdline/svnserveautocheck.sh
 
 # First, run:
 #   subversion/svnserve/svnserve --listen-host "::1" -d -r `pwd`/subversion/tests/cmdline
 
-svncheck6: bin $(TEST_DEPS) @BDB_TEST_DEPS@
+svncheck6: bin $(TEST_DEPS) @BDB_TEST_DEPS@ svnmucc
 	@$(MAKE) check BASE_URL=svn://\[::1\]
 
 # First make sure you can ssh to localhost and that "svnserve" is in
 # the path of the resulting shell.
-svnsshcheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@
+svnsshcheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@ svnmucc
 	@$(MAKE) check \
 	  BASE_URL=svn+ssh://localhost`pwd`/subversion/tests/cmdline
 
-bdbcheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@
+bdbcheck: bin $(TEST_DEPS) @BDB_TEST_DEPS@ svnmucc
 	@$(MAKE) check FS_TYPE=bdb
 
 check-clean:

Added: subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py?rev=1144381&view=auto
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py (added)
+++ subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py Fri Jul  8 16:50:39 2011
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+#
+#  svnmucc_tests.py: tests of svnmucc
+#
+#  Subversion is a tool for revision control.
+#  See http://subversion.apache.org for more information.
+#
+# ====================================================================
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements.  See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership.  The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied.  See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+######################################################################
+
+import svntest
+
+XFail = svntest.testcase.XFail_deco
+Issues = svntest.testcase.Issues_deco
+Issue = svntest.testcase.Issue_deco
+
+######################################################################
+
+@Issues(3895,3953)
+def reject_bogus_mergeinfo(sbox):
+  "reject bogus mergeinfo"
+
+  sbox.build(create_wc=False)
+
+  expected_error = ".*(E200020.*Invalid revision|E175008.*property change)"
+
+  # At present this tests the server, but if we ever make svnmucc
+  # validate the mergeinfo up front then it will only test the client
+  svntest.actions.run_and_verify_svnmucc(None, [], expected_error,
+                                         'propset', 'svn:mergeinfo', '/B:0',
+                                         sbox.repo_url + '/A')
+
+######################################################################
+
+test_list = [ None,
+              reject_bogus_mergeinfo,
+            ]
+
+if __name__ == '__main__':
+  svntest.main.run_tests(test_list)

Propchange: subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=1144381&r1=1144380&r2=1144381&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Fri Jul  8 16:50:39 2011
@@ -359,6 +359,28 @@ def run_and_verify_svnrdump(dumpfile_con
   verify.verify_exit_code("Unexpected return code", exit_code, expected_exit)
   return output
 
+
+def run_and_verify_svnmucc(message, expected_stdout, expected_stderr,
+                           *varargs):
+  """Run svnmucc command and check its output"""
+
+  expected_exit = 0
+  if expected_stderr is not None and expected_stderr != []:
+    expected_exit = 1
+  return run_and_verify_svnmucc2(message, expected_stdout, expected_stderr,
+                                 expected_exit, *varargs)
+
+def run_and_verify_svnmucc2(message, expected_stdout, expected_stderr,
+                            expected_exit, *varargs):
+  """Run svnmucc command and check its output and exit code."""
+
+  exit_code, out, err = main.run_svnmucc(*varargs)
+  verify.verify_outputs("Unexpected output", out, err,
+                        expected_stdout, expected_stderr)
+  verify.verify_exit_code(message, exit_code, expected_exit)
+  return exit_code, out, err
+
+
 def load_repo(sbox, dumpfile_path = None, dump_str = None,
               bypass_prop_validation = False):
   "Loads the dumpfile into sbox"

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1144381&r1=1144380&r2=1144381&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Fri Jul  8 16:50:39 2011
@@ -164,6 +164,8 @@ entriesdump_binary = os.path.abspath('en
 atomic_ra_revprop_change_binary = os.path.abspath('atomic-ra-revprop-change' + \
                                                   _exe)
 wc_lock_tester_binary = os.path.abspath('../libsvn_wc/wc-lock-tester' + _exe)
+svnmucc_binary=os.path.abspath('../../../tools/client-side/svnmucc/svnmucc' + \
+                               _exe)
 
 # Location to the pristine repository, will be calculated from test_area_url
 # when we know what the user specified for --url.
@@ -579,6 +581,13 @@ def _with_auth(args):
   else:
     return args + ('--username', wc_author )
 
+def _with_log_message(args):
+
+  if '-m' in args or '--message' in args or '-F' in args:
+    return args
+  else:
+    return args + ('--message', 'default log message')
+
 # For running subversion and returning the output
 def run_svn(error_expected, *varargs):
   """Run svn with VARARGS; return exit code as int; stdout, stderr as
@@ -622,6 +631,12 @@ def run_svnversion(*varargs):
   as list of lines (including line terminators)."""
   return run_command(svnversion_binary, 1, 0, *varargs)
 
+def run_svnmucc(*varargs):
+  """Run svnmucc with VARARGS, returns exit code as int; stdout, stderr as
+  list of lines (including line terminators).  Use binary mode for output."""
+  return run_command(svnmucc_binary, 1, 1,
+                     *(_with_auth(_with_config_dir(_with_log_message(varargs)))))
+
 def run_entriesdump(path):
   """Run the entries-dump helper, returning a dict of Entry objects."""
   # use spawn_process rather than run_command to avoid copying all the data
@@ -1606,6 +1621,7 @@ def execute_tests(test_list, serial_only
   global svnsync_binary
   global svndumpfilter_binary
   global svnversion_binary
+  global svnmucc_binary
   global options
 
   if test_name:
@@ -1681,6 +1697,7 @@ def execute_tests(test_list, serial_only
                                         'jsvndumpfilter' + _bat)
     svnversion_binary = os.path.join(options.svn_bin,
                                      'jsvnversion' + _bat)
+    svnversion_binary = os.path.join(options.svn_bin, 'jsvnmucc' + _bat)
   else:
     if options.svn_bin:
       svn_binary = os.path.join(options.svn_bin, 'svn' + _exe)
@@ -1690,6 +1707,7 @@ def execute_tests(test_list, serial_only
       svndumpfilter_binary = os.path.join(options.svn_bin,
                                           'svndumpfilter' + _exe)
       svnversion_binary = os.path.join(options.svn_bin, 'svnversion' + _exe)
+      svnmucc_binary = os.path.join(options.svn_bin, 'svnmucc' + _exe)
 
   ######################################################################
 



Mime
View raw message