varnishtest "Exercise varnishtest syslog facility"

feature ignore_unknown_macro
feature cmd {haproxy --version 2>&1 | grep -q 'HA-*Proxy version'}

server s1 {
	rxreq
	txresp
} -start

syslog S1 -level notice -bind "${listen_addr}" {
	recv info
	expect ~ \"dip\":\"${h1_fe_1_addr}\"
} -start

haproxy h1 -conf {
    global
	log ${S1_sock} local0

    defaults
	log global
	timeout connect 3000
	timeout client 5
	timeout server  10000

    frontend fe1
	bind "fd@${fe_1}"
	mode tcp
	log-format {\"dip\":\"%fi\",\"dport\":\"%fp\"}
	default_backend    be1

    backend be1
	server srv1 ${s1_sock}
} -start

client c1 -connect ${h1_fe_1_sock} {
	txreq -url "/"
	delay 0.02
	rxresp
} -run

syslog S1 -wait
