mod_deflate.t

2002-10-08 Thread john sachs
so i just committed a small change to apache/contentlength.t.
the modules/deflate.t test suffers from the same problem: assuming echo_post 
module is built.

so if you:
perl Makefile.PL -httpd /path/to/your/httpd

these test fail, because echo_post only gets built if you specify apxs.

i have an alternate suggestion for deflate.t.
it requires Compress::Zlib so i thought i should see what everybody thinks 
before just committing away.

basically, you either require apxs and echo_post
or Compress::Zlib to run the test.

anyway, check out the patch, let me know what you think.
-j
Index: deflate.t
===
RCS file: /home/cvspublic/httpd-test/perl-framework/t/modules/deflate.t,v
retrieving revision 1.2
diff -r1.2 deflate.t
18c18,19
 plan tests = $tests, have_module 'deflate';
---
 plan tests = $tests, [qw(deflate Compress::Zlib)];
 require Compress::Zlib;
33,34c34
 my $inflated_str = POST_BODY($server_inflate_uri, @inflate_headers,
  content = $deflated_str);
---
 my $inflated_str = Compress::Zlib::memGunzip($deflated_str);



Re: Perl framework 'server exited' on AIX

2002-01-25 Thread john sachs
same thing happens on HPUX.  dunno what the deal is.  i just 't/TEST -run' 
after that and go on testing...

On Fri, Jan 25, 2002 at 04:19:45PM -0500, Rodent of Unusual Size wrote:
+ When trying to run vanilla 't/TEST' on AIX, with httpd-2.0 HEAD,
+ I'm getting a
+ 
+ waiting for server to start: 00:00
+ server has died with status 255 (please examine t/logs/error_log)
+ 
+ Checking the logfile, and the running system, reveals this to
+ be a canard.  The server *is* started.  I can't even get it
+ to return a non-zero exit status with a real startup failure
+ and -DONE_PROCESS -DNO_DETACH, so I don't know where the 255
+ is coming from..
+ 
+ Any thoughts?  Is there a switch I can pass to t/TEST, or
+ 'perl t-TEST', that's the equivalent of bash's -xv?
+ -- 
+ #ken  P-)}
+ 
+ Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
+ Author, developer, opinionist  http://Apache-Server.Com/
+ 
+ Millenium hand and shrimp!


Re: Testing remote server

2001-12-04 Thread john sachs
as was mentioned earlier, some test write to the server root, perhaps we could 
add a special directive so you could do something like this in your plan line:

plan tests = 5, have_module 'foo'  have_local_server_root

where 'have_local_server_root' could be named whatever we think appropriate and 
is set to 1 unless -servername is specified on the command line.

then tests that require access to server root could be skipped when you are 
testing on a remote host.

whatchooguysthink?
-j

On Tue, Dec 04, 2001 at 02:50:07PM -0500, Rodent of Unusual Size wrote:
+ Doug MacEachern wrote:
+  
+   Not without some trickery: loads of the scripts rely on being able to
+   write directly to the server root.
+  
+  we should fix that.  the original plan was for this to work:
+  % t/TEST -run -port 8080 -servername foo
+  
+  and have the .t's hit http://foo:8080
+ 
+ Was 'foo' supposed to be a vhost on the current system, or
+ was it supposed to be able to be a remote system?  The
+ latter is my goal (testing things like DAV on Win32 bites
+ the Harry Houdini..).
+ -- 
+ #ken  P-)}
+ 
+ Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
+ Author, developer, opinionist  http://Apache-Server.Com/
+ 
+ All right everyone!  Step away from the glowing hamburger!


[franklin_tech_bulletins@yahoo.com: IBM AS/400 HTTP Server '/' attack]

2001-11-08 Thread john sachs
hey.
after this was reported, i knew apache was not affected, but i thought id write
a quick test to add to the suite just to make sure it never got introduced.
anyway, in doing so, i noticed that 1.3 serves the page as you'd expect.  in
2.0, you get 404.  which is correct?  i kinda think 404 is correct.  if i add
a test to check for 404, this test will fail on 1.3.  what you guys think?
or is this problem so lame it will never show up in apache and we dont even need
to test for it?
-j

