Hi List,

I'm trying (and failing?) to write a H2>HTX>H1(keepalive) test.

Using haproxy 1.9-dev6-05b9b64.

Test vtc attached, i added the 'option http-use-htx' to the fe4 frontend/backend.
Is there anything else that should be changed?
Or is my way of making the H2 request incorrect? Though the 3 tests before it 'seem' to work alright.

Below the output i get, with a unexpected '500' status, and with a IC-- on the logline... It also seems it never contacted the s4 server. Without the htx option it does make 1 request to the s4, and the second expected request tries to make a second connection. (the 'old' way..)

Thanks in advance.

Regards
PiBa-NL (Pieter)

**   c4    0.2 === txreq -req GET -url /3
***  c4    0.2 tx: stream: 1, type: HEADERS (1), flags: 0x05, size: 37
**   c4    0.2 === rxresp
***  h1    0.2 debug|00000007:fe4.accept(000e)=0011 from [::1:25432] ALPN=<none>
***  h1    0.2 debug|00000007:fe4.clireq[0011:ffffffff]: GET /3 HTTP/1.1
***  h1    0.2 debug|00000007:b4.clicls[0011:adfd]
***  h1    0.2 debug|00000007:b4.closed[0011:adfd]
***  h1    0.2 debug|::1:25432 [19/Nov/2018:01:03:11.550] fe4 b4/srv4 0/0/-1/-1/0 500 203 - - IC-- 2/1/0/0/0 0/0 "GET /3 HTTP/1.1"
***  c4    0.2 rx: stream: 1, type: HEADERS (1), flags: 0x04, size: 26
***  c4    0.2 flag: END_TYPE_HEADERS
**** c4    0.2 header[ 0]: :status : 500
**** c4    0.2 header[ 1]: cache-control : no-cache
**** c4    0.2 header[ 2]: content-type : text/html
***  c4    0.2 rx: stream: 1, type: DATA (0), flags: 0x00, size: 96
***  c4    0.2 rx: stream: 1, type: DATA (0), flags: 0x01, size: 0
***  c4    0.2 flag: END_STREAM
**** c4    0.2 s1 - no data
**   c4    0.2 === expect resp.status == 200
---- c4    0.2 EXPECT resp.status (500) == "200" failed

# h2 with h1 backend connection reuse check

# the c3 > h1 > s3 test works (wrongly?) because haproxy breaks connection to 
the server, and creates a new one..
# the c4 > h1 > s4 test fails because haproxy breaks connection to the server, 
while it should keep the connection alive.


varnishtest "h2 with h1 backend connection reuse check"
feature ignore_unknown_macro

server s1 {
  rxreq
  txresp -gziplen 200
  rxreq
  txresp -gziplen 200
} -start

server s2  {
  stream 0 {
    rxsettings
    txsettings -ack
  } -run
  stream 1 {
    rxreq
    txresp -bodylen 200
  } -run
  stream 3 {
    rxreq
    txresp -bodylen 200
  } -run
} -start

server s3 -repeat 2 {
  rxreq
  txresp -gziplen 200
} -start

server s4 {
  timeout 3
  rxreq
  txresp -gziplen 200
  rxreq
  txresp -gziplen 200
} -start

haproxy h1 -conf {
  global
    #nbthread 3
    log stdout format raw daemon
#    log :1514 local0
    stats socket /tmp/haproxy.socket level admin

  defaults
    mode http
    #option dontlog-normal
    log global
    option httplog
    timeout connect         3s
    timeout client          40s
    timeout server          40s

  frontend fe1
    bind "fd@${fe1}"
    default_backend b1

  backend b1
    option http-keep-alive
    server srv1 ${s1_addr}:${s1_port}

  frontend fe3
    bind "fd@${fe3}" proto h2
    default_backend b3
    
  backend b3
    server srv3 ${s3_addr}:${s3_port}

  frontend fe4
    bind "fd@${fe4}" proto h2
    default_backend b4
option http-use-htx
    
  backend b4
    option http-keep-alive
    server srv4 ${s4_addr}:${s4_port}
option http-use-htx

} -start


client c1 -connect ${h1_fe1_sock} {
    txreq -url "/1"
    rxresp
    expect resp.status == 200
    txreq -url "/2"
    rxresp
    expect resp.status == 200
} -start
client c1 -wait

client c2 -connect ${s2_sock} {
        stream 0 {
                txsettings -hdrtbl 0
                rxsettings
        } -run
        stream 1 {
              txreq -req GET -url /3
                rxresp
                expect resp.status == 200
        } -run
        stream 3 {
              txreq -req GET -url /4
                rxresp
                expect resp.status == 200
        } -run
} -start
client c2 -wait

client c3 -connect ${h1_fe3_sock} {
        stream 0 {
                txsettings -hdrtbl 0
                rxsettings
        } -run
        stream 1 {
              txreq -req GET -url /3
                rxresp
                expect resp.status == 200
        } -run
        stream 3 {
              txreq -req GET -url /4
                rxresp
                expect resp.status == 200
        } -run
} -start
client c3 -wait

client c4 -connect ${h1_fe4_sock} {
        stream 0 {
                txsettings -hdrtbl 0
                rxsettings
        } -run
       stream 1 {
              txreq -req GET -url /3
                rxresp
                expect resp.status == 200
        } -run
        stream 3 {
              txreq -req GET -url /4
                rxresp
                expect resp.status == 200
        } -run
} -start
client c4 -wait

server s1 -wait
server s2 -wait
server s3 -wait
server s4 -wait

Reply via email to