You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Steve Hay <st...@uk.radan.com> on 2004/07/05 11:46:08 UTC

t\protocol\pseudo_http.t failure

Just tried out the latest CVS mp2 on Win32 and had a couple of 
failures.  One of them is t\protocol\pseudo_http.t.  The only thing in 
the error_log is:

[Mon Jul 05 10:41:47 2004] [error] [client 127.0.0.1] user stas: 
authentication failure for "/": Password Mismatch

*** The following error entry is expected and harmless ***
[Mon Jul 05 10:41:47 2004] [error] [client 127.0.0.1] user stas: 
authentication failure for "/": Password Mismatch

Here's the relevant output running as perl t/TEST -v 
t/protocol/pseudo_http.t:

[...]
# send: foobar
# Failed test 5 in t\protocol\pseudo_http.t at line 54
# testing : banner
# received: Access Denied
# Failed test 6 in t\protocol\pseudo_http.t at line 60 fail #4
# Failed test 7 in t\protocol\pseudo_http.t at line 60 fail #5
# expected: Welcome to TestProtocol::pseudo_http
not ok 5
# testing : date
# received:
# expected: Available commands: date quit
not ok 6
# send: date
# testing : quit
# received:
# expected: (?-xism:The time is:)
not ok 7
# send: quit
# Failed test 8 in t\protocol\pseudo_http.t at line 54 fail #2
# testing : end of transmission
# received:
# expected: Goodbye
not ok 8
[...]
FAILED tests 5-8
        Failed 4/13 tests, 69.23% okay
Failed Test              Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t\protocol\pseudo_http.t               13    4  30.77%  5-8
Failed 1/1 test scripts, 0.00% okay. 4/13 subtests failed, 69.23% okay.

This is using Apache 2.0.49 / Perl 5.8.4

- Steve



------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only.  If you have received this message in error or there are any problems, please notify the sender immediately.  The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden.  Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd.  The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: t\protocol\pseudo_http.t failure

Posted by Stas Bekman <st...@stason.org>.
Steve Hay wrote:
> Stas Bekman wrote:
> 
> 
>>Steve Hay wrote:
>> 
>>
>>
>>>Just tried out the latest CVS mp2 on Win32 and had a couple of 
>>>failures.  One of them is t\protocol\pseudo_http.t.
>>>   
>>>
>>
>>There is an auth file that I added to t/htdocs/protocols/basic-auth. Do you 
>>think it should be generated specially on windows and therefore it's not 
>>cross-platform? Try to generate one yourself:
>>
>>htpasswd -bc basic-auth stas foobar
>>
>>overwriting the one in cvs and try the test again?
>>
> 
> Yes, that's it.
> 
> I've attached the file that was generated on my machine.  Note that it 
> said "Automatically using MD5 format." when I ran the command.  Looks 
> like the business with crypt not being supported by the Apache/APR stuff 
> on Win32 again?

Ah, yeah, I forgot that it doesn't support crypt. So much for *Portable* in APR.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: t\protocol\pseudo_http.t failure

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 7 Jul 2004, Stas Bekman wrote:

> Stas Bekman wrote:
[ .. ]
> > Ah, I've switched to md5, does it work now with a
> > special win32 file? I think there are a few other
> > platforms where crypt doesn't work, so we don't want to
> > have all these special cases to maintain.
>
> So, did it take the problem away?

Yes, it did - thanks!

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: t\protocol\pseudo_http.t failure

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Randy Kobes wrote:
> 
>> On Tue, 6 Jul 2004, Stas Bekman wrote:
>>
>>
>>> Randy Kobes wrote:
>>
>>
>> [ .. ]
>>
>>>> Here's a patch that, for Win32, will generate this file
>>>> at the 'perl Makefile.PL' stage, and then use it in the
>>>> tests.
>>>
>>>
>>> Why can't it be generated once and committed? We should
>>> definitely not pollute the already overcrowded
>>> Makefile.PL, to fix some minor issue with a test.
>>
>>
>>
>> Sorry about that - I had misread the earlier messages that
>> it should be generated by the user. Here's a patch that
>> uses an existing file:
> 
> 
> Ah, I've switched to md5, does it work now with a special win32 file? I 
> think there are a few other platforms where crypt doesn't work, so we 
> don't want to have all these special cases to maintain.

So, did it take the problem away?

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: t\protocol\pseudo_http.t failure

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Tue, 6 Jul 2004, Stas Bekman wrote:
> 
> 
>>Randy Kobes wrote:
> 
> [ .. ]
> 
>>>Here's a patch that, for Win32, will generate this file
>>>at the 'perl Makefile.PL' stage, and then use it in the
>>>tests.
>>
>>Why can't it be generated once and committed? We should
>>definitely not pollute the already overcrowded
>>Makefile.PL, to fix some minor issue with a test.
> 
> 
> Sorry about that - I had misread the earlier messages that
> it should be generated by the user. Here's a patch that
> uses an existing file:

