jwoolley 01/11/19 18:36:17
Modified: perl-framework/t/conf extra.conf.in
perl-framework/t/modules include.t
Added: perl-framework/t/htdocs/modules/include/exec/off cgi.shtml
cmd.shtml
perl-framework/t/htdocs/modules/include/exec/on cgi.shtml
cmd.shtml
Log:
Add tests for exec cgi and exec cmd. This in response to PR8772 which
says that exec cmd is broken in 2.0.28. I am unable to reproduce this with
HEAD, at least with these tests. I've asked the PR submitter for a more
detailed description of how to duplicate that problem. In the meanwhile,
if anyone sees ways to improve this test (or if the exec cmd test does in
fact fail for you), please let me know.
Revision Changes Path
1.31 +2 -2 httpd-test/perl-framework/t/conf/extra.conf.in
Index: extra.conf.in
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/conf/extra.conf.in,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -u -r1.30 -r1.31
--- extra.conf.in 2001/11/19 20:54:02 1.30
+++ extra.conf.in 2001/11/20 02:36:17 1.31
@@ -158,8 +158,8 @@
XBitHack full
</Directory>
- <Directory @SERVERROOT@/htdocs/modules/include/exec>
- Options +Includes
+ <Directory @SERVERROOT@/htdocs/modules/include/exec/on>
+ Options Includes
</Directory>
</IfModule>
1.1
httpd-test/perl-framework/t/htdocs/modules/include/exec/off/cgi.shtml
Index: cgi.shtml
===================================================================
<!--#exec cgi="/modules/cgi/perl.pl"-->
1.1
httpd-test/perl-framework/t/htdocs/modules/include/exec/off/cmd.shtml
Index: cmd.shtml
===================================================================
<!--#exec cmd="echo pass"-->
1.1
httpd-test/perl-framework/t/htdocs/modules/include/exec/on/cgi.shtml
Index: cgi.shtml
===================================================================
<!--#exec cgi="/modules/cgi/perl.pl"-->
1.1
httpd-test/perl-framework/t/htdocs/modules/include/exec/on/cmd.shtml
Index: cmd.shtml
===================================================================
<!--#exec cmd="echo pass"-->
1.12 +37 -11 httpd-test/perl-framework/t/modules/include.t
Index: include.t
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/modules/include.t,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -u -r1.11 -r1.12
--- include.t 2001/11/19 20:54:02 1.11
+++ include.t 2001/11/20 02:36:17 1.12
@@ -45,18 +45,22 @@
"extra/inc-bogus.shtml" =>
"[an error occurred while processing this directive] inc-bogus.shtml
body",
"abs-path.shtml" =>
- "inc-extra2.shtml body inc-extra1.shtml body abs-path.shtml body"
+ "inc-extra2.shtml body inc-extra1.shtml body abs-path.shtml body",
+"exec/off/cmd.shtml" =>
+ "[an error occurred while processing this directive]",
+"exec/on/cmd.shtml" => "pass"
);
#
-# in addition to %test, there are 1 GET test and 9 XBitHack tests
+# in addition to $tests, there is 1 GET test, 9 XBitHack tests,
+# and 2 exec cgi tests
#
my $tests = keys %test;
-plan tests => $tests + 10, have_module 'include';
+plan tests => $tests + 12, have_module 'include';
foreach $doc (sort keys %test) {
ok t_cmp($test{$doc},
- &super_chomp(GET_BODY "$dir$doc"),
+ super_chomp(GET_BODY "$dir$doc"),
"GET $dir$doc"
);
}
@@ -67,13 +71,35 @@
"GET $dir$doc"
);
+
+### EXEC CGI TESTS
+# skipped if !have_cgi
+my %execcgitest = (
+"exec/off/cgi.shtml" =>
+ "[an error occurred while processing this directive]",
+"exec/on/cgi.shtml" =>
+ "perl cgi"
+);
+foreach $doc (sort keys %execcgitest) {
+ if (have_cgi()) {
+ ok t_cmp($execcgitest{$doc},
+ super_chomp(GET_BODY "$dir$doc"),
+ "GET $dir$doc"
+ );
+ }
+ else {
+ skip "Skipping 'exec cgi' test; no cgi module.", 1;
+ }
+}
+
+
### XBITHACK TESTS
# test xbithack off
$doc = "xbithack/off/test.html";
foreach ("0444", "0544", "0554") {
chmod oct($_), "htdocs/$dir$doc";
ok t_cmp("<BODY> <!--#include virtual=\"../../inc-two.shtml\"-->
</BODY>",
- &super_chomp(GET_BODY "$dir$doc"),
+ super_chomp(GET_BODY "$dir$doc"),
"XBitHack off [$_]"
);
}
@@ -82,14 +108,14 @@
$doc = "xbithack/on/test.html";
chmod 0444, "htdocs$dir$doc";
ok t_cmp("<BODY> <!--#include virtual=\"../../inc-two.shtml\"--> </BODY>",
- &super_chomp(GET_BODY "$dir$doc"),
+ super_chomp(GET_BODY "$dir$doc"),
"XBitHack on [0444]"
);
foreach ("0544", "0554") {
chmod oct($_), "htdocs/$dir$doc";
ok t_cmp("No Last-modified date ; <BODY> inc-two.shtml body </BODY>",
- &check_xbithack(GET "$dir$doc"),
+ check_xbithack(GET "$dir$doc"),
"XBitHack on [$_]"
);
}
@@ -98,17 +124,17 @@
$doc = "xbithack/full/test.html";
chmod 0444, "htdocs/$dir$doc";
ok t_cmp("<BODY> <!--#include virtual=\"../../inc-two.shtml\"--> </BODY>",
- &super_chomp(GET_BODY "$dir$doc"),
+ super_chomp(GET_BODY "$dir$doc"),
"XBitHack full [0444]"
);
chmod 0544, "htdocs/$dir$doc";
ok t_cmp("No Last-modified date ; <BODY> inc-two.shtml body </BODY>",
- &check_xbithack(GET "$dir$doc"),
+ check_xbithack(GET "$dir$doc"),
"XBitHack full [0544]"
);
chmod 0554, "htdocs/$dir$doc";
ok t_cmp("Has Last-modified date ; <BODY> inc-two.shtml body </BODY>",
- &check_xbithack(GET "$dir$doc"),
+ check_xbithack(GET "$dir$doc"),
"XBitHack full [0554]"
);
@@ -128,7 +154,7 @@
sub check_xbithack {
my ($resp) = shift;
- my ($body) = &super_chomp($resp->content);
+ my ($body) = super_chomp($resp->content);
my ($lastmod) = ($resp->last_modified)
? "Has Last-modified date" : "No Last-modified date";
"$lastmod ; $body";