"Fossies" - the Fresh Open Source Software Archive

Member "haproxy-1.9.8/reg-tests/connection/b00000.vtc" (13 May 2019, 1757 Bytes) of package /linux/misc/haproxy-1.9.8.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "b00000.vtc": 1.9.6_vs_1.9.7.

    1 #commit b406b87
    2 # BUG/MEDIUM: connection: don't store recv() result into trash.data
    3 #
    4 # Cyril Bonté discovered that the proxy protocol randomly fails since
    5 # commit 843b7cb ("MEDIUM: chunks: make the chunk struct's fields match
    6 # the buffer struct"). This is because we used to store recv()'s return
    7 # code into trash.data which is now unsigned, so it never compares as
    8 # negative against 0. Let's clean this up and test the result itself
    9 # without storing it first.
   10 
   11 varnishtest "PROXY protocol random failures"
   12 #REQUIRE_OPTIONS=OPENSSL
   13 
   14 feature ignore_unknown_macro
   15 
   16 syslog Slog_1 -repeat 8 -level info {
   17     recv
   18     expect ~ "Connect from .* to ${h1_ssl_addr}:${h1_ssl_port}"
   19     recv
   20     expect ~ "ssl-offload-http/http .* \"POST /[1-8] HTTP/(2\\.0|1\\.1)\""
   21 } -start
   22 
   23 haproxy h1 -conf {
   24     global
   25         nbproc 4
   26         tune.ssl.default-dh-param 2048
   27         stats bind-process 1
   28         log ${Slog_1_addr}:${Slog_1_port} len 2048 local0 debug err
   29 
   30     defaults
   31         mode http
   32         ${no-htx} option http-use-htx
   33         timeout client 1s
   34         timeout server 1s
   35         timeout connect 1s
   36         log global
   37 
   38     listen http
   39         bind-process 1
   40         bind unix@"${tmpdir}/http.socket" accept-proxy name ssl-offload-http
   41         option forwardfor
   42 
   43     listen ssl-offload-http
   44         option httplog
   45         bind-process 2-4
   46         bind "fd@${ssl}" ssl crt ${testdir}/common.pem ssl no-sslv3 alpn h2,http/1.1
   47         server http unix@"${tmpdir}/http.socket" send-proxy
   48 } -start
   49 
   50 
   51 shell {
   52     HOST=${h1_ssl_addr}
   53     if [ "$HOST" = "::1" ] ; then
   54         HOST="\[::1\]"
   55     fi
   56     for i in 1 2 3 4 5 6 7 8 ; do
   57         urls="$urls https://$HOST:${h1_ssl_port}/$i"
   58     done
   59     curl -i -k -d 'x=x' $urls & wait $!
   60 }
   61 
   62 syslog Slog_1 -wait