Ah, I've switched to md5, does it work now with a special win32 file? I think 
there are a few other platforms where crypt doesn't work, so we don't want to 
have all these special cases to maintain.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: t\protocol\pseudo_http.t failure

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 6 Jul 2004, Stas Bekman wrote:

> Randy Kobes wrote:
[ .. ]
> > Here's a patch that, for Win32, will generate this file
> > at the 'perl Makefile.PL' stage, and then use it in the
> > tests.
>
> Why can't it be generated once and committed? We should
> definitely not pollute the already overcrowded
> Makefile.PL, to fix some minor issue with a test.

Sorry about that - I had misread the earlier messages that
it should be generated by the user. Here's a patch that
uses an existing file:
=========================================================
Index: t/htdocs/protocols/basic-auth-win32
===================================================================
RCS file: t/htdocs/protocols/basic-auth-win32
diff -N t/htdocs/protocols/basic-auth-win32
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ t/htdocs/protocols/basic-auth-win32	6 Jul 2004 16:21:51 -0000
@@ -0,0 +1 @@
+stas:$apr1$79......$XMGOmVnODqc1UKruFgwjM.
Index: t/protocol/TestProtocol/pseudo_http.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/protocol/TestProtocol/pseudo_http.pm,v
retrieving revision 1.2
diff -u -r1.2 pseudo_http.pm
--- t/protocol/TestProtocol/pseudo_http.pm	6 Jul 2004 15:49:13 -0000	1.2
+++ t/protocol/TestProtocol/pseudo_http.pm	6 Jul 2004 16:21:51 -0000
@@ -143,7 +143,14 @@
                 Require user stas
                 Satisfy any
                 # htpasswd -bc basic-auth stas foobar
-                AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth
+                <IfModule !mpm_winnt.c>
+                    AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth
+                </IfModule>
+                # format of auth files differ on Win32
+                # htpasswd.exe -bc basic-auth-win32 stas foobar
+                <IfModule mpm_winnt.c>
+                    AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth-win32
+                </IfModule>
             </IfModule>
         </IfModule>
     </Location>
================================================================

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: t\protocol\pseudo_http.t failure

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Mon, 5 Jul 2004, Steve Hay wrote:
> 
> 
>>Stas Bekman wrote:
>>
>>
>>>Steve Hay wrote:
>>>
>>>
>>>>Just tried out the latest CVS mp2 on Win32 and had a couple of
>>>>failures.  One of them is t\protocol\pseudo_http.t.
>>>
>>>There is an auth file that I added to
>>>t/htdocs/protocols/basic-auth. Do you think it should be
>>>generated specially on windows and therefore it's not
>>>cross-platform? Try to generate one yourself:
>>>
>>>htpasswd -bc basic-auth stas foobar
>>>
>>>overwriting the one in cvs and try the test again?
>>>
>>
>>Yes, that's it.
> 
> 
> Here's a patch that, for Win32, will generate this file at
> the 'perl Makefile.PL' stage, and then use it in the tests.

Why can't it be generated once and committed? We should definitely not pollute 
the already overcrowded Makefile.PL, to fix some minor issue with a test.

> It also changes checking for the mod_access module in this
> test to mod_auth.

Ah, good catch, but it should be both, not s/access/auth/ as Allow is coming 
from mod_access. So +1 to that fix of course.
http://httpd.apache.org/docs-2.0/mod/mod_access.html#allow
-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: t\protocol\pseudo_http.t failure

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 5 Jul 2004, Steve Hay wrote:

> Stas Bekman wrote:
>
> >Steve Hay wrote:
> >
> >>Just tried out the latest CVS mp2 on Win32 and had a couple of
> >>failures.  One of them is t\protocol\pseudo_http.t.
> >
> >There is an auth file that I added to
> >t/htdocs/protocols/basic-auth. Do you think it should be
> >generated specially on windows and therefore it's not
> >cross-platform? Try to generate one yourself:
> >
> >htpasswd -bc basic-auth stas foobar
> >
> >overwriting the one in cvs and try the test again?
> >
> Yes, that's it.

Here's a patch that, for Win32, will generate this file at
the 'perl Makefile.PL' stage, and then use it in the tests.
It also changes checking for the mod_access module in this
test to mod_auth.
=========================================================
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.143
diff -u -r1.143 Makefile.PL
--- Makefile.PL	5 Jul 2004 22:02:42 -0000	1.143
+++ Makefile.PL	6 Jul 2004 02:27:49 -0000
@@ -232,6 +232,9 @@
     printf "Configuring Apache/%s mod_perl/%s Perl/v%vd\n",
         $httpd_version, $VERSION, $^V;

+    # generate auth_file on Win32
+    win32_generate_auth('stas', 'foobar') if (WIN32());
+
     my $apr_config = $build->get_apr_config; #cache it

     # we need to know where apr-config and apu-configs are
