Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Dev

t/api/server_const.t test failure from Red Hat developer vanity patches

 

 

ModPerl dev RSS feed   Index | Next | Previous | View Threaded


fred at redhotpenguin

Aug 1, 2012, 1:41 PM

Post #1 of 3 (663 views)
Permalink
t/api/server_const.t test failure from Red Hat developer vanity patches

This failing test on Centos/Fedora platforms has been bugging me:

[rhp [at] ap mod_perl-2.0.7]$ ./t/TEST -verbose t/api/server_const.t
...
# testing : Apache2::ServerUtil::get_server_banner()
# expected: Apache/2.2.15 (Unix) world domination series/2.0
mod_apreq2-20090110/2.8.0 mod_perl/2.0.7 Perl/v5.10.1
# received: Apache/2.2.15 (CentOS) world domination series/2.0
mod_apreq2-20090110/2.8.0 mod_perl/2.0.7 Perl/v5.10.1
not ok 5
# testing : Apache2::ServerUtil::get_server_version()
# expected: Apache/2.2.15 (Unix) world domination series/2.0
mod_apreq2-20090110/2.8.0 mod_perl/2.0.7 Perl/v5.10.1
# received: Apache/2.2.15 (CentOS) world domination series/2.0
mod_apreq2-20090110/2.8.0 mod_perl/2.0.7 Perl/v5.10.1
not ok 6
Failed 2/6 subtests


The test code is in here:

t/response/TestAPI/server_const.pm

# assuming ServerTokens Full (default) the banner equals description
ok t_cmp(Apache2::ServerUtil::get_server_banner, $server_descr,
'Apache2::ServerUtil::get_server_banner()');

# version is just an alias for banner
ok t_cmp(Apache2::ServerUtil::get_server_version, $server_descr,
'Apache2::ServerUtil::get_server_version()');



The reason this test failure occurs is because the RedHat rpm devs
patched the version component code to replace 'Unix' with @VENDOR@, in
these cases either Centos or Fedora. But their patch isn't complete -
they didn't patch the server description code, so that returns 'Unix'
instead of 'Centos'.

Thoughts on how to resolve this? I think it's a given that vendors are
going to mark this up, so I'd say +1 to just removing these 2 tests.

--- httpd-2.2.14/server/core.c.release
+++ httpd-2.2.14/server/core.c
@@ -2728,6 +2728,7 @@ enum server_token_type {
SrvTk_MINIMAL, /* eg: Apache/2.0.41 */
SrvTk_OS, /* eg: Apache/2.0.41 (UNIX) */
SrvTk_FULL, /* eg: Apache/2.0.41 (UNIX) PHP/4.2.2 FooBar/1.2b */
+ SrvTk_FULL_RELEASE, /* eg: Apache/2.0.41 (Red Hat) (Release
32.el5) PHP/4.2.2 FooBar/1.2b */
SrvTk_PRODUCT_ONLY /* eg: Apache */
};
static enum server_token_type ap_server_tokens = SrvTk_FULL;
@@ -2812,15 +2813,18 @@ static void set_banner(apr_pool_t *pconf
else if (ap_server_tokens == SrvTk_MAJOR) {
ap_add_version_component(pconf, AP_SERVER_BASEPRODUCT "/"
AP_SERVER_MAJORVERSION);
}
- else {
- ap_add_version_component(pconf, AP_SERVER_BASEVERSION " ("
PLATFORM ")");
+ else if (ap_server_tokens == SrvTk_FULL_RELEASE) {
+ ap_add_version_component(pconf, AP_SERVER_BASEVERSION "
(@VENDOR@) (Release @RELEASE@)");
+ }
+ else {
+ ap_add_version_component(pconf, AP_SERVER_BASEVERSION " (@VENDOR@)");
}

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] perl
For additional commands, e-mail: dev-help [at] perl


jorton at redhat

Oct 1, 2012, 5:28 AM

Post #2 of 3 (565 views)
Permalink
Re: t/api/server_const.t test failure from Red Hat developer vanity patches [In reply to]

On Wed, Aug 01, 2012 at 01:41:34PM -0700, Fred Moyer wrote:
> The reason this test failure occurs is because the RedHat rpm devs
> patched the version component code to replace 'Unix' with @VENDOR@, in
> these cases either Centos or Fedora. But their patch isn't complete -
> they didn't patch the server description code, so that returns 'Unix'
> instead of 'Centos'.

Sorry about that Fred, that's my mistake. I've fixed this for future
releases by changing the #define PLATFORM in os.h to use the vendor
name.

(FWIW, we patch Server not only for our own vanity: customers request
differentiation of the Server header for internal audit purposes.)

Regards, Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] perl
For additional commands, e-mail: dev-help [at] perl


fred at redhotpenguin

Oct 1, 2012, 7:52 AM

Post #3 of 3 (568 views)
Permalink
Re: t/api/server_const.t test failure from Red Hat developer vanity patches [In reply to]

On Oct 1, 2012 5:28 AM, "Joe Orton" <jorton [at] redhat> wrote:
>
> On Wed, Aug 01, 2012 at 01:41:34PM -0700, Fred Moyer wrote:
> > The reason this test failure occurs is because the RedHat rpm devs
> > patched the version component code to replace 'Unix' with @VENDOR@, in
> > these cases either Centos or Fedora. But their patch isn't complete -
> > they didn't patch the server description code, so that returns 'Unix'
> > instead of 'Centos'.
>
> Sorry about that Fred, that's my mistake. I've fixed this for future
> releases by changing the #define PLATFORM in os.h to use the vendor
> name.

No problem, thanks for the fix!

>
> (FWIW, we patch Server not only for our own vanity: customers request
> differentiation of the Server header for internal audit purposes.)
>
> Regards, Joe

ModPerl dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.