httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-test/perl-framework/t/modules access.t
Date Sat, 20 Oct 2001 02:10:51 GMT
dougm       01/10/19 19:10:51

  Modified:    perl-framework/t/modules access.t
  Log:
  fix test under win32 by removing assumptions that REMOTE_ADDR eq 127.0.0.1
  
  Revision  Changes    Path
  1.7       +15 -10    httpd-test/perl-framework/t/modules/access.t
  
  Index: access.t
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/t/modules/access.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- access.t	2001/09/18 15:41:03	1.6
  +++ access.t	2001/10/20 02:10:51	1.7
  @@ -10,13 +10,18 @@
   
   my $vars = Apache::Test::vars();
   my $localhost_name = $vars->{servername};
  +my $remote_addr = $vars->{remote_addr};
  +my(@addr) = split /\./, $remote_addr;
  +my $addr1 = $addr[0];
  +my $addr2 = join '.', $addr[0], $addr[1];
  +
   my @localhost = (
       'from all',
       "from $localhost_name",
  -    'from 127.0.0.1',
  -    'from 127.0',
  -    'from 127.0.0.1/255.255.0.0',
  -    'from 127.0.0.1/16',
  +    "from $remote_addr",
  +    "from $addr2",
  +    "from $remote_addr/255.255.0.0",
  +    "from $remote_addr/16",
       'from somewhere.else.com',
       'from 10.0.0.1'
   );
  @@ -58,7 +63,7 @@
   
               ## denying by default
   
  -            if ($allow =~ /^from 127/
  +            if ($allow =~ /^from $addr1/
                   || $allow eq "from $localhost_name"
                   || $allow eq 'from all') {
   
  @@ -85,7 +90,7 @@
   
                   ## allowing by default
   
  -                if ($deny =~ /^from 127/
  +                if ($deny =~ /^from $addr1/
                       || $deny eq "from $localhost_name"
                       || $deny eq 'from all') {
   
  @@ -120,7 +125,7 @@
   
                   ## allowing by default
   
  -                if ($allow =~ /^from 127/
  +                if ($allow =~ /^from $addr1/
                       || $allow eq "from $localhost_name"
                       || $allow eq 'from all') {
   
  @@ -129,7 +134,7 @@
                       print "expecting access.\n";
                       ok GET_OK "/modules/access/htaccess/index.html";
   
  -                } elsif ($deny =~ /^from 127/
  +                } elsif ($deny =~ /^from $addr1/
                       || $deny eq "from $localhost_name"
                       || $deny eq 'from all') {
   
  @@ -152,7 +157,7 @@
   
                   ## denying by default
   
  -                if ($deny =~ /^from 127/
  +                if ($deny =~ /^from $addr1/
                       || $deny eq "from $localhost_name"
                       || $deny eq 'from all') {
   
  @@ -161,7 +166,7 @@
                       print "expecting access denial.\n";
                       ok !GET_OK "/modules/access/htaccess/index.html";
   
  -                } elsif ($allow =~ /^from 127/
  +                } elsif ($allow =~ /^from $addr1/
                       || $allow eq "from $localhost_name"
                       || $allow eq 'from all') {
   
  
  
  

Mime
View raw message