From: Aram Sargsyan Date: Wed, 20 Jul 2022 13:33:40 +0000 (+0000) Subject: Add pipelined POST requests check in the statschannel system test X-Git-Tag: v9.19.5~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc9b0ea6a6ba7104528ac6a64ac58139246c6896;p=thirdparty%2Fbind9.git Add pipelined POST requests check in the statschannel system test Use `nc` to check that multiple POST requests with non-empty HTTP body are serviced normally by the statistics channel. --- diff --git a/bin/tests/system/statschannel/tests.sh b/bin/tests/system/statschannel/tests.sh index 5485a5cbbf9..1d0cff0589a 100644 --- a/bin/tests/system/statschannel/tests.sh +++ b/bin/tests/system/statschannel/tests.sh @@ -377,7 +377,7 @@ status=$((status + ret)) n=$((n + 1)) if [ -x "${NC}" ] ; then - echo_i "Check HTTP/1.1 pipelined requests are handled ($n)" + echo_i "Check HTTP/1.1 pipelined requests are handled (GET) ($n)" ret=0 ${NC} 10.53.0.3 ${EXTRAPORT1} << EOF > nc.out$n || ret=1 GET /xml/v3/status HTTP/1.1 @@ -397,6 +397,33 @@ else echo_i "skipping test as nc not found" fi +if [ -x "${NC}" ] ; then + echo_i "Check HTTP/1.1 pipelined requests are handled (POST) ($n)" + ret=0 + ${NC} 10.53.0.3 ${EXTRAPORT1} << EOF > nc.out$n || ret=1 +POST /xml/v3/status HTTP/1.1 +Host: 10.53.0.3:${EXTRAPORT1} +Content-Type: application/json +Content-Length: 3 + +{} +POST /xml/v3/status HTTP/1.1 +Host: 10.53.0.3:${EXTRAPORT1} +Content-Type: application/json +Content-Length: 3 +Connection: close + +{} +EOF + lines=$(grep "^HTTP/1.1" nc.out$n | wc -l) + test $lines = 2 || ret=1 + if [ $ret != 0 ]; then echo_i "failed"; fi + status=$((status + ret)) + n=$((n + 1)) +else + echo_i "skipping test as nc not found" +fi + echo_i "Check HTTP/1.1 pipelined with truncated stream ($n)" ret=0 i=0