[Bps-public-commit] r14897 - Pushmi/trunk/t

clkao at bestpractical.com clkao at bestpractical.com
Thu Aug 7 14:55:35 EDT 2008


Author: clkao
Date: Thu Aug  7 14:55:34 2008
New Revision: 14897

Modified:
   Pushmi/trunk/t/auth.t

Log:
make auth.t pass for 1.6.


Modified: Pushmi/trunk/t/auth.t
==============================================================================
--- Pushmi/trunk/t/auth.t	(original)
+++ Pushmi/trunk/t/auth.t	Thu Aug  7 14:55:34 2008
@@ -6,7 +6,7 @@
 use Pushmi::Test;
 BEGIN { check_apache() }
 
-use Test::More tests => 11;
+use Test::More tests => 12;
 
 use File::Spec::Functions qw(rel2abs catdir catfile);
 
@@ -66,14 +66,14 @@
 diag $perlbal_url;
 
 run_pushmi('mirror', $slavedepot->repospath, $master_url);
-system('svn', 'mkdir', '--non-interactive', '--no-auth-cache', '--username' => 'mirror', '--password' => 'secret', -m => 'mkdir', "$master_url/X");
+is_svn_output(['mkdir', '--non-interactive', '--no-auth-cache', '--username' => 'mirror', '--password' => 'secret', -m => 'mkdir', "$master_url/X"],
+              ['','Committed revision 3.'], []);
 
 run_pushmi('sync', $slavedepot->repospath);
 is_svn_output(['mkdir', '--non-interactive', '--no-auth-cache', '--username' => 'test', '--password' => 'test', -m => 'mkdir', "$perlbal_url/orzzzz"],
               [],
               [qr{svn: .*403 Forbidden}]);
 
-#sleep 1 while 1;
 is_svn_output(['mkdir', '--non-interactive', '--no-auth-cache', '--username' => 'test', '--password' => 'test', -m => 'mkdir', "$perlbal_url/X/mmmm"],
               ['','Committed revision 4.']);
 diag $slave_url;
@@ -94,19 +94,27 @@
               ['A         t/checkout/auth-svn/fileA.txt']);
 
 sub svn_error_authz_failure {
-    my ($url, $path) = @_;
+    my ($url, $path, $reason) = @_;
 
     # XXX: older svn error message:
 #              "svn: OPTIONS request failed on '/svn/X'",
 #              "svn: OPTIONS of '/svn/X': authorization failed (http://localhost:$perlbal_port)"]);
 
-    return "svn: OPTIONS of '$url$path': authorization failed ($url)";
+    return "svn: OPTIONS of '$url$path': authorization failed ($url)"
+        if $SVN::Core::VERSION lt '1.6.0';
+
+    return "svn: OPTIONS of '$url$path': authorization failed: $reason ($url)"
+}
+
+sub svn_error_authen_failure {
+    my ($url, $path) = @_;
+    
 }
 
 is_svn_output(['ci', '--non-interactive', '--no-auth-cache', '--username' => 'test', '--password' => '', -m => 'commit a single file', $copath],
               [],
               ["svn: Commit failed (details follow):",
-               svn_error_authz_failure("http://localhost:$perlbal_port", '/svn/X')
+               svn_error_authz_failure("http://localhost:$perlbal_port", '/svn/X', 'Could not authenticate to server: rejected Basic challenge')
                ]);
 
 is_svn_output(['ci', '--non-interactive', '--no-auth-cache', '--username' => 'test', '--password' => 'test', -m => 'commit a single file', $copath],



More information about the Bps-public-commit mailing list