@@ -468,6 +471,17 @@
     return unless (my $prefix = $build->{MP_AP_PREFIX});
     my $script = catfile($build->{cwd}, 'build', 'win32_fetch_apxs');
     my @args = ($^X, $script, "--with-apache2=$prefix");
+    system(@args) == 0 or die "system @args failed: $?";
+}
+
+sub win32_generate_auth {
+    my ($user, $passwd) = @_;
+    my $htpasswd = catfile $build->{MP_AP_PREFIX}, 'bin', 'htpasswd.exe';
+    unless (-e $htpasswd) {
+        die "Cannot find htpasswd";
+    }
+    my $auth_file = catfile qw(t htdocs protocols basic-auth-win32);
+    my @args = ($htpasswd, '-bc', $auth_file, $user, $passwd);
     system(@args) == 0 or die "system @args failed: $?";
 }

Index: t/htdocs/protocols/.cvsignore
===================================================================
RCS file: t/htdocs/protocols/.cvsignore
diff -N t/htdocs/protocols/.cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ t/htdocs/protocols/.cvsignore	6 Jul 2004 02:27:49 -0000
@@ -0,0 +1 @@
+basic-auth-win32
Index: t/protocol/pseudo_http.t
===================================================================
RCS file: /home/cvs/modperl-2.0/t/protocol/pseudo_http.t,v
retrieving revision 1.1
diff -u -r1.1 pseudo_http.t
--- t/protocol/pseudo_http.t	5 Jul 2004 01:36:47 -0000	1.1
+++ t/protocol/pseudo_http.t	6 Jul 2004 02:27:49 -0000
@@ -18,7 +18,7 @@
 my $passgood = "foobar";
 my $passbad  = "foObaR";

-plan tests => 13, have_access;
+plan tests => 13, have_auth;

 {
     # supply correct credential when prompted for such and ask the
Index: t/protocol/TestProtocol/pseudo_http.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/protocol/TestProtocol/pseudo_http.pm,v
retrieving revision 1.1
diff -u -r1.1 pseudo_http.pm
--- t/protocol/TestProtocol/pseudo_http.pm	5 Jul 2004 01:36:47 -0000	1.1
+++ t/protocol/TestProtocol/pseudo_http.pm	6 Jul 2004 02:27:49 -0000
@@ -136,13 +136,18 @@
     PerlProcessConnectionHandler TestProtocol::pseudo_http

     <Location TestProtocol::pseudo_http>
-        <IfModule mod_access.c>
+        <IfModule mod_auth.c>
             Order Deny,Allow
             Allow from @servername@
             Require user stas
             Satisfy any
             # htpasswd -bc basic-auth stas foobar
-            AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth
+            <IfModule !mpm_winnt.c>
+                AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth
+            </IfModule>
+            <IfModule mpm_winnt.c>
+                AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth-win32
+            </IfModule>
         </IfModule>
     </Location>

==================================================================

-- 
best regards,
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: t\protocol\pseudo_http.t failure

Posted by Steve Hay <st...@uk.radan.com>.
Stas Bekman wrote:

>Steve Hay wrote:
>  
>
>>Just tried out the latest CVS mp2 on Win32 and had a couple of 
>>failures.  One of them is t\protocol\pseudo_http.t.
>>    
>>
>
>There is an auth file that I added to t/htdocs/protocols/basic-auth. Do you 
>think it should be generated specially on windows and therefore it's not 
>cross-platform? Try to generate one yourself:
>
>htpasswd -bc basic-auth stas foobar
>
>overwriting the one in cvs and try the test again?
>
Yes, that's it.

I've attached the file that was generated on my machine.  Note that it 
said "Automatically using MD5 format." when I ran the command.  Looks 
like the business with crypt not being supported by the Apache/APR stuff 
on Win32 again?

- Steve


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only.  If you have received this message in error or there are any problems, please notify the sender immediately.  The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden.  Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd.  The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.

Re: t\protocol\pseudo_http.t failure

Posted by Stas Bekman <st...@stason.org>.
Steve Hay wrote:
> Just tried out the latest CVS mp2 on Win32 and had a couple of 
> failures.  One of them is t\protocol\pseudo_http.t.  The only thing in 
> the error_log is:
> 
> [Mon Jul 05 10:41:47 2004] [error] [client 127.0.0.1] user stas: 
> authentication failure for "/": Password Mismatch
> 
> *** The following error entry is expected and harmless ***
> [Mon Jul 05 10:41:47 2004] [error] [client 127.0.0.1] user stas: 
> authentication failure for "/": Password Mismatch
> 
> Here's the relevant output running as perl t/TEST -v 
> t/protocol/pseudo_http.t:
> 
> [...]
> # send: foobar
> # Failed test 5 in t\protocol\pseudo_http.t at line 54
> # testing : banner
> # received: Access Denied

There is an auth file that I added to t/htdocs/protocols/basic-auth. Do you 
think it should be generated specially on windows and therefore it's not 
cross-platform? Try to generate one yourself:

htpasswd -bc basic-auth stas foobar

overwriting the one in cvs and try the test again?

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org