httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-test/perl-framework/t/modules include.t include2.t
Date Wed, 13 Aug 2003 01:28:47 GMT
nd          2003/08/12 18:28:47

  Modified:    perl-framework/t/conf extra.conf.in
               perl-framework/t/modules include.t
  Added:       perl-framework/t/conf include.conf.in
               perl-framework/t/htdocs/modules/include notreal.shtml
                        retagged1.shtml retagged2.shtml
               perl-framework/t/htdocs/modules/include/bucketeer
                        retagged3.shtml retagged4.shtml y10.shtml
  Removed:     perl-framework/t/modules include2.t
  Log:
  add more test cases for mod_include.
  compact all include tests in one file
  open extra port with name based VHs for mod_include, which allows to test
  different SSI(Start|End)Tags by just supplying another host header.
  
  Revision  Changes    Path
  1.43      +0 -43     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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- extra.conf.in	10 Sep 2002 06:46:41 -0000	1.42
  +++ extra.conf.in	13 Aug 2003 01:28:47 -0000	1.43
  @@ -164,49 +164,6 @@
   </IfModule>
   
   ##
  -## mod_include test config
  -##
  -
  -<IfModule mod_include.c>
  -
  -    AddType text/html .shtml
  -
  -    <IfDefine APACHE1>
  -        AddHandler server-parsed .shtml
  -    </IfDefine>
  -    <IfDefine APACHE2>
  -        AddOutputFilter INCLUDES .shtml
  -    </IfDefine>
  -
  -    <Directory @SERVERROOT@/htdocs/modules/include>
  -        Options +IncludesNOEXEC
  -    </Directory>
  -
  -    <Directory @SERVERROOT@/htdocs/modules/include/xbithack/on>
  -        Options +IncludesNOEXEC
  -        XBitHack on
  -    </Directory>
  -
  -    <Directory @SERVERROOT@/htdocs/modules/include/xbithack/full>
  -        Options +IncludesNOEXEC
  -        XBitHack full
  -    </Directory>
  -
  -    <Directory @SERVERROOT@/htdocs/modules/include/exec/on>
  -        Options Includes
  -    </Directory>
  -
  -    <IfDefine APACHE2>
  -    <IfModule mod_bucketeer.c>
  -        <Directory @SERVERROOT@/htdocs/modules/include/bucketeer>
  -            SetOutputFilter BUCKETEER
  -        </Directory>
  -    </IfModule>
  -    </IfDefine>
  -
  -</IfModule>
  -
  -##
   ## @ACCESS_MODULE@ test config
   ##
   
  
  
  
  1.1                  httpd-test/perl-framework/t/conf/include.conf.in
  
  Index: include.conf.in
  ===================================================================
  ##
  ## mod_include test config
  ##
  
  <IfModule mod_include.c>
  
      AddType text/html .shtml
  
      <IfDefine APACHE1>
          AddHandler server-parsed .shtml
      </IfDefine>
      <IfDefine APACHE2>
          AddOutputFilter INCLUDES .shtml
      </IfDefine>
  
      <Directory @SERVERROOT@/htdocs/modules/include>
          Options +IncludesNOEXEC
      </Directory>
  
      <Directory @SERVERROOT@/htdocs/modules/include/xbithack/on>
          Options +IncludesNOEXEC
          XBitHack on
      </Directory>
  
      <Directory @SERVERROOT@/htdocs/modules/include/xbithack/full>
          Options +IncludesNOEXEC
          XBitHack full
      </Directory>
  
      <Directory @SERVERROOT@/htdocs/modules/include/exec/on>
          Options Includes
      </Directory>
  
      <IfDefine APACHE2>
      <IfModule mod_bucketeer.c>
          <Directory @SERVERROOT@/htdocs/modules/include/bucketeer>
              SetOutputFilter BUCKETEER
          </Directory>
      </IfModule>
      </IfDefine>
  
      <VirtualHost ssi-default:mod_include>
          # fallback host
      </VirtualHost>
      
      <IfDefine APACHE2>
      <VirtualHost retagged1:mod_include>
          SSIStartTag --->
          SSIEndTag   --->
      </VirtualHost>
  
      <VirtualHost retagged2:mod_include>
          SSIStartTag --->
          SSIEndTag   printenw
      </VirtualHost>
      </IfDefine>
  
  </IfModule>
  
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/include/notreal.shtml
  
  Index: notreal.shtml
  ===================================================================
  pass <!--
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/include/retagged1.shtml
  
  Index: retagged1.shtml
  ===================================================================
  --->echo var="DOCUMENT_NAME" --->
  
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/include/retagged2.shtml
  
  Index: retagged2.shtml
  ===================================================================
  ------->echo var="DOCUMENT_NAME" --->
  
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/retagged3.shtml
  
  	<<Binary file>>
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/retagged4.shtml
  
  	<<Binary file>>
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/include/bucketeer/y10.shtml
  
  Index: y10.shtml
  ===================================================================
  <!--#set var="pass" value="\"pass\"" --><!--#echo var="pass"-->
  
  
  
  1.33      +71 -6     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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- include.t	12 Aug 2003 13:08:32 -0000	1.32
  +++ include.t	13 Aug 2003 01:28:47 -0000	1.33
  @@ -8,7 +8,7 @@
   use constant WINFU => Apache::TestConfig::WINFU;
   
   ## mod_include tests
  -my ($doc);
  +my($res, $str, $doc);
   my $dir = "/modules/include/";
   my $have_apache_2 = have_apache 2;
   my $vars = Apache::Test::vars();
  @@ -57,7 +57,8 @@
       "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"
  +"exec/on/cmd.shtml"     =>    "pass",
  +"notreal.shtml"         =>    "pass <!--",
   );
   
   #this test does not work on win32 (<!--#exec cmd="echo pass"-->)
  @@ -78,13 +79,32 @@
       $test{"if10a.shtml"} = "pass";
   }
   
  +my %t_test = ();
  +if ($have_apache_2) {
  +    %t_test =
  +    (
  +        "echo.shtml"      => ['<!--#echo var="DOCUMENT_NAME" -->', "retagged1"],

  +        "retagged1.shtml" => ["retagged1.shtml",                   "retagged1"],
  +        "retagged2.shtml" => ["----retagged2.shtml",               "retagged1"],
  +    );
  +}
  +
  +my @patterns = (
  +    'mod_include test',
  +    'Hello World',
  +    'footer',
  +);
  +
   #
   # in addition to $tests, there are 1 GET test, 9 XBitHack tests,
  -# 2 exec cgi tests, 2 malformed-ssi-directive tests, and 11 tests
  +# 2 exec cgi tests, 2 malformed-ssi-directive tests, and 14 tests
   # that use mod_bucketeer to construct brigades for mod_include
   #
  -my $tests = keys %test;
  -plan tests => $tests + 25, have_module 'include';
  +my $tests = scalar(keys %test) + scalar(keys %t_test) + @patterns + 2;
  +plan tests => $tests + 28, have_module 'include';
  +
  +Apache::TestRequest::scheme('http'); #ssl not listening on this vhost
  +Apache::TestRequest::module('mod_include'); #use this module's port
   
   foreach $doc (sort keys %test) {
       ok t_cmp($test{$doc},
  @@ -199,6 +219,28 @@
            "XBitHack full [0554]"
           );
   
  +### test include + query string
  +$res = GET "${dir}virtual.shtml";
  +
  +ok $res->is_success;
  +
  +$str = $res->content;
  +
  +ok $str;
  +
  +for my $pat (@patterns) {
  +    ok t_cmp(qr{$pat}, $str, "/$pat/");
  +}
  +
  +### Simple tests for SSI(Start|End)Tags that differ from default
  +if ($have_apache_2) {
  +    for (sort keys %t_test) {
  +        ok t_cmp($t_test{$_}[0],
  +                 super_chomp(GET_BODY "$dir$_", Host => $t_test{$_}[1]),
  +                 "GET $dir$_"
  +                );
  +    }
  +}
   
   ### MOD_BUCKETEER+MOD_INCLUDE TESTS
   # we can use mod_bucketeer to create edge conditions for mod_include, since
  @@ -293,9 +335,32 @@
                super_chomp(GET_BODY "$dir$doc"),
                "GET $dir$doc"
               );
  +
  +    $expected= "\"pass\"";
  +    $doc = "bucketeer/y10.shtml";
  +    ok t_cmp($expected,
  +             super_chomp(GET_BODY "$dir$doc"),
  +             "GET $dir$doc"
  +            );
  +
  +    ### exotic SSI(Start|End)Tags
  +
  +    $expected= "----retagged3.shtml";
  +    $doc = "bucketeer/retagged3.shtml";
  +    ok t_cmp($expected,
  +             super_chomp(GET_BODY "$dir$doc", Host => 'retagged1'),
  +             "GET $dir$doc"
  +            );
  +
  +    $expected= "---pass";
  +    $doc = "bucketeer/retagged4.shtml";
  +    ok t_cmp($expected,
  +             super_chomp(GET_BODY "$dir$doc", Host => 'retagged2'),
  +             "GET $dir$doc"
  +            );
   }
   else {
  -    for (1..11) {
  +    for (1..14) {
           skip "Skipping bucket boundary tests, no mod_bucketeer", 1;
       }
   }
  
  
  

Mime
View raw message