From 1c7b68ae137fbdd17987a4d7f78907df5217339d Mon Sep 17 00:00:00 2001 From: Vincent Gramer Date: Wed, 29 Nov 2023 10:19:24 +0100 Subject: [PATCH] MINOR: add log-bufsize option to server params Signed-off-by: Vincent Gramer --- params/server-options.go | 1 + tests/configs/haproxy_generated.cfg.go | 8 ++++++++ tests/default-server_generated_test.go | 1 + tests/integration/backend_data_test.go | 8 ++++++++ tests/integration/backend_test.go | 2 ++ tests/integration/defaults_data_test.go | 4 ++++ tests/integration/defaults_test.go | 1 + tests/integration/peers_data_test.go | 4 ++++ tests/integration/peers_test.go | 1 + tests/server_generated_test.go | 1 + types/types.go | 2 ++ 11 files changed, 33 insertions(+) diff --git a/params/server-options.go b/params/server-options.go index 9d3e7d2..dc40ae7 100644 --- a/params/server-options.go +++ b/params/server-options.go @@ -225,6 +225,7 @@ func getServerOptions() []ServerOption { &ServerOptionValue{Name: "weight"}, &ServerOptionValue{Name: "pool-low-conn"}, &ServerOptionValue{Name: "ws"}, + &ServerOptionValue{Name: "log-bufsize"}, } } diff --git a/tests/configs/haproxy_generated.cfg.go b/tests/configs/haproxy_generated.cfg.go index 5e9a204..0858f84 100644 --- a/tests/configs/haproxy_generated.cfg.go +++ b/tests/configs/haproxy_generated.cfg.go @@ -215,6 +215,7 @@ backend test default-server ws h1 default-server ws h2 default-server ws auto + default-server log-bufsize 10 email-alert from admin@example.com email-alert to a@z,x@y email-alert level warning @@ -398,6 +399,7 @@ backend test server name 127.0.0.1 ws h1 server name 127.0.0.1 ws h2 server name 127.0.0.1 ws auto + server name 127.0.0.1 log-bufsize 10 stick-table type ip size 1m expire 5m store gpc0,conn_rate(30s) stick on src table pop if !localhost stick match src table pop if !localhost @@ -1162,6 +1164,7 @@ defaults test default-server ws h1 default-server ws h2 default-server ws auto + default-server log-bufsize 10 email-alert from admin@example.com email-alert to a@z,x@y email-alert level warning @@ -2176,6 +2179,7 @@ peers test default-server ws h1 default-server ws h2 default-server ws auto + default-server log-bufsize 10 peer name 127.0.0.1:8080 peer name 127.0.0.1:8080 shard 1 default-bind user root mode 600 accept-proxy @@ -2816,6 +2820,8 @@ var configTests = []configTest{{` command spoa-mirror --runtime 0 --mirror-url {` default-server ws h2 `, 3}, {` default-server ws auto +`, 3}, + {` default-server log-bufsize 10 `, 3}, {` email-alert from admin@example.com `, 3}, @@ -3194,6 +3200,8 @@ var configTests = []configTest{{` command spoa-mirror --runtime 0 --mirror-url {` server name 127.0.0.1 ws h2 `, 1}, {` server name 127.0.0.1 ws auto +`, 1}, + {` server name 127.0.0.1 log-bufsize 10 `, 1}, {` stick-table type ip size 1m expire 5m store gpc0,conn_rate(30s) `, 2}, diff --git a/tests/default-server_generated_test.go b/tests/default-server_generated_test.go index 815ac19..1a797d3 100644 --- a/tests/default-server_generated_test.go +++ b/tests/default-server_generated_test.go @@ -171,6 +171,7 @@ func TestDefaultServer(t *testing.T) { "default-server ws h1": true, "default-server ws h2": true, "default-server ws auto": true, + "default-server log-bufsize 10": true, "default-server": false, "---": false, "--- ---": false, diff --git a/tests/integration/backend_data_test.go b/tests/integration/backend_data_test.go index e646bf8..7ee4571 100644 --- a/tests/integration/backend_data_test.go +++ b/tests/integration/backend_data_test.go @@ -777,6 +777,10 @@ const backend_defaultserverwsauto = ` backend test default-server ws auto ` +const backend_defaultserverlogbufsize10 = ` +backend test + default-server log-bufsize 10 +` const backend_emailalertfromadminexamplecom = ` backend test email-alert from admin@example.com @@ -1709,6 +1713,10 @@ const backend_servername127001wsauto = ` backend test server name 127.0.0.1 ws auto ` +const backend_servername127001logbufsize10 = ` +backend test + server name 127.0.0.1 log-bufsize 10 +` const backend_sticktabletypeipsize1mexpire5mst = ` backend test stick-table type ip size 1m expire 5m store gpc0,conn_rate(30s) diff --git a/tests/integration/backend_test.go b/tests/integration/backend_test.go index f5b403b..dca30e4 100644 --- a/tests/integration/backend_test.go +++ b/tests/integration/backend_test.go @@ -119,6 +119,7 @@ func TestWholeConfigsSectionsBackend(t *testing.T) { {"backend_defaultserverinitaddrlastlibcnon_", backend_defaultserverinitaddrlastlibcnon_}, {"backend_defaultserverinter1000weight13", backend_defaultserverinter1000weight13}, {"backend_defaultserverinter1500ms", backend_defaultserverinter1500ms}, + {"backend_defaultserverlogbufsize10", backend_defaultserverlogbufsize10}, {"backend_defaultserverlogprotolegacy", backend_defaultserverlogprotolegacy}, {"backend_defaultserverlogprotooctetcount", backend_defaultserverlogprotooctetcount}, {"backend_defaultservermaxconn1", backend_defaultservermaxconn1}, @@ -736,6 +737,7 @@ func TestWholeConfigsSectionsBackend(t *testing.T) { {"backend_servername127001initaddrlastlibc", backend_servername127001initaddrlastlibc}, {"backend_servername127001initaddrlastlibc_", backend_servername127001initaddrlastlibc_}, {"backend_servername127001inter1500ms", backend_servername127001inter1500ms}, + {"backend_servername127001logbufsize10", backend_servername127001logbufsize10}, {"backend_servername127001logprotolegacy", backend_servername127001logprotolegacy}, {"backend_servername127001logprotooctetcou", backend_servername127001logprotooctetcou}, {"backend_servername127001maxconn1", backend_servername127001maxconn1}, diff --git a/tests/integration/defaults_data_test.go b/tests/integration/defaults_data_test.go index 73c9e6a..d7c4a1a 100644 --- a/tests/integration/defaults_data_test.go +++ b/tests/integration/defaults_data_test.go @@ -717,6 +717,10 @@ const defaults_defaultserverwsauto = ` defaults test default-server ws auto ` +const defaults_defaultserverlogbufsize10 = ` +defaults test + default-server log-bufsize 10 +` const defaults_emailalertfromadminexamplecom = ` defaults test email-alert from admin@example.com diff --git a/tests/integration/defaults_test.go b/tests/integration/defaults_test.go index 0c117c4..2874b53 100644 --- a/tests/integration/defaults_test.go +++ b/tests/integration/defaults_test.go @@ -104,6 +104,7 @@ func TestWholeConfigsSectionsDefaults(t *testing.T) { {"defaults_defaultserverinitaddrlastlibcnon_", defaults_defaultserverinitaddrlastlibcnon_}, {"defaults_defaultserverinter1000weight13", defaults_defaultserverinter1000weight13}, {"defaults_defaultserverinter1500ms", defaults_defaultserverinter1500ms}, + {"defaults_defaultserverlogbufsize10", defaults_defaultserverlogbufsize10}, {"defaults_defaultserverlogprotolegacy", defaults_defaultserverlogprotolegacy}, {"defaults_defaultserverlogprotooctetcount", defaults_defaultserverlogprotooctetcount}, {"defaults_defaultservermaxconn1", defaults_defaultservermaxconn1}, diff --git a/tests/integration/peers_data_test.go b/tests/integration/peers_data_test.go index 80a80ea..98b9f62 100644 --- a/tests/integration/peers_data_test.go +++ b/tests/integration/peers_data_test.go @@ -593,6 +593,10 @@ const peers_defaultserverwsauto = ` peers test default-server ws auto ` +const peers_defaultserverlogbufsize10 = ` +peers test + default-server log-bufsize 10 +` const peers_peername1270018080 = ` peers test peer name 127.0.0.1:8080 diff --git a/tests/integration/peers_test.go b/tests/integration/peers_test.go index 235640e..54970ce 100644 --- a/tests/integration/peers_test.go +++ b/tests/integration/peers_test.go @@ -78,6 +78,7 @@ func TestWholeConfigsSectionsPeers(t *testing.T) { {"peers_defaultserverinitaddrlastlibcnon_", peers_defaultserverinitaddrlastlibcnon_}, {"peers_defaultserverinter1000weight13", peers_defaultserverinter1000weight13}, {"peers_defaultserverinter1500ms", peers_defaultserverinter1500ms}, + {"peers_defaultserverlogbufsize10", peers_defaultserverlogbufsize10}, {"peers_defaultserverlogprotolegacy", peers_defaultserverlogprotolegacy}, {"peers_defaultserverlogprotooctetcount", peers_defaultserverlogprotooctetcount}, {"peers_defaultservermaxconn1", peers_defaultservermaxconn1}, diff --git a/tests/server_generated_test.go b/tests/server_generated_test.go index 44557b3..33339da 100644 --- a/tests/server_generated_test.go +++ b/tests/server_generated_test.go @@ -171,6 +171,7 @@ func TestServer(t *testing.T) { "server name 127.0.0.1 ws h1": true, "server name 127.0.0.1 ws h2": true, "server name 127.0.0.1 ws auto": true, + "server name 127.0.0.1 log-bufsize 10": true, "server addr": false, "server": false, "---": false, diff --git a/types/types.go b/types/types.go index 4d2ea94..0a9492f 100644 --- a/types/types.go +++ b/types/types.go @@ -537,6 +537,7 @@ type CPUMap struct { //test:ok:default-server ws h1 //test:ok:default-server ws h2 //test:ok:default-server ws auto +//test:ok:default-server log-bufsize 10 //test:fail:default-server type DefaultServer struct { Params []params.ServerOption @@ -1047,6 +1048,7 @@ type Peer struct { //test:ok:server name 127.0.0.1 ws h1 //test:ok:server name 127.0.0.1 ws h2 //test:ok:server name 127.0.0.1 ws auto +//test:ok:server name 127.0.0.1 log-bufsize 10 //test:fail:server type Server struct { Name string