Frédéric Lécaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 1 | # 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 Tarreau | 501c995 | 2020-11-03 18:43:48 +0100 | [diff] [blame] | 10 | # |
| 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écaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 16 | |
| 17 | varnishtest "Seamless reload issue with abns sockets" |
| 18 | feature ignore_unknown_macro |
| 19 | |
PiBa-NL | e6b11e1 | 2018-12-08 20:51:16 +0100 | [diff] [blame] | 20 | # abns@ sockets are not available on freebsd |
Willy Tarreau | 084354f | 2019-04-25 08:50:25 +0200 | [diff] [blame] | 21 | #EXCLUDE_TARGETS=freebsd,osx,generic |
Willy Tarreau | 1bc8983 | 2020-11-17 11:45:10 +0100 | [diff] [blame] | 22 | #REGTEST_TYPE=broken |
PiBa-NL | e6b11e1 | 2018-12-08 20:51:16 +0100 | [diff] [blame] | 23 | |
Frédéric Lécaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 24 | haproxy h1 -W -conf { |
| 25 | global |
Frédéric Lécaille | a702947 | 2018-12-20 09:55:44 +0100 | [diff] [blame] | 26 | stats socket "${tmpdir}/h1/stats" level admin expose-fd listeners |
Frédéric Lécaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 27 | |
| 28 | defaults |
| 29 | mode http |
Frédéric Lécaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 30 | log global |
| 31 | option httplog |
Willy Tarreau | f673923 | 2021-11-18 17:46:22 +0100 | [diff] [blame] | 32 | timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" |
| 33 | timeout client "${HAPROXY_TEST_TIMEOUT-5s}" |
| 34 | timeout server "${HAPROXY_TEST_TIMEOUT-5s}" |
Frédéric Lécaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 35 | |
| 36 | listen testme |
| 37 | bind "fd@${testme}" |
Willy Tarreau | 501c995 | 2020-11-03 18:43:48 +0100 | [diff] [blame] | 38 | server test_abns_server abns@wpproc1_${h1_testme_port} send-proxy-v2 |
Frédéric Lécaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 39 | |
| 40 | frontend test_abns |
Willy Tarreau | 501c995 | 2020-11-03 18:43:48 +0100 | [diff] [blame] | 41 | bind abns@wpproc1_${h1_testme_port} accept-proxy |
Frédéric Lécaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 42 | http-request deny deny_status 200 |
| 43 | } -start |
| 44 | |
| 45 | shell { |
Frédéric Lécaille | a702947 | 2018-12-20 09:55:44 +0100 | [diff] [blame] | 46 | kill -USR2 $(cat "${tmpdir}/h1/pid") |
Frédéric Lécaille | 9b53b4c | 2018-06-20 07:26:44 +0200 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | client c1 -connect ${h1_testme_sock} { |
| 50 | txreq -url "/" |
| 51 | rxresp |
| 52 | } -repeat 50 -run |
| 53 | |