perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Moyer <f...@redhotpenguin.com>
Subject t/api/server_const.t test failure from Red Hat developer vanity patches
Date Wed, 01 Aug 2012 20:41:34 GMT
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


Mime
View raw message