You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Fred Moyer <fr...@redhotpenguin.com> on 2012/08/01 22:41:34 UTC

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@app 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@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


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

Posted by Fred Moyer <fr...@redhotpenguin.com>.
On Oct 1, 2012 5:28 AM, "Joe Orton" <jo...@redhat.com> 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

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

Posted by Joe Orton <jo...@redhat.com>.
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@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org