Improves this test to be more strict on the filter action test. Now it
authorandre <andre@openbsd.org>
Fri, 2 May 2014 14:13:41 +0000 (14:13 +0000)
committerandre <andre@openbsd.org>
Fri, 2 May 2014 14:13:41 +0000 (14:13 +0000)
dispatches 4 requests from the client and checks if the server receives only 3.
Previous functionality kept.

ok reyk

regress/usr.sbin/relayd/args-http-filter-block.pl

index 56b8556..10c6d43 100644 (file)
@@ -3,26 +3,22 @@
 use strict;
 use warnings;
 
+my @lengths = (1, 2, 0, 3);
 our %args = (
     client => {
-       func => sub {
-           eval { http_client(@_) };
-           warn $@;
-           $@ =~ /missing http 1 response/
-               or die "http not filtered";
-       },
-       len => 1,
-       nocheck => 1,
+       func => sub { eval { http_client(@_) }; warn $@ },
+       loggrep => qr/Client missing http 3 response/,
+       lengths => \@lengths,
     },
     relayd => {
        protocol => [ "http",
-           'request path filter "/1"',
+           'request path filter "/3"',
        ],
        loggrep => qr/rejecting request/,
     },
     server => {
-       noserver => 1,
-       nocheck => 1,
+       func => \&http_server,
+       lengths => (1, 2, 0),
     },
 );