mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-14 21:30:02 -04:00
Replace the statschannel truncated tests with two new tests
Now that the artificial limit on the recv buffer has been removed, the
current system test always fails because it tests if the truncation has
happened.
Add test that sending more than 10 headers makes the connection to
closed; and add test that sending huge HTTP request makes the connection
to be closed.
(cherry picked from commit cad2706cce)
This commit is contained in:
parent
067502a16e
commit
da1e7a7ba2
3 changed files with 46 additions and 64 deletions
6
CHANGES
6
CHANGES
|
|
@ -2,9 +2,6 @@
|
|||
(reportedly > 510) CPUs. Thanks to Stacey Marshall from
|
||||
Oracle for deep investigation of the problem. [GL #3563]
|
||||
|
||||
5994. [func] Refactor the isc_httpd implementation used in the
|
||||
statistics channel. [GL !6879]
|
||||
|
||||
5999. [bug] rpz-ip rules could be ineffective in some scenarios
|
||||
with CD=1 queries. [GL #3247]
|
||||
|
||||
|
|
@ -20,6 +17,9 @@
|
|||
when printing the configuration using named-checkconf.
|
||||
[GL !6880]
|
||||
|
||||
5994. [func] Refactor the isc_httpd implementation used in the
|
||||
statistics channel. [GL !6879]
|
||||
|
||||
--- 9.18.8 released ---
|
||||
|
||||
5991. [protocol] Add support for parsing and validating "dohpath" to
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
#
|
||||
# Send a file to a given address and port using TCP. Used for
|
||||
# configuring the test server in ans.pl.
|
||||
#
|
||||
|
||||
use IO::File;
|
||||
use IO::Socket;
|
||||
|
||||
@ARGV == 2 or die "usage: send.pl host port\n";
|
||||
|
||||
my $host = shift @ARGV;
|
||||
my $port = shift @ARGV;
|
||||
|
||||
my $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port,
|
||||
Proto => "tcp",) or die "$!";
|
||||
#send the file
|
||||
while ($n = read(STDIN, $buf, 64000)) {
|
||||
$sock->syswrite($buf, $n);
|
||||
}
|
||||
|
||||
#get the response with with a 15 second timeout
|
||||
my $rin;
|
||||
my $rout;
|
||||
my $n;
|
||||
do {
|
||||
$rin = '';
|
||||
vec($rin, fileno($sock), 1) = 1;
|
||||
$n = select($rout = $rin, undef, undef, 15);
|
||||
$n = $sock->sysread($buf, 64000) if ($n > 0);
|
||||
print STDOUT $buf if ($n > 0);
|
||||
} while ($n > 0);
|
||||
|
||||
$sock->close;
|
||||
|
|
@ -399,8 +399,8 @@ Host: 10.53.0.3:${EXTRAPORT1}
|
|||
Connection: close
|
||||
|
||||
EOF
|
||||
lines=$(grep "^HTTP/1.1" nc.out$n | wc -l)
|
||||
test $lines = 2 || ret=1
|
||||
lines=$(grep -c "^HTTP/1.1" nc.out$n)
|
||||
test "$lines" = 2 || ret=1
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
n=$((n + 1))
|
||||
|
|
@ -426,8 +426,8 @@ Connection: close
|
|||
|
||||
{}
|
||||
EOF
|
||||
lines=$(grep "^HTTP/1.1" nc.out$n | wc -l)
|
||||
test $lines = 2 || ret=1
|
||||
lines=$(grep -c "^HTTP/1.1" nc.out$n)
|
||||
test "$lines" = 2 || ret=1
|
||||
else
|
||||
echo_i "skipping test as nc not found"
|
||||
fi
|
||||
|
|
@ -435,26 +435,54 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
|||
status=$((status + ret))
|
||||
n=$((n + 1))
|
||||
|
||||
echo_i "Check HTTP with more than 10 headers ($n)"
|
||||
ret=0
|
||||
i=0
|
||||
# build input stream.
|
||||
printf 'GET /xml/v3/status HTTP/1.1\r\nHost: 10.53.0.3\r\n\r\n' > send.in$n
|
||||
printf 'GET /xml/v3/status HTTP/1.1\r\nHost: 10.53.0.3\r\n' >> send.in$n
|
||||
|
||||
while test $i -lt 11
|
||||
do
|
||||
printf 'X-Bloat: VGhlIG1vc3QgY29tbW9uIHJlYXNvbiBmb3IgYmxvYXRpbmcgaXMgaGF2aW5nIGEgbG90IG9mIGdhcyBpbiB5b3VyIGd1dC4gCg==\r\n' >> send.in$n
|
||||
i=$((i+1))
|
||||
done
|
||||
printf '\r\n' >> send.in$n
|
||||
|
||||
# send the requests then wait for named to close the socket.
|
||||
time1=$($PERL -e 'print time(), "\n";')
|
||||
${NC} 10.53.0.3 ${EXTRAPORT1} < send.in$n > send.out$n
|
||||
time2=$($PERL -e 'print time(), "\n";')
|
||||
test $((time2 - time1)) -lt 5 || ret=1
|
||||
# we expect 1 request to be processed.
|
||||
lines=$(grep -c "^HTTP/1.1" send.out$n)
|
||||
test $lines = 1 || ret=1
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
n=$((n + 1))
|
||||
|
||||
echo_i "Check HTTP/1.1 pipelined with truncated stream ($n)"
|
||||
ret=0
|
||||
i=0
|
||||
# build input stream.
|
||||
cp /dev/null send.in$n
|
||||
while test $i -lt 500
|
||||
printf 'GET /xml/v3/status HTTP/1.1\r\nHost: 10.53.0.3\r\n\r\n' > send.in$n
|
||||
printf 'GET /xml/v3/status HTTP/1.1\r\nHost: 10.53.0.3\r\nX-Bloat:' >> send.in$n
|
||||
while test $i -lt 5000
|
||||
do
|
||||
cat >> send.in$n << EOF
|
||||
GET /xml/v3/status HTTP/1.1
|
||||
Host: 10.53.0.3
|
||||
|
||||
EOF
|
||||
printf '%s' "VGhlIG1vc3QgY29tbW9uIHJlYXNvbiBmb3IgYmxvYXRpbmcgaXMgaGF2aW5nIGEgbG90IG9mIGdhcyBpbiB5b3VyIGd1dC4gCg==" >> send.in$n
|
||||
i=$((i+1))
|
||||
done
|
||||
printf '\r\n' >> send.in$n
|
||||
printf '\r\n' >> send.in$n
|
||||
|
||||
# send the requests then wait for named to close the socket.
|
||||
${PERL} send64k.pl 10.53.0.3 ${EXTRAPORT1} < send.in$n > send.out$n
|
||||
# we expect 91 of the 500 requests to be processed.
|
||||
lines=$(grep "^HTTP/1.1" send.out$n | wc -l)
|
||||
test $lines = 91 || ret=1
|
||||
time1=$($PERL -e 'print time(), "\n";')
|
||||
${NC} 10.53.0.3 ${EXTRAPORT1} < send.in$n > send.out$n
|
||||
time2=$($PERL -e 'print time(), "\n";')
|
||||
test $((time2 - time1)) -lt 5 || ret=1
|
||||
# we expect 1 request to be processed.
|
||||
lines=$(grep -c "^HTTP/1.1" send.out$n)
|
||||
test $lines = 1 || ret=1
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
n=$((n + 1))
|
||||
|
|
|
|||
Loading…
Reference in a new issue