Index: build/run_tests.py =================================================================== --- build/run_tests.py (revision 21625) +++ build/run_tests.py (working copy) @@ -4,7 +4,7 @@ # '''usage: python run_tests.py [--url=] [--fs-type=] - [--verbose] [--cleanup] + [--verbose] [--cleanup] [--enable-sasl] @@ -26,7 +26,8 @@ ''' def __init__(self, abs_srcdir, abs_builddir, logfile, - base_url=None, fs_type=None, verbose=None, cleanup=None): + base_url=None, fs_type=None, verbose=None, cleanup=None, + enable_sasl=None): '''Construct a TestHarness instance. ABS_SRCDIR and ABS_BUILDDIR are the source and build directories. @@ -41,6 +42,7 @@ self.fs_type = fs_type self.verbose = verbose self.cleanup = cleanup + self.enable_sasl = enable_sasl self.log = None def run(self, list): @@ -96,6 +98,8 @@ quote(os.path.join(self.srcdir, prog))] if self.base_url is not None: cmdline.append(quote('--url=' + self.base_url)) + if self.enable_sasl is not None: + cmdline.append('--enable-sasl') elif os.access(prog, os.X_OK): progname = './' + progbase cmdline = [quote(progname), @@ -162,7 +166,8 @@ def main(): try: opts, args = my_getopt(sys.argv[1:], 'u:f:vc', - ['url=', 'fs-type=', 'verbose', 'cleanup']) + ['url=', 'fs-type=', 'verbose', 'cleanup', + 'enable-sasl']) except getopt.GetoptError: args = [] @@ -170,7 +175,7 @@ print __doc__ sys.exit(2) - base_url, fs_type, verbose, cleanup = None, None, None, None + base_url, fs_type, verbose, cleanup, enable_sasl = None, None, None, None, None for opt, val in opts: if opt in ('-u', '--url'): base_url = val @@ -180,12 +185,14 @@ verbose = 1 elif opt in ('-c', '--cleanup'): cleanup = 1 + elif opt in ('--enable-sasl'): + enable_sasl = 1 else: raise getopt.GetoptError th = TestHarness(args[0], args[1], os.path.abspath('tests.log'), - base_url, fs_type, verbose, cleanup) + base_url, fs_type, verbose, cleanup, enable_sasl) failed = th.run(args[2:]) if failed: Index: Makefile.in =================================================================== --- Makefile.in (revision 21625) +++ Makefile.in (working copy) @@ -361,8 +361,11 @@ if test "$(FS_TYPE)" != ""; then \ flags="--fs-type $(FS_TYPE) $$flags"; \ fi; \ + if test "$(ENABLE_SASL)" != ""; then \ + flags="--enable-sasl $$flags"; \ + fi; \ $(PYTHON) $(top_srcdir)/build/run_tests.py $$flags \ - '$(abs_srcdir)' '$(abs_builddir)' $(TESTS); \ + '$(abs_srcdir)' '$(abs_builddir)' $(TESTS); \ else \ echo "make check: Python 2.0 or greater is required,"; \ echo " but was not detected during configure"; \ @@ -381,6 +384,12 @@ # First, run: # subversion/svnserve/svnserve -d -r `pwd`/subversion/tests/cmdline +# You can run 'make svncheck ENABLE_SASL=true' to use Cyrus SASL for +# authentication. Before you do that, make sure the jrandom and jconstant +# users can authenticate in the svntest realm, e.g. by running (as root): +# saslpasswd2 -c -u svntest jrandom +# saslpasswd2 -c -u svntest jconstant +# The password is 'rayjandom' for both users. svncheck: @$(MAKE) check BASE_URL=svn://localhost Index: subversion/tests/cmdline/authz_tests.py =================================================================== --- subversion/tests/cmdline/authz_tests.py (revision 21625) +++ subversion/tests/cmdline/authz_tests.py (working copy) @@ -36,7 +36,11 @@ fp = open(svntest.main.get_svnserve_conf_file_path(repo_dir), 'w') fp.write("[general]\nanon-access = none\nauth-access = write\n" - "password-db = passwd\nauthz-db = authz\n") + "authz-db = authz\n") + if svntest.main.enable_sasl == 1: + fp.write("realm = svntest\n[sasl]\nuse-sasl = true\n"); + else: + fp.write("password-db = passwd\n") fp.close() def write_authz_file(sbox, rules): Index: subversion/tests/cmdline/svntest/main.py =================================================================== --- subversion/tests/cmdline/svntest/main.py (revision 21625) +++ subversion/tests/cmdline/svntest/main.py (working copy) @@ -128,6 +128,9 @@ # Global variable indicating if we want test data cleaned up after success cleanup_mode = 0 +# Global variable indicating if svnserve should use Cyrus SASL +enable_sasl = 0 + # Global URL to testing area. Default to ra_local, current working dir. test_area_url = file_scheme_prefix + os.path.abspath(os.getcwd()) if windows == 1: @@ -448,10 +451,15 @@ raise SVNRepositoryCreateFailure("".join(stderr).rstrip()) # Allow unauthenticated users to write to the repos, for ra_svn testing. - file_append(os.path.join(path, "conf", "svnserve.conf"), - "[general]\nauth-access = write\npassword-db = passwd\n"); - file_append(os.path.join(path, "conf", "passwd"), - "[users]\njrandom = rayjandom\njconstant = rayjandom\n"); + file_write(get_svnserve_conf_file_path(path), + "[general]\nauth-access = write\n"); + if enable_sasl == 1: + file_append(get_svnserve_conf_file_path(path), + "realm = svntest\n[sasl]\nuse-sasl = true\n") + else: + file_append(get_svnserve_conf_file_path(path), "password-db = passwd\n") + file_append(os.path.join(path, "conf", "passwd"), + "[users]\njrandom = rayjandom\njconstant = rayjandom\n"); # make the repos world-writeable, for mod_dav_svn's sake. chmod_tree(path, 0666, 0666) @@ -824,6 +832,7 @@ global fs_type global verbose_mode global cleanup_mode + global enable_sasl testnums = [] # Should the tests be listed (as opposed to executed)? list_tests = 0 @@ -833,7 +842,8 @@ os.environ['SVN_EDITOR'] = '' opts, args = my_getopt(sys.argv[1:], 'v', - ['url=', 'fs-type=', 'verbose', 'cleanup', 'list']) + ['url=', 'fs-type=', 'verbose', 'cleanup', 'list', + 'enable-sasl']) for arg in args: if arg == "list": @@ -860,6 +870,9 @@ elif opt == "--list": list_tests = 1 + elif opt == "--enable-sasl": + enable_sasl = 1 + if test_area_url[-1:] == '/': # Normalize url to have no trailing slash test_area_url = test_area_url[:-1]