---BeginMessage---
  IBM's HTTP Server on the AS/400 platform is vulnerable to an attack
that will show the source code of the page -- such as an .html or .jsp
page -- by attaching an '/' to the end of a URL.
Compare these two URL's:
http://www.foo.com/getsource.jsp
http://www.foo.com/getsource.jsp/
The later URL will deliver the jsp source to the browser.
I reported this problem to IBM approximately 9 or 10 months ago.
I was told it was a bug but not a security vulnerability. When I
explained that Microsoft had a similar bug (asp dot bug) they told me
that they did not share the same source code base. I replied to this
ludicrous reply: Isn't it possible that since you developed servers
that function in a similar manner you have the same logical bug? To
this they were speechless. I imagine that a .jsp page could contain user 
names and passwords if they are accessing databases, especially if these 
databases are on the network.

By the way, the IBM HTTP server was derived from an early version of
Apache. I have not seen Apache servers vulnerable to this bug.
Since I reported this non-security bug so long ago I hope it is fixed
through the regular set of changes. I cannot confirm this bug was fixed.
As far as I know this vulnerability was not yet reported to the public.
'ken'

---End Message---


Re: cvs commit: httpd-test/perl-framework/t/apache 404.t

2001-10-22 Thread john sachs
On Mon, Oct 22, 2001 at 05:16:09PM -, [EMAIL PROTECTED] wrote:
+   -ok ($four_oh_four =~ /HTTP\/1\.[01] 404 Not Found/);
+   +ok (($four_oh_four =~ /HTTP\/1\.[01] Not Found/)
+   +|| ($four_oh_four =~ /RC:\s+404.*Message:\s+Not Found/s));
+ok ($four_oh_four =~ /Content-Type: text\/html/);

why did you take the '404' out of /HTTP\/1\.[01] 404 Not Found/?
now it fails for me.  did you mean to do that?
-j


Re: t/modules/expires.t .. expected?

2001-10-16 Thread john sachs
hi,

On Tue, Oct 16, 2001 at 05:46:25PM -0400, Rodent of Unusual Size wrote:

+ expires_test() fails at the end if $actual != $expected.  So
+ I don't quite get how the first if-block sets expected
+ correctly:
+ 
+ my $expected = '';
+ my $exp_type = '';
+ if ($exp_conf =~ /^([A|M])(\d+)$/) {
+ $exp_type = $1;
+ $expected = $2;
+ } else {
+ print STDERR \n\ndoom: $exp_conf\n\n;
+ return 0;
+ }
+ 
+ my $actual = 0;
+ if ($exp_type eq 'M') {
+ $actual = $headers{expires} - $headers{modified};
+ } elsif ($exp_type eq 'A') {
+ $actual = $headers{expires} - $headers{access};
+ }
+ 
+ print debug: expected: $expected\n;
+ print debug: actual  : $actual\n;
+ return ($actual == $expected);
+ 
+ I would think it would need to include
+ 
+ if ($exp_type eq 'A') {
+ $expected += $headers{access};
+ } else {
+ $expected += $headers{modified};
+ }

why?
expected is being set to whatever is in the config.
so if the config is A120, expected is 120 seconds.  so the difference between 
the acce3ss header and the expires header should be 120 seconds.

 } elsif ($exp_type eq 'A') {
 $actual = $headers{expires} - $headers{access};

at that point $actual should be 120 if everything went smoothly.  your expected 
is already set to 120 from

 if ($exp_conf =~ /^([A|M])(\d+)$/) {
 $exp_type = $1;
 $expected = $2;

if you did

 if ($exp_type eq 'A') {
 $expected += $headers{access};

$expected would be some wacky number (120 + whatever the access time was).
so i dont see how those three tests pass with that code added...

run t/TEST -v t/modules/expires.t
and paste the relevant debug output into a mail and i'll take a look...

-j


Re: httpd-test failures...

2001-09-29 Thread john sachs
On Fri, Sep 28, 2001 at 03:36:00PM -0700, Justin Erenkrantz wrote:
+ I have no clue what happened, but HEAD is failing most of the module
+ tests in httpd-test.  I have no diffs in my tree, and I am updated to 
+ the latest, and this is a fresh build (make clean  make all).
+ 
+ I'm trying to confirm my input filtering patch and include test #17
+ is failing with my changes - which looks to be inc-rfile.shtml.  The 
+ following test log is from a machine *without* my input filtering 
+ updates - it fails even worse.
+ 
+ My feeling is that this is related to one of wrowe's changes.  I'll 
+ try to dig around later tonight, but no promises.  I have class for 
+ the next few hours...
+ 
+ Can anyone else reproduce this?  -- justin

i am seeing the exact same thing.
dav tests are failing too, for what its worth.


Re: [Fwd: FAILURE httpd-2.0 automated test log]

2001-09-12 Thread john sachs
i just had cron run the cgi test and it passed for me.

On Wed, Sep 12, 2001 at 03:33:57PM +0100, Gary Benson wrote:
+ 
+ On Sat, 8 Sep 2001, Doug MacEachern wrote:
+ 
+  On 6 Sep 2001, Ian Holsman wrote:
+ 
+   1. running modules/cgi from a cron job fails on certain tests.
+ 
+  haven't looked into that, could be a permissions problem?
+ 
+ or a problem with the fact that cron runs stuff with a very limited
+ environment. Try running /bin/sh -c set  /tmp/env from a cron job...
+ 


Re: Is there a way to disable the ANSI?

2001-08-31 Thread john sachs
if you have the fix, just send along the patch and i can commit for you.
wait...did you already do that once?
-j

On Thu, Aug 30, 2001 at 11:55:26PM +0100, Gary Benson wrote:
+ 
+ On Thu, 30 Aug 2001, Ian Holsman wrote:
+ 
+  I'm trying to get a nightly test going,
+  (nearly done)
+ 
+ If you are running it from cron then the mod_env tests will fail. Don't
+ worry; when my commit access works I'll commit a fix...
+ 
+ Gary
+ 
+ [ Gary Benson, Red Hat Europe ][ [EMAIL PROTECTED] ][ GnuPG 60E8793A ]
+ 


Re: File::Tail

2001-08-30 Thread john sachs
i have no problem with this.
i also thought about the false passes for that test, but have been too busy 
with other test modules to think much about how to fix it.
-j

On Thu, Aug 30, 2001 at 05:07:02PM +0100, Gary Benson wrote:
+ 
+ Hi all,
+ 
+ I've got three problems which I could resolve easily if I were able to
+ call on the File::Tail package (which tails files would you believe). These
+ being:
+ 
+  * php/func5.t fails if the log entry doesn't get written straight
+to the disk
+  * php/func5.t will pass on the first foo() has been called message, so
+we could have false passes.
+  * TestServer::start sometimes fails on slow machines
+ 
+ What I want to know is if anyone has a problem with me using this package,
+ and whether or not we could add it to the httpd-test-bundle.
+ 
+ Comments?
+ Gary
+ 
+ [ Gary Benson, Red Hat Europe ][ [EMAIL PROTECTED] ][ GnuPG 60E8793A ]
+ 


Re: Configuration collision

2001-08-28 Thread john sachs
weird.
this is only happening on 1.3.  it works on 2.0.  i ran into it just before i 
got to this mail... i think 2.0 has it correct..  but that is bad config, 
probably...i spose i will change it.
-j

On Tue, Aug 28, 2001 at 04:36:49PM +0100, Gary Benson wrote:
+ 
+ Hi,
+ 
+ I've found a clash between the tests modules/vhost_alias and modules/alias
+ which is causing vhost_alias tests to fail. I'm not at all sure whether it
+ should be failing or not, but this is my take on what is happening:
+ 
+ For example, look at this excerpt from t/TEST -v modules/vhost_alias:
+ 
+ | [VirtualScriptAlias test]
+ | expected: -test cgi for www.vha-test.com-
+ | actual: -!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
+ | HTMLHEAD
+ | TITLE404 Not Found/TITLE
+ | /HEADBODY
+ | H1Not Found/H1
+ | The requested URL /cgi-bin/test-cgi.sh was not found on this server.P
+ | /BODY/HTML-
+ | not ok 2
+ 
+ This _should_ have executed
+ @SERVERROOT@/modules/vhost_alias/www.vha-test.com/test-cgi.sh,
+ but looking in the error_log, we find this:
+ 
+ | [Tue Aug 28 16:12:33 2001] [error] [client 127.0.0.1]   \
+ | script not found or unable to stat: \
+ | /home/gary/work/httpd-test/perl-framework/t/htdocs/modules/alias/bin
+ 
+ In t/conf/extra.conf.in, mod_alias section, we have this line:
+ 
+ | ScriptAliasMatch /cgi-(.*) @SERVERROOT@/htdocs/modules/alias/$1
+ 
+ which has intercepted the call.
+ 
+ Is this just failing because I'm using Apache 1.3, or does it fail
+ on httpd-2.0 as well? Any suggestions as to what to do about it?
+ 
+ Cheers,
+ Gary
+ 
+ [ Gary Benson, Red Hat Europe ][ [EMAIL PROTECTED] ][ GnuPG 60E8793A ]
+ 


Re: t/modules/rewrite tweaking

2001-08-07 Thread john sachs
it is a range.

On Tue, Aug 07, 2001 at 02:13:35PM +0800, Stas Bekman wrote:
+ perl t/TEST httpd /home/stas/httpd-2.0/bin/httpd -run t/modules/rewrite.t
+ modules/rewrite.NOK 6Invalid [] range -6 before HERE mark in regex
+ m/^[!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
+ htmlhead
+ title404 Not Found/title
+ /headbody
+ h1Not Found/h1
+ pThe requested URL /modules/rewrite/1 was not found on this server./p
+ /body/html-6  HERE ]$/
+ modules/rewrite.dubious
+   Test returned status 9 (wstat 2304, 0x900)
+ DIED. FAILED tests 1-27
+   Failed 27/27 tests, 0.00% okay
+ Failed Test   Stat Wstat Total Fail  Failed  List of Failed
+ 
---
+ modules/rewrite.t9  230427   27 100.00%  1-27
+ error running tests (please examine t/logs/error_log)
+ Failed 1/1 test scripts, 0.00% okay. 27/27 subtests failed, 0.00% okay.
+ 
+ the problem is in Invalid [] range -6 before HERE mark in regex at
+ least that's what I see with perl   5.6.1.
+ 
+ If - is not a range (which apparently it's not), you should escape it:
+ 
+ Index: t/modules/rewrite.t
+ ===
+ RCS file: /home/cvs/httpd-test/perl-framework/t/modules/rewrite.t,v
+ retrieving revision 1.1
+ diff -u -r1.1 rewrite.t
+ --- t/modules/rewrite.t   2001/08/02 16:38:19 1.1
+ +++ t/modules/rewrite.t   2001/08/07 05:54:43
+ @@ -25,7 +25,7 @@
+   chomp $r;
+ 
+   if ($_ eq 'RND') {
+ - ok ($r =~ /^[$r-6]$/);
+ + ok ($r =~ /^[$r\-6]$/);
+   } else {
+   ok ($r eq $n);
+   }
+ 
+ Also I've applied the 4 chars indent convention that we use (let me know
+ if you don't care, so here is a complete patch:
+ 
+ Index: t/modules/rewrite.t
+ ===
+ RCS file: /home/cvs/httpd-test/perl-framework/t/modules/rewrite.t,v
+ retrieving revision 1.1
+ diff -u -r1.1 rewrite.t
+ --- t/modules/rewrite.t   2001/08/02 16:38:19 1.1
+ +++ t/modules/rewrite.t   2001/08/07 05:51:15
+ @@ -16,20 +16,20 @@
+  plan tests = @map * @num + 3;
+ 
+  foreach (@map) {
+ - foreach my $n (@num) {
+ - ## throw $_ into upper case just so we can test out internal
+ - ## 'tolower' map in mod_rewrite
+ - $_=uc($_);
+ +foreach my $n (@num) {
+ +## throw $_ into upper case just so we can test out internal
+ +## 'tolower' map in mod_rewrite
+ +$_ = uc($_);
+ 
+ - $r = GET_BODY /modules/rewrite/$n, 'Accept' = $_;
+ - chomp $r;
+ +$r = GET_BODY /modules/rewrite/$n, 'Accept' = $_;
+ +chomp $r;
+ 
+ - if ($_ eq 'RND') {
+ - ok ($r =~ /^[$r-6]$/);
+ - } else {
+ - ok ($r eq $n);
+ - }
+ - }
+ +if ($_ eq 'RND') {
+ +ok ($r =~ /^[$r\-6]$/);
+ +} else {
+ +ok ($r eq $n);
+ +}
+ +}
+  }
+ 
+  $r = GET_BODY /modules/rewrite/, 'Accept' = 7;
+ 
+ 
+ 
+ note that all sub-tests in this test file are failing for me, with the
+ latest apache built as:
+ 
+ make distclean
+ ./buildconf
+ ./configure --prefix=$HOME/httpd-2.0 \
+--with-mpm=threaded --enable-so \
+--enable-rewrite=shared
+ make  make install
+ 
+ [Tue Aug 07 14:09:00 2001] [error] [client 127.0.0.1] File does not exist:
+ /home/stas/apache.org/httpd-test/perl-framework/t/htdocs/modules/rewrite/6
+ [Tue Aug 07 14:09:01 2001] [error] [client 127.0.0.1] Directory index
+ forbidden by rule:
+ /home/stas/apache.org/httpd-test/perl-framework/t/htdocs/modules/rewrite/
+ 
+ another important IMHO note is to test whether the feature under test is
+ enabled and perform the skip operation if not, rather then report failure.
+ In addition during the skip, you can print a note, how to add the missing
+ feature.
+ 
+ _
+ Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
+ http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
+ mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
+ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
+ 
+ 
+ 
+ 


Re: t/modules/rewrite tweaking

2001-08-07 Thread john sachs
hi,
first let me explain the test a little.
in this section of code, i am testing the 'rnd' rewriting functionality which 
takes a text file like this:

1 one|two|three|four|five|six
2 two|three|four|five|six

and rewrites the key randomly to one of the possibilities you've given it.  in 
the test, the expected outcome is something between the number you're 
requesting and 6 which is max.  therefore the code:

ok ($r =~ /^[$r-6]$/);

the problem is i didnt take into account the condition you've run into where $r 
is a chunk of text with special characters in it.  i will have to somehow check 
for this case before i go blindly dumping it into the regexp.

as a side note, i think you're getting this error because your particular build 
of apache does not contain mod_rewrite.  very soon, the test will tell you its 
not going to run on your platform...heh.  i plan to talk to doug about this 
today.
-j
On Wed, Aug 08, 2001 at 12:46:54AM +0800, Stas Bekman wrote:
+ On Tue, 7 Aug 2001, john sachs wrote:
+ 
+  it is a range.
+ 
+ so according to the error:
+ 
+ Invalid [] range -6 before HERE mark in regex
+ 
+ what kind of range -6 is?
+ 
+ 
+  On Tue, Aug 07, 2001 at 02:13:35PM +0800, Stas Bekman wrote:
+  + perl t/TEST httpd /home/stas/httpd-2.0/bin/httpd -run t/modules/rewrite.t
+  + modules/rewrite.NOK 6Invalid [] range -6 before HERE mark in regex
+  + m/^[!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
+  + htmlhead
+  + title404 Not Found/title
+  + /headbody
+  + h1Not Found/h1
+  + pThe requested URL /modules/rewrite/1 was not found on this server./p
+  + /body/html-6  HERE ]$/
+  + modules/rewrite.dubious
+  +   Test returned status 9 (wstat 2304, 0x900)
+  + DIED. FAILED tests 1-27
+  +   Failed 27/27 tests, 0.00% okay
+  + Failed Test   Stat Wstat Total Fail  Failed  List of Failed
+  + 
---
+  + modules/rewrite.t9  230427   27 100.00%  1-27
+  + error running tests (please examine t/logs/error_log)
+  + Failed 1/1 test scripts, 0.00% okay. 27/27 subtests failed, 0.00% okay.
+  +
+  + the problem is in Invalid [] range -6 before HERE mark in regex at
+  + least that's what I see with perl   5.6.1.
+  +
+  + If - is not a range (which apparently it's not), you should escape it:
+  +
+  + Index: t/modules/rewrite.t
+  + ===
+  + RCS file: /home/cvs/httpd-test/perl-framework/t/modules/rewrite.t,v
+  + retrieving revision 1.1
+  + diff -u -r1.1 rewrite.t
+  + --- t/modules/rewrite.t   2001/08/02 16:38:19 1.1
+  + +++ t/modules/rewrite.t   2001/08/07 05:54:43
+  + @@ -25,7 +25,7 @@
+  +   chomp $r;
+  +
+  +   if ($_ eq 'RND') {
+  + - ok ($r =~ /^[$r-6]$/);
+  + + ok ($r =~ /^[$r\-6]$/);
+  +   } else {
+  +   ok ($r eq $n);
+  +   }
+  +
+  + Also I've applied the 4 chars indent convention that we use (let me know
+  + if you don't care, so here is a complete patch:
+  +
+  + Index: t/modules/rewrite.t
+  + ===
+  + RCS file: /home/cvs/httpd-test/perl-framework/t/modules/rewrite.t,v
+  + retrieving revision 1.1
+  + diff -u -r1.1 rewrite.t
+  + --- t/modules/rewrite.t   2001/08/02 16:38:19 1.1
+  + +++ t/modules/rewrite.t   2001/08/07 05:51:15
+  + @@ -16,20 +16,20 @@
+  +  plan tests = @map * @num + 3;
+  +
+  +  foreach (@map) {
+  + - foreach my $n (@num) {
+  + - ## throw $_ into upper case just so we can test out internal
+  + - ## 'tolower' map in mod_rewrite
+  + - $_=uc($_);
+  + +foreach my $n (@num) {
+  + +## throw $_ into upper case just so we can test out internal
+  + +## 'tolower' map in mod_rewrite
+  + +$_ = uc($_);
+  +
+  + - $r = GET_BODY /modules/rewrite/$n, 'Accept' = $_;
+  + - chomp $r;
+  + +$r = GET_BODY /modules/rewrite/$n, 'Accept' = $_;
+  + +chomp $r;
+  +
+  + - if ($_ eq 'RND') {
+  + - ok ($r =~ /^[$r-6]$/);
+  + - } else {
+  + - ok ($r eq $n);
+  + - }
+  + - }
+  + +if ($_ eq 'RND') {
+  + +ok ($r =~ /^[$r\-6]$/);
+  + +} else {
+  + +ok ($r eq $n);
+  + +}
+  + +}
+  +  }
+  +
+  +  $r = GET_BODY /modules/rewrite/, 'Accept' = 7;
+  +
+  +
+  +
+  + note that all sub-tests in this test file are failing for me, with the
+  + latest apache built as:
+  +
+  + make distclean
+  + ./buildconf
+  + ./configure --prefix=$HOME/httpd-2.0 \
+  +--with-mpm=threaded --enable-so \
+  +--enable-rewrite=shared
+  + make  make install
+  +
+  + [Tue Aug 07 14:09:00 2001] [error] [client 127.0.0.1] File does not exist:
+  + /home/stas/apache.org/httpd-test/perl-framework/t/htdocs/modules/rewrite/6
+  + [Tue Aug 07 14:09:01 2001] [error] [client 127.0.0.1] Directory index