Add some mod_request + mod_include GET/POST tests

As usual, feel free to improve my limited perl syntax knowledge

git-svn-id: https://svn.apache.org/repos/asf/httpd/test/framework/trunk@1889326 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/t/conf/include.conf.in b/t/conf/include.conf.in
index 7e686b9..349f565 100644
--- a/t/conf/include.conf.in
+++ b/t/conf/include.conf.in
@@ -46,6 +46,11 @@
         Options Includes
     </Directory>
 
+    <Directory @SERVERROOT@/htdocs/modules/include/mod_request>
+        Options Includes
+        KeptBodySize 32
+    </Directory>
+
     <IfDefine APACHE2>
     <IfModule mod_bucketeer.c>
         <Directory @SERVERROOT@/htdocs/modules/include/bucketeer>
diff --git a/t/htdocs/modules/include/mod_request/echo.shtml b/t/htdocs/modules/include/mod_request/echo.shtml
new file mode 100755
index 0000000..b211acf
--- /dev/null
+++ b/t/htdocs/modules/include/mod_request/echo.shtml
@@ -0,0 +1 @@
+<!--#echo var="DOCUMENT_NAME" -->
diff --git a/t/htdocs/modules/include/mod_request/post.shtml b/t/htdocs/modules/include/mod_request/post.shtml
new file mode 100755
index 0000000..a6721e3
--- /dev/null
+++ b/t/htdocs/modules/include/mod_request/post.shtml
@@ -0,0 +1 @@
+<!--#include virtual="/modules/cgi/perl_post.pl?$QUERY_STRING"-->
diff --git a/t/modules/include.t b/t/modules/include.t
index 8b66aa6..9ff2411 100644
--- a/t/modules/include.t
+++ b/t/modules/include.t
@@ -97,6 +97,10 @@
 "virtualq.shtml?foo=bar" =>   "foo=bar  pass    inc-two.shtml body  foo=bar", # PR#12655
 
 "inc-nego.shtml"        =>    "index.html.en", # requires mod_negotiation
+"mod_request/echo.shtml"=>    "echo.shtml",
+"mod_request/post.shtml?foo=bar&foo2=bar2"
+                        =>    "GET foo: bar foo2: bar2",
+"mod_request/post.shtml"=>    "POST foo: bar foo2: bar2",   # will be twice, only the first one succeed
 );
 
 my %ap_expr_test = (
@@ -228,11 +232,12 @@
     push @todo, (scalar keys %tests) + 1;
 }
 
-# in addition to %tests, there are 1 fsize and 1 flastmod test,
+# in addition to %tests, there are 1 mod_request expected failure,
+# 1 fsize and 1 flastmod test,
 # 1 GET test, 2 query string tests, 14 XBitHack tests and 14 
 # tests that use mod_bucketeer to construct brigades for mod_include
 
-my $tests = (scalar keys %tests) + @patterns + 1 + 1 + 1 + 2 + 14 + 14;
+my $tests = (scalar keys %tests) + 1 + @patterns + 1 + 1 + 1 + 2 + 14 + 14;
 
 plan tests => $tests,
               todo => \@todo,
@@ -268,6 +273,35 @@
             skip "Skipping 'exec cgi' test; no cgi module.", 1;
         }
     }
+    elsif ($doc =~ m/mod_request.*\?/) {
+        # param in the url ==> use GET
+        if (have_cgi) {
+            ok t_cmp(super_chomp(GET_BODY "$dir$doc"),
+                     $tests{$doc},
+                     "GET $dir$doc"
+                    );
+        }
+        else {
+            skip "Skipping 'exec cgi' test; no cgi module.", 1;
+        }
+    }
+    elsif ($doc =~ m/mod_request/) {
+        # no param in the url ==> use POST with a content
+        if (have_cgi) {
+            ok t_cmp(super_chomp(POST_BODY "$dir$doc", content => "foo=bar&foo2=bar2"),
+                     $tests{$doc},
+                     "POST $dir$doc"
+                    );
+            if ($doc =~ m/mod_request.*post/) {
+                # KeptBodySize is 32
+                my $r = POST("$dir$doc", content => "foo=bar&foo2=bar2&foo3=bar3&foo4=bar4");
+                ok t_cmp($r->code, 413, "sizeof(body) > KeptBodySize");
+            }
+        }
+        else {
+            skip "Skipping 'exec cgi' test; no cgi module.", 2;
+        }
+    }
     else {
         ok t_cmp(super_chomp(GET_BODY "$dir$doc"),
                  $tests{$doc},