Skip to content

Commit 44dc08c

Browse files
committed
TEST/MINOR: e2e: cover tune.quic frontend and backend options
1 parent 71a02e8 commit 44dc08c

3 files changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"runtime_apis": [
3+
{
4+
"address": "/var/lib/haproxy/stats",
5+
"level": "admin"
6+
}
7+
],
8+
"daemon": true,
9+
"performance_options": {
10+
"maxconn": 5000
11+
},
12+
"pidfile": "/var/run/haproxy.pid",
13+
"tune_quic_options": {
14+
"fe_max_idle_timeout": 30000,
15+
"be_stream_max_concurrent": 100,
16+
"fe_sock_per_conn": "force-off"
17+
}
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"runtime_apis": [
3+
{
4+
"address": "/var/lib/haproxy/stats",
5+
"level": "admin"
6+
}
7+
],
8+
"daemon": true,
9+
"performance_options": {
10+
"maxconn": 5000
11+
},
12+
"pidfile": "/var/run/haproxy.pid",
13+
"tune_quic_options": {
14+
"frontend_max_idle_timeout": 20000,
15+
"socket_owner": "connection"
16+
}
17+
}

‎e2e/tests/global/replace.bats‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
load '../../libs/dataplaneapi'
1919
load '../../libs/get_json_path'
2020
load '../../libs/haproxy_config_setup'
21+
load '../../libs/haproxy_version'
2122
load '../../libs/resource_client'
2223
load '../../libs/version'
2324

@@ -115,3 +116,29 @@ load 'utils/_helpers'
115116
resource_get "$_RUNTIME_MAP_FILES_BASE_PATH" ""
116117
assert_equal "$SC" 200
117118
}
119+
120+
@test "global: Replace a global configuration with QUIC tuning options" {
121+
haproxy_version_ge "3.5" || skip "requires HAProxy 3.5+"
122+
123+
resource_put "$_GLOBAL_BASE_PATH" "data/put_quic.json" ""
124+
assert_equal "$SC" 202
125+
126+
resource_get "$_GLOBAL_BASE_PATH" ""
127+
assert_equal "$SC" 200
128+
assert_equal "$(get_json_path "$BODY" '.tune_quic_options.fe_max_idle_timeout')" "30000"
129+
assert_equal "$(get_json_path "$BODY" '.tune_quic_options.be_stream_max_concurrent')" "100"
130+
assert_equal "$(get_json_path "$BODY" '.tune_quic_options.fe_sock_per_conn')" "force-off"
131+
# deprecated fields mirror the new ones
132+
assert_equal "$(get_json_path "$BODY" '.tune_quic_options.frontend_max_idle_timeout')" "30000"
133+
assert_equal "$(get_json_path "$BODY" '.tune_quic_options.socket_owner')" "listener"
134+
135+
# deprecated fields alone are written as the new keywords
136+
resource_put "$_GLOBAL_BASE_PATH" "data/put_quic_deprecated.json" ""
137+
assert_equal "$SC" 202
138+
139+
resource_get "$_GLOBAL_BASE_PATH" ""
140+
assert_equal "$SC" 200
141+
assert_equal "$(get_json_path "$BODY" '.tune_quic_options.fe_max_idle_timeout')" "20000"
142+
assert_equal "$(get_json_path "$BODY" '.tune_quic_options.fe_sock_per_conn')" "default-on"
143+
assert_equal "$(get_json_path "$BODY" '.tune_quic_options.be_stream_max_concurrent')" "null"
144+
}

0 commit comments

Comments
 (0)