mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-15 04:52:15 +02:00
Each frontend/backend/listen proxies is assigned an unique ID. It can either be set explicitely via 'id' keyword, or automatically assigned on post parsing depending on the available values. It was expected that the first automatically assigned value would start at '1'. However, due to a legacy bug this is not the case as this value is always skipped. Thus, automatically assigned proxies always start at '2' or more. To avoid breaking the current existing state, this situation is now acknowledged with the current patch. The code is rewritten with an explicit warning to ensure that this won't be fixed without knowing the current status. A new regtest also ensures this.
59 lines
1.2 KiB
Plaintext
59 lines
1.2 KiB
Plaintext
varnishtest "Ensure that proxies automatic numbering remains consistent across versions"
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
# No ID explicitely set. First automatically assigned value must be set to '2'.
|
|
# Value '1' is skipped due to an historical bug.
|
|
haproxy h1 -conf {
|
|
defaults
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
listen fe1
|
|
bind "fd@${fe1}"
|
|
|
|
listen fe2
|
|
bind "fd@${fe2}"
|
|
} -start
|
|
|
|
haproxy h1 -cli {
|
|
send "show stat 1 -1 -1"
|
|
expect !~ "fe[12],"
|
|
|
|
send "show stat 2 -1 -1"
|
|
expect ~ "fe1,"
|
|
|
|
send "show stat 3 -1 -1"
|
|
expect ~ "fe2,"
|
|
}
|
|
|
|
# Explicitely uses ID 1 and 2. First automatically assigned value must be
|
|
# set to '3'.
|
|
haproxy h2 -conf {
|
|
defaults
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
listen fe1
|
|
bind "fd@${fe1}"
|
|
listen fe2
|
|
id 1 # 1 set as automatic value
|
|
bind "fd@${fe1}"
|
|
listen fe3
|
|
id 2
|
|
bind "fd@${fe3}"
|
|
} -start
|
|
|
|
haproxy h2 -cli {
|
|
send "show stat 1 -1 -1"
|
|
expect ~ "fe2,"
|
|
|
|
send "show stat 2 -1 -1"
|
|
expect ~ "fe3,"
|
|
|
|
send "show stat 3 -1 -1"
|
|
expect ~ "fe1,"
|
|
}
|