Skip to content

Commit

Permalink
TEST/MINOR: global: fix tests to accomodate new global structs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjuraga committed Aug 19, 2024
1 parent 809d8bf commit b47d1f0
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 49 deletions.
24 changes: 13 additions & 11 deletions e2e/tests/global/data/put.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"runtime_apis": [
{
"address": "/var/lib/haproxy/stats",
"level": "admin"
}
],
"daemon": "enabled",
"master-worker": true,
"maxconn": 5000,
"pidfile": "/var/run/haproxy.pid"
}
"runtime_apis": [
{
"address": "/var/lib/haproxy/stats",
"level": "admin"
}
],
"daemon": true,
"master-worker": true,
"performance_options": {
"maxconn": 5000
},
"pidfile": "/var/run/haproxy.pid"
}
36 changes: 19 additions & 17 deletions e2e/tests/global/data/put_2.8.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"runtime_apis": [
{
"address": "/var/lib/haproxy/stats",
"level": "admin"
}
],
"tune_options": {
"h2_be_initial_window_size": 20,
"h2_be_max_concurrent_streams": 21,
"h2_fe_initial_window_size": 22,
"h2_fe_max_concurrent_streams": 23
},
"daemon": "enabled",
"master-worker": true,
"maxconn": 5000,
"pidfile": "/var/run/haproxy.pid"
}
"runtime_apis": [
{
"address": "/var/lib/haproxy/stats",
"level": "admin"
}
],
"tune_options": {
"h2_be_initial_window_size": 20,
"h2_be_max_concurrent_streams": 21,
"h2_fe_initial_window_size": 22,
"h2_fe_max_concurrent_streams": 23
},
"performance_options": {
"maxconn": 5000
},
"daemon": true,
"master-worker": true,
"pidfile": "/var/run/haproxy.pid"
}
24 changes: 13 additions & 11 deletions e2e/tests/global/data/put_socket.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"runtime_apis": [
{
"address": "/var/lib/haproxy/stats-new",
"level": "admin"
}
],
"daemon": "enabled",
"master-worker": true,
"maxconn": 5000,
"pidfile": "/var/run/haproxy.pid"
}
"runtime_apis": [
{
"address": "/var/lib/haproxy/stats-new",
"level": "admin"
}
],
"daemon": true,
"master-worker": true,
"performance_options": {
"maxconn": 5000
},
"pidfile": "/var/run/haproxy.pid"
}
4 changes: 2 additions & 2 deletions e2e/tests/global/get.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ load 'utils/_helpers'
assert_equal "$(get_json_path "$BODY" '.chroot')" "/var/lib/haproxy"
assert_equal "$(get_json_path "$BODY" '.user')" "haproxy"
assert_equal "$(get_json_path "$BODY" '.group')" "haproxy"
assert_equal "$(get_json_path "$BODY" '.maxconn')" "4000"
assert_equal "$(get_json_path "$BODY" '.performance_options.maxconn')" "4000"
assert_equal "$(get_json_path "$BODY" '.pidfile')" "/var/run/haproxy.pid"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].address')" "/var/lib/haproxy/stats"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].level')" "admin"
if haproxy_version_ge "2.8"; then
assert_equal "$(get_json_path "$BODY" '.tune_options.ssl_ocsp_update_min_delay')" "10"
assert_equal "$(get_json_path "$BODY" '.tune_ssl_options.ocsp_update_min_delay')" "10"
assert_equal "$(get_json_path "$BODY" '.tune_options.stick_counters')" "50"
assert_equal "$(get_json_path "$BODY" '.tune_options.h2_be_initial_window_size')" "10"
assert_equal "$(get_json_path "$BODY" '.tune_options.h2_be_max_concurrent_streams')" "11"
Expand Down
12 changes: 6 additions & 6 deletions e2e/tests/global/replace.bats
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ load 'utils/_helpers'

resource_get "$_GLOBAL_BASE_PATH" ""
assert_equal "$SC" 200
assert_equal "$(get_json_path "$BODY" '.maxconn')" "5000"
assert_equal "$(get_json_path "$BODY" '.daemon')" "enabled"
assert_equal "$(get_json_path "$BODY" '.performance_options.maxconn')" "5000"
assert_equal "$(get_json_path "$BODY" '.daemon')" "true"
assert_equal "$(get_json_path "$BODY" '.pidfile')" "/var/run/haproxy.pid"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].address')" "/var/lib/haproxy/stats"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].level')" "admin"
Expand All @@ -43,8 +43,8 @@ load 'utils/_helpers'

resource_get "$_GLOBAL_BASE_PATH" ""
assert_equal "$SC" 200
assert_equal "$(get_json_path "$BODY" '.maxconn')" "5000"
assert_equal "$(get_json_path "$BODY" '.daemon')" "enabled"
assert_equal "$(get_json_path "$BODY" '.performance_options.maxconn')" "5000"
assert_equal "$(get_json_path "$BODY" '.daemon')" "true"
assert_equal "$(get_json_path "$BODY" '.pidfile')" "/var/run/haproxy.pid"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].address')" "/var/lib/haproxy/stats-new"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].level')" "admin"
Expand Down Expand Up @@ -74,8 +74,8 @@ load 'utils/_helpers'
# check configuration has been applied
resource_get "$_GLOBAL_BASE_PATH" ""
assert_equal "$SC" 200
assert_equal "$(get_json_path "$BODY" '.maxconn')" "5000"
assert_equal "$(get_json_path "$BODY" '.daemon')" "enabled"
assert_equal "$(get_json_path "$BODY" '.performance_options.maxconn')" "5000"
assert_equal "$(get_json_path "$BODY" '.daemon')" "true"
assert_equal "$(get_json_path "$BODY" '.pidfile')" "/var/run/haproxy.pid"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].address')" "/var/lib/haproxy/stats-new"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].level')" "admin"
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/global/replace_2.8.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ load 'utils/_helpers'

resource_get "$_GLOBAL_BASE_PATH" ""
assert_equal "$SC" 200
assert_equal "$(get_json_path "$BODY" '.maxconn')" "5000"
assert_equal "$(get_json_path "$BODY" '.daemon')" "enabled"
assert_equal "$(get_json_path "$BODY" '.performance_options.maxconn')" "5000"
assert_equal "$(get_json_path "$BODY" '.daemon')" "true"
assert_equal "$(get_json_path "$BODY" '.pidfile')" "/var/run/haproxy.pid"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].address')" "/var/lib/haproxy/stats"
assert_equal "$(get_json_path "$BODY" '.runtime_apis[0].level')" "admin"
Expand Down

0 comments on commit b47d1f0

Please sign in to comment.