Commit a7ee6213 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a syslog-server facility for the benefit of HAproxy testers.

Submitted by: Frédéric Lécaille <flecaille@haproxy.com>

Hacked to pieces by:	phk
parent a871b44d
......@@ -57,6 +57,7 @@ varnishtest_SOURCES = \
vtc_proxy.c \
vtc_server.c \
vtc_subr.c \
vtc_syslog.c \
vtc_varnish.c
varnishtest_LDADD = \
......
......@@ -6,6 +6,7 @@ PROG_SRC += vtc_logexp.c
PROG_SRC += vtc_main.c
PROG_SRC += vtc_barrier.c
PROG_SRC += vtc_server.c
PROG_SRC += vtc_syslog.c
PROG_SRC += vtc_varnish.c
PROG_SRC += vtc_process.c
......
......@@ -40,6 +40,7 @@ CMD(process)
CMD(server)
CMD(setenv)
CMD(shell)
CMD(syslog)
CMD(varnish)
CMD(varnishtest)
#undef CMD
......
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 sl1 -level notice -bind "127.0.0.1:0" {
recv
recv
recv info
expect ~ \"dip\":\"${h1_fe_1_addr}
} -start
haproxy h1 -conf {
global
log ${sl1_addr}:${sl1_port} 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_addr}:${s1_port}
} -start
client c1 -connect ${h1_fe_1_sock} {
txreq -url "/"
delay 0.02
rxresp
} -run
syslog sl1 -wait
......@@ -472,6 +472,7 @@ exec_file(const char *fn, const char *script, const char *tmpdir,
init_macro();
init_server();
init_syslog();
vsb = VSB_new_auto();
AN(vsb);
......
......@@ -85,6 +85,7 @@ extern int feature_dns;
extern int ign_unknown_macro;
void init_server(void);
void init_syslog(void);
int http_process(struct vtclog *vl, const char *spec, int sock, int *sfd,
const char *addr);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment