You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Philippe M. Chiasson" <go...@ectoplasm.org> on 2004/05/06 22:26:08 UTC
[Patch mp2] Fix api/module test to pass on static builds
Stas Bekman wrote:
>>Here are the results you asked for :
>>
>>t/TEST -clean
>>t/TEST -v t/api/module.t t/apr/netlib.t t/compat/conn_rec.t
>>t/modperl/setupenv.t t/preconnection/note.t
>
>
> Thanks. So it all comes down to two issues.
>
> 1) Apache::Module::loaded('mod_perl.so')
>
>
>>t/api/module............1..11
>># testing : Apache::Module::loaded('mod_perl.so')
>># expected: 1
>># received: 0
>>not ok 6
>
>
> It makes sense that mod_perl.so is not loaded, since it doesn't exist.
> Philippe, I wonder how this test has passed for you.
That's correct, and really, it's a borked test then. It did pass for me once
strangely, as I managed to have 2 mod_perls in my httpd, a static one and a dso
loaded one ( can't reproduce that, lol)
Index: t/response/TestAPI/module.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v
retrieving revision 1.9
diff -u -I$Id -r1.9 module.pm
--- t/response/TestAPI/module.pm 8 Apr 2004 01:56:31 -0000 1.9
+++ t/response/TestAPI/module.pm 6 May 2004 20:24:04 -0000
@@ -7,6 +7,7 @@
use Apache::Test;
use Apache::TestConfig;
use Apache::TestUtil;
+use Apache::BuildConfig;
use Apache::Module ();
use DynaLoader ();
@@ -84,9 +85,12 @@
"Apache::Module::loaded('Apache__Module_foo.c')");
#.so
- ok t_cmp(1, Apache::Module::loaded('mod_perl.so'),
+ {
+ my $expect = Apache::BuildConfig->new->{MP_USE_STATIC} ? 0 : 1;
+ ok t_cmp($expect, Apache::Module::loaded('mod_perl.so'),
"Apache::Module::loaded('mod_perl.so')");
-
+ }
+
ok t_cmp(0, Apache::Module::loaded('Apache__Module__foo.so'),
"Apache::Module::loaded('Apache__Module_foo.so')");
> 2) the rest of the tests fail on $ENV{REMOTE_ADDR} and $r->remote_address
> returning 0.0.0.0 instead of 127.0.0.1. Sounds like an ipv6 issue to me. but
> since all those running ipv6 didn't report that problem that sounds as either
> a bug in Apache on HPUX11i or some OS issues. Olivier, could you try a mod_cgi
> script that prints out $ENV{REMOTE_ADDR}, when your client is running on the
> same machine and when it's running from another machine? Thanks.
>
> __________________________________________________________________
> 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
>
--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [Patch mp2] Fix api/module test to pass on static builds
Posted by Stas Bekman <st...@stason.org>.
> That's correct, and really, it's a borked test then. It did pass for me once
> strangely, as I managed to have 2 mod_perls in my httpd, a static one and a dso
> loaded one ( can't reproduce that, lol)
>
> Index: t/response/TestAPI/module.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v
> retrieving revision 1.9
> diff -u -I$Id -r1.9 module.pm
> --- t/response/TestAPI/module.pm 8 Apr 2004 01:56:31 -0000 1.9
> +++ t/response/TestAPI/module.pm 6 May 2004 20:24:04 -0000
> @@ -7,6 +7,7 @@
> use Apache::Test;
> use Apache::TestConfig;
> use Apache::TestUtil;
> +use Apache::BuildConfig;
>
> use Apache::Module ();
> use DynaLoader ();
> @@ -84,9 +85,12 @@
> "Apache::Module::loaded('Apache__Module_foo.c')");
>
> #.so
> - ok t_cmp(1, Apache::Module::loaded('mod_perl.so'),
> + {
> + my $expect = Apache::BuildConfig->new->{MP_USE_STATIC} ? 0 : 1;
> + ok t_cmp($expect, Apache::Module::loaded('mod_perl.so'),
> "Apache::Module::loaded('mod_perl.so')");
> -
> + }
> +
> ok t_cmp(0, Apache::Module::loaded('Apache__Module__foo.so'),
> "Apache::Module::loaded('Apache__Module_foo.so')");
Actually it doesn't work if you have both USE_(STATIC|DSO) set. I will try
with SHARED_LIB
__________________________________________________________________
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: [Patch mp2] Fix api/module test to pass on static builds
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>>>Actually, I can't think of a good reason why checking for 'module.so' and not
>>>'module.c' would make sense.
>>
>>
>>Hmm, may be someone will want to know that it was loaded as DSO.
>
>
> Yeah, I can't think really why, but that's what .so would be for.
really?
http://marc.theaimsgroup.com/?t=98820866200003&r=1&w=2
;)
--Geoff
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [Patch mp2] Fix api/module test to pass on static builds
Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Stas Bekman wrote:
> Philippe M. Chiasson wrote:
>
>
>>>>That's correct, and really, it's a borked test then. It did pass for me once
>>>>strangely, as I managed to have 2 mod_perls in my httpd, a static one and a dso
>>>>loaded one ( can't reproduce that, lol)
>>>
>>>
>>>Shouldn't loaded() be fixed instead to tell you whether mod_perl is linked? Or
>>>was the idea for it to work only for DSO modules?
>>
>>
>>No, you can chose to check for a DSO module with ->loaded('module.so').
>>But you can also check for a module with ->loaded('module.c') and that will
>>be true for both static or dso loaded modules.
>
>
> So most likely you always want to check for .c
Yup, in most cases you do.
>
>>>If it doesn't I can't see any value in this API, since to check mod_perl you
>>>can check $ENV{MOD_PERL} and to check for any other module, you can't really
>>>say that the module is not available if its linked statically. No?
>>
>>
>>Yes, for mod_perl you can check $ENV{MOD_PERL}, but let's say you want to know
>>if mod_autoindex is installed, you check for ->loaded('mod_autoindex.c') and
>>this will work.
>>
>>Actually, I can't think of a good reason why checking for 'module.so' and not
>>'module.c' would make sense.
>
>
> Hmm, may be someone will want to know that it was loaded as DSO.
Yeah, I can't think really why, but that's what .so would be for.
> Please commit that patch. Thanks.
np.
>
--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [Patch mp2] Fix api/module test to pass on static builds
Posted by Stas Bekman <st...@stason.org>.
Philippe M. Chiasson wrote:
>>>That's correct, and really, it's a borked test then. It did pass for me once
>>>strangely, as I managed to have 2 mod_perls in my httpd, a static one and a dso
>>>loaded one ( can't reproduce that, lol)
>>
>>
>>Shouldn't loaded() be fixed instead to tell you whether mod_perl is linked? Or
>>was the idea for it to work only for DSO modules?
>
>
> No, you can chose to check for a DSO module with ->loaded('module.so').
> But you can also check for a module with ->loaded('module.c') and that will
> be true for both static or dso loaded modules.
So most likely you always want to check for .c
>>If it doesn't I can't see any value in this API, since to check mod_perl you
>>can check $ENV{MOD_PERL} and to check for any other module, you can't really
>>say that the module is not available if its linked statically. No?
>
>
> Yes, for mod_perl you can check $ENV{MOD_PERL}, but let's say you want to know
> if mod_autoindex is installed, you check for ->loaded('mod_autoindex.c') and
> this will work.
>
> Actually, I can't think of a good reason why checking for 'module.so' and not
> 'module.c' would make sense.
Hmm, may be someone will want to know that it was loaded as DSO.
Please commit that patch. Thanks.
--
__________________________________________________________________
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
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [Patch mp2] Fix api/module test to pass on static builds
Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Stas Bekman wrote:
> Philippe M. Chiasson wrote:
>
>>Stas Bekman wrote:
>>
>>
>>>>Here are the results you asked for :
>>>>
>>>>t/TEST -clean
>>>>t/TEST -v t/api/module.t t/apr/netlib.t t/compat/conn_rec.t
>>>>t/modperl/setupenv.t t/preconnection/note.t
>>>
>>>
>>>Thanks. So it all comes down to two issues.
>>>
>>>1) Apache::Module::loaded('mod_perl.so')
>>>
>>>
>>>
>>>
>>>>t/api/module............1..11
>>>># testing : Apache::Module::loaded('mod_perl.so')
>>>># expected: 1
>>>># received: 0
>>>>not ok 6
>>>
>>>
>>>It makes sense that mod_perl.so is not loaded, since it doesn't exist.
>>>Philippe, I wonder how this test has passed for you.
>>
>>
>>That's correct, and really, it's a borked test then. It did pass for me once
>>strangely, as I managed to have 2 mod_perls in my httpd, a static one and a dso
>>loaded one ( can't reproduce that, lol)
>
>
> Shouldn't loaded() be fixed instead to tell you whether mod_perl is linked? Or
> was the idea for it to work only for DSO modules?
No, you can chose to check for a DSO module with ->loaded('module.so').
But you can also check for a module with ->loaded('module.c') and that will
be true for both static or dso loaded modules.
> If it doesn't I can't see any value in this API, since to check mod_perl you
> can check $ENV{MOD_PERL} and to check for any other module, you can't really
> say that the module is not available if its linked statically. No?
Yes, for mod_perl you can check $ENV{MOD_PERL}, but let's say you want to know
if mod_autoindex is installed, you check for ->loaded('mod_autoindex.c') and
this will work.
Actually, I can't think of a good reason why checking for 'module.so' and not
'module.c' would make sense.
>
>>Index: t/response/TestAPI/module.pm
>>===================================================================
>>RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v
>>retrieving revision 1.9
>>diff -u -I$Id -r1.9 module.pm
>>--- t/response/TestAPI/module.pm 8 Apr 2004 01:56:31 -0000 1.9
>>+++ t/response/TestAPI/module.pm 6 May 2004 20:24:04 -0000
>>@@ -7,6 +7,7 @@
>> use Apache::Test;
>> use Apache::TestConfig;
>> use Apache::TestUtil;
>>+use Apache::BuildConfig;
>>
>> use Apache::Module ();
>> use DynaLoader ();
>>@@ -84,9 +85,12 @@
>> "Apache::Module::loaded('Apache__Module_foo.c')");
>>
>> #.so
>>- ok t_cmp(1, Apache::Module::loaded('mod_perl.so'),
>>+ {
>>+ my $expect = Apache::BuildConfig->new->{MP_USE_STATIC} ? 0 : 1;
>>+ ok t_cmp($expect, Apache::Module::loaded('mod_perl.so'),
>> "Apache::Module::loaded('mod_perl.so')");
>>-
>>+ }
>>+
>> ok t_cmp(0, Apache::Module::loaded('Apache__Module__foo.so'),
>> "Apache::Module::loaded('Apache__Module_foo.so')");
>
>
> __________________________________________________________________
> 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
>
--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [Patch mp2] Fix api/module test to pass on static builds
Posted by Stas Bekman <st...@stason.org>.
Philippe M. Chiasson wrote:
>
> Stas Bekman wrote:
>
>>>Here are the results you asked for :
>>>
>>>t/TEST -clean
>>>t/TEST -v t/api/module.t t/apr/netlib.t t/compat/conn_rec.t
>>>t/modperl/setupenv.t t/preconnection/note.t
>>
>>
>>Thanks. So it all comes down to two issues.
>>
>>1) Apache::Module::loaded('mod_perl.so')
>>
>>
>>
>>>t/api/module............1..11
>>># testing : Apache::Module::loaded('mod_perl.so')
>>># expected: 1
>>># received: 0
>>>not ok 6
>>
>>
>>It makes sense that mod_perl.so is not loaded, since it doesn't exist.
>>Philippe, I wonder how this test has passed for you.
>
>
> That's correct, and really, it's a borked test then. It did pass for me once
> strangely, as I managed to have 2 mod_perls in my httpd, a static one and a dso
> loaded one ( can't reproduce that, lol)
Shouldn't loaded() be fixed instead to tell you whether mod_perl is linked? Or
was the idea for it to work only for DSO modules?
If it doesn't I can't see any value in this API, since to check mod_perl you
can check $ENV{MOD_PERL} and to check for any other module, you can't really
say that the module is not available if its linked statically. No?
> Index: t/response/TestAPI/module.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v
> retrieving revision 1.9
> diff -u -I$Id -r1.9 module.pm
> --- t/response/TestAPI/module.pm 8 Apr 2004 01:56:31 -0000 1.9
> +++ t/response/TestAPI/module.pm 6 May 2004 20:24:04 -0000
> @@ -7,6 +7,7 @@
> use Apache::Test;
> use Apache::TestConfig;
> use Apache::TestUtil;
> +use Apache::BuildConfig;
>
> use Apache::Module ();
> use DynaLoader ();
> @@ -84,9 +85,12 @@
> "Apache::Module::loaded('Apache__Module_foo.c')");
>
> #.so
> - ok t_cmp(1, Apache::Module::loaded('mod_perl.so'),
> + {
> + my $expect = Apache::BuildConfig->new->{MP_USE_STATIC} ? 0 : 1;
> + ok t_cmp($expect, Apache::Module::loaded('mod_perl.so'),
> "Apache::Module::loaded('mod_perl.so')");
> -
> + }
> +
> ok t_cmp(0, Apache::Module::loaded('Apache__Module__foo.so'),
> "Apache::Module::loaded('Apache__Module_foo.so')");
__________________________________________________________________
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
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html