blob: b7d6c7c487ad8ea9656136926e090459bf1dc255 [file] [log] [blame]
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +02001# commit b4dd15b
2# BUG/MINOR: unix: Make sure we can transfer abns sockets on seamless reload.
3#
4# When checking if a socket we got from the parent is suitable for a listener,
5# we just checked that the path matched sockname.tmp, however this is
6# unsuitable for abns sockets, where we don't have to create a temporary
7# file and rename it later.
8# To detect that, check that the first character of the sun_path is 0 for
9# both, and if so, that &sun_path[1] is the same too.
Willy Tarreau501c9952020-11-03 18:43:48 +010010#
11# Note: there are some tricks here. One of them is that we must not bind the
12# same abns address to multiple processes that may run in parallel. Since
13# vtest cannot provide abns sockets, we're instead concatenating the number
14# of the listening port that vtest allocated for another frontend to the abns
15# path, which guarantees to make them unique in the system.
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020016
17varnishtest "Seamless reload issue with abns sockets"
18feature ignore_unknown_macro
19
PiBa-NLe6b11e12018-12-08 20:51:16 +010020# abns@ sockets are not available on freebsd
Willy Tarreau084354f2019-04-25 08:50:25 +020021#EXCLUDE_TARGETS=freebsd,osx,generic
Willy Tarreauf8d46de2020-09-29 10:58:44 +020022#REQUIRE_VERSION=1.8
Willy Tarreau1bc89832020-11-17 11:45:10 +010023#REGTEST_TYPE=broken
PiBa-NLe6b11e12018-12-08 20:51:16 +010024
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020025haproxy h1 -W -conf {
26 global
Frédéric Lécaillea7029472018-12-20 09:55:44 +010027 stats socket "${tmpdir}/h1/stats" level admin expose-fd listeners
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020028
29 defaults
30 mode http
Christopher Faulet8f161482018-12-19 11:49:39 +010031 ${no-htx} option http-use-htx
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020032 log global
33 option httplog
Willy Tarreauce6fc252020-03-23 09:11:51 +010034 timeout connect 1s
35 timeout client 1s
36 timeout server 1s
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020037
38 listen testme
39 bind "fd@${testme}"
Willy Tarreau501c9952020-11-03 18:43:48 +010040 server test_abns_server abns@wpproc1_${h1_testme_port} send-proxy-v2
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020041
42 frontend test_abns
Willy Tarreau501c9952020-11-03 18:43:48 +010043 bind abns@wpproc1_${h1_testme_port} accept-proxy
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020044 http-request deny deny_status 200
45} -start
46
47shell {
Frédéric Lécaillea7029472018-12-20 09:55:44 +010048 kill -USR2 $(cat "${tmpdir}/h1/pid")
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020049}
50
51client c1 -connect ${h1_testme_sock} {
52 txreq -url "/"
53 rxresp
54} -repeat 50 -run
55