httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: httpd-test/perl-framework/t/modules deflate.t
Date Wed, 05 Jun 2002 07:42:26 GMT
jerenkrantz    2002/06/05 00:42:26

  Modified:    perl-framework/t/conf extra.conf.in
  Added:       perl-framework/t/htdocs/modules/deflate apache_pb.gif
                        index.html
               perl-framework/t/modules deflate.t
  Log:
  Add test for mod_deflate.
  
  Uses three requests (has two URIs - a text file and a GIF):
  1) GET /modules/deflate/ (no Accept-Encoding)
  2) GET /modules/deflate/ (Accept-Encoding)
  3) POST /modules/deflate/echo_post with content of #2's response.
  
  If deflate is working, #3 response body should be the same as #1 response body.
  
  Revision  Changes    Path
  1.41      +16 -0     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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- extra.conf.in	2 Jun 2002 21:17:51 -0000	1.40
  +++ extra.conf.in	5 Jun 2002 07:42:25 -0000	1.41
  @@ -390,3 +390,19 @@
           </VirtualHost>
       </IfModule>
   </IfModule>
  +
  +##
  +## mod_deflate test config
  +## 
  +<IfDefine APACHE2>
  +    <IfModule mod_deflate.c>
  +        <Directory @SERVERROOT@/htdocs/modules/deflate>
  +            SetOutputFilter DEFLATE
  +        </Directory> 
  +
  +        <Location /modules/deflate/echo_post>
  +            SetInputFilter DEFLATE
  +            SetHandler echo_post
  +        </Location>
  +    </IfModule>
  +</IfDefine>
  
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/deflate/apache_pb.gif
  
  	<<Binary file>>
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/deflate/index.html
  
  Index: index.html
  ===================================================================
  welcome to the glorious world of mod_deflate!
  
  
  
  1.1                  httpd-test/perl-framework/t/modules/deflate.t
  
  Index: deflate.t
  ===================================================================
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  my @server_deflate_uris=("/modules/deflate/index.html",
                           "/modules/deflate/apache_pb.gif");
  my $server_inflate_uri="/modules/deflate/echo_post";
  
  my $tests = @server_deflate_uris;
  my $vars = Apache::Test::vars();
  my $module = 'default';
  
  plan tests => $tests, have_module 'deflate';
  
  print "testing $module\n";
  
  my @deflate_headers;
  push @deflate_headers, "Accept-Encoding" => "gzip";
  
  my @inflate_headers;
  push @inflate_headers, "Content-Encoding" => "gzip";
  
  for my $server_deflate_uri (@server_deflate_uris) {
      my $original_str = GET_BODY($server_deflate_uri);
  
      my $deflated_str = GET_BODY($server_deflate_uri, @deflate_headers);
  
      my $inflated_str = POST_BODY($server_inflate_uri, @inflate_headers,
                                   content => $deflated_str);
  
      ok $original_str eq $inflated_str;
  }
  
  
  

Mime
View raw message