|
18 | 18 | load '../../libs/dataplaneapi' |
19 | 19 | load '../../libs/get_json_path' |
20 | 20 | load '../../libs/haproxy_config_setup' |
| 21 | +load '../../libs/haproxy_version' |
21 | 22 | load '../../libs/resource_client' |
22 | 23 | load '../../libs/version' |
23 | 24 |
|
@@ -115,3 +116,29 @@ load 'utils/_helpers' |
115 | 116 | resource_get "$_RUNTIME_MAP_FILES_BASE_PATH" "" |
116 | 117 | assert_equal "$SC" 200 |
117 | 118 | } |
| 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