Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 14D08200CB0 for ; Fri, 23 Jun 2017 21:33:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 13929160BE5; Fri, 23 Jun 2017 19:33:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 34A5B160BE2 for ; Fri, 23 Jun 2017 21:33:34 +0200 (CEST) Received: (qmail 97390 invoked by uid 500); 23 Jun 2017 19:33:33 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 97381 invoked by uid 99); 23 Jun 2017 19:33:33 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jun 2017 19:33:33 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id C5EBD3A0057 for ; Fri, 23 Jun 2017 19:33:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1799695 - in /httpd/test/framework/trunk/t: conf/ htdocs/modules/proxy/fcgi-generic-rewrite/ htdocs/modules/proxy/fcgi-generic/ modules/ Date: Fri, 23 Jun 2017 19:33:29 -0000 To: cvs@httpd.apache.org From: jchampion@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170623193331.C5EBD3A0057@svn01-us-west.apache.org> archived-at: Fri, 23 Jun 2017 19:33:35 -0000 Author: jchampion Date: Fri Jun 23 19:33:29 2017 New Revision: 1799695 URL: http://svn.apache.org/viewvc?rev=1799695&view=rev Log: proxy_fcgi: add GENERIC backend type regression tests For PR59618 and the followup PR59815. Added: httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic/ httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic-rewrite/ httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic-rewrite/index.php (with props) httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic/index.php (with props) Modified: httpd/test/framework/trunk/t/conf/proxy.conf.in httpd/test/framework/trunk/t/modules/proxy_fcgi.t Modified: httpd/test/framework/trunk/t/conf/proxy.conf.in URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/proxy.conf.in?rev=1799695&r1=1799694&r2=1799695&view=diff ============================================================================== --- httpd/test/framework/trunk/t/conf/proxy.conf.in (original) +++ httpd/test/framework/trunk/t/conf/proxy.conf.in Fri Jun 23 19:33:29 2017 @@ -69,6 +69,25 @@ SetHandler proxy:fcgi://127.0.0.1:${FCGI_PORT} + + = 2.4.26> + + ProxyFCGIBackendType GENERIC + + SetHandler proxy:fcgi://127.0.0.1:${FCGI_PORT} + + + + + = 2.4.26> + + + ProxyFCGIBackendType GENERIC + RewriteEngine On + RewriteRule ^.*\.php(/.*)?$ fcgi://127.0.0.1:${FCGI_PORT}@SERVERROOT@/htdocs/modules/proxy/fcgi-generic-rewrite/$0 [L,P] + + + Added: httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic-rewrite/index.php URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic-rewrite/index.php?rev=1799695&view=auto ============================================================================== --- httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic-rewrite/index.php (added) +++ httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic-rewrite/index.php Fri Jun 23 19:33:29 2017 @@ -0,0 +1,3 @@ + Propchange: httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic-rewrite/index.php ------------------------------------------------------------------------------ svn:eol-style = native Added: httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic/index.php URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic/index.php?rev=1799695&view=auto ============================================================================== --- httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic/index.php (added) +++ httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic/index.php Fri Jun 23 19:33:29 2017 @@ -0,0 +1,3 @@ + Propchange: httpd/test/framework/trunk/t/htdocs/modules/proxy/fcgi-generic/index.php ------------------------------------------------------------------------------ svn:eol-style = native Modified: httpd/test/framework/trunk/t/modules/proxy_fcgi.t URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/proxy_fcgi.t?rev=1799695&r1=1799694&r2=1799695&view=diff ============================================================================== --- httpd/test/framework/trunk/t/modules/proxy_fcgi.t (original) +++ httpd/test/framework/trunk/t/modules/proxy_fcgi.t Fri Jun 23 19:33:29 2017 @@ -5,9 +5,11 @@ use Apache::Test; use Apache::TestRequest; use Apache::TestUtil; -my $have_fcgisetenvif = have_min_apache_version('2.4.26'); +my $have_fcgisetenvif = have_min_apache_version('2.4.26'); +my $have_fcgibackendtype = have_min_apache_version('2.4.26'); -plan tests => (7 * $have_fcgisetenvif) + 2, +plan tests => (7 * $have_fcgisetenvif) + (2 * $have_fcgibackendtype) + + (2 * $have_fcgibackendtype * have_module('rewrite')) + 2, need ( 'mod_proxy_fcgi', 'FCGI', @@ -136,14 +138,13 @@ sub run_fcgi_envvar_request($$) # depending on the test conditions, that may not always be the case... my $fcgi_port = Apache::Test::vars('proxy_fcgi_port') - 1; my $envs; +my $docroot = Apache::Test::vars('documentroot'); if ($have_fcgisetenvif) { # ProxyFCGISetEnvIf tests. Query the backend. $envs = run_fcgi_envvar_request($fcgi_port, "/fcgisetenv?query"); # Check the response values. - my $docroot = Apache::Test::vars('documentroot'); - ok t_cmp($envs->{'QUERY_STRING'}, 'test_value', "ProxyFCGISetEnvIf can override an existing variable"); ok t_cmp($envs->{'TEST_NOT_SET'}, undef, "ProxyFCGISetEnvIf does not set variables if condition is false"); ok t_cmp($envs->{'TEST_EMPTY'}, '', "ProxyFCGISetEnvIf can set empty values"); @@ -152,6 +153,23 @@ if ($have_fcgisetenvif) { ok t_cmp($envs->{'REMOTE_ADDR'}, undef, "ProxyFCGISetEnvIf can unset var"); } +# Tests for GENERIC backend type behavior. +if ($have_fcgibackendtype) { + $envs = run_fcgi_envvar_request($fcgi_port, "/modules/proxy/fcgi-generic/index.php?query"); + + ok t_cmp($envs->{'SCRIPT_FILENAME'}, + $docroot . '/modules/proxy/fcgi-generic/index.php', + "GENERIC SCRIPT_FILENAME should have neither query string nor proxy: prefix"); +} + +if ($have_fcgibackendtype && have_module('rewrite')) { + $envs = run_fcgi_envvar_request($fcgi_port, "/modules/proxy/fcgi-generic-rewrite/index.php?query"); + + ok t_cmp($envs->{'SCRIPT_FILENAME'}, + $docroot . '/modules/proxy/fcgi-generic-rewrite/index.php', + "GENERIC SCRIPT_FILENAME should have neither query string nor proxy: prefix"); +} + # Regression test for PR61202. $envs = run_fcgi_envvar_request($fcgi_port, "/modules/proxy/fcgi/index.php");