vtest "TCP vs UDS sockopt inheritance"

feature cmd {test $(uname) != SunOS}

server s0 {
        rxreqhdrs
        non_fatal
        rxreqbody
        txresp
} -dispatch

vinyl v1 -arg {-a TCP=${localhost}:0 -a "UDS=${tmpdir}/v1.sock"}
vinyl v1 -cliok "param.set debug +flush_head"
vinyl v1 -cliok "param.set timeout_idle 1"
vinyl v1 -vcl+backend { } -start

client c1 {
        txreq -req POST -hdr "Content-Length: 100"
        send some
        rxresp
        expect resp.status == 400
}

# This run performs the inheritance test on a TCP connection
client c1 -run

# This run relies on the inheritance test results
client c1 -run

vinyl v1 -vsl_catchup

# This run checks that TCP results aren't applied to a UDS
client c1 -connect "${tmpdir}/v1.sock"
client c1 -run

# And finally this run checks UDS inheritance test results
client c1 -run
