Skip to content

Commit 83dd6ec

Browse files
committed
TEST: add e2e tests for Global CR
Adds also some documentation with the unsupported haproxy 2.9 fields.
1 parent b133f15 commit 83dd6ec

File tree

8 files changed

+658
-7
lines changed

8 files changed

+658
-7
lines changed

deploy/tests/config/2.configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ data:
1717
timeout-queue: 5s
1818
timeout-server: 50s
1919
timeout-tunnel: 1h
20+
cr-global: haproxy-controller/global-full
Lines changed: 346 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,346 @@
1+
apiVersion: ingress.v1.haproxy.org/v1
2+
kind: Global
3+
metadata:
4+
name: global-full
5+
namespace: haproxy-controller
6+
spec:
7+
config:
8+
anonkey: 0
9+
busy_polling: false
10+
ca_base: ""
11+
#chroot: "aword"
12+
close_spread_time: 0
13+
cluster_secret: ""
14+
cpu_maps:
15+
- cpu_set: "1/1"
16+
process: "1"
17+
crt_base: ""
18+
daemon: "enabled"
19+
#default_path: # Set by Ingress Controller, Cannot change.
20+
#path: "aword"
21+
#type: "parent"
22+
description: "a test globals"
23+
device_atlas_options:
24+
json_file: ""
25+
log_level: ""
26+
properties_cookie: ""
27+
separator: ""
28+
expose_experimental_directives: false
29+
external_check: false
30+
fifty_one_degrees_options:
31+
cache_size: 0
32+
data_file: ""
33+
property_name_list: ""
34+
property_separator: ""
35+
gid: 0
36+
grace: 0
37+
group: "root"
38+
h1_case_adjust:
39+
- from: "content-length"
40+
to: "Content-length"
41+
h1_case_adjust_file: ""
42+
h2_workaround_bogus_websocket_clients: false
43+
hard_stop_after: 0
44+
httpclient_resolvers_disabled: "enabled"
45+
httpclient_resolvers_id: ""
46+
httpclient_resolvers_prefer: "ipv6"
47+
httpclient_retries: 0
48+
httpclient_ssl_ca_file: ""
49+
httpclient_ssl_verify: "none"
50+
httpclient_timeout_connect: 0
51+
insecure_fork_wanted: false
52+
insecure_setuid_wanted: false
53+
issuers_chain_path: ""
54+
limited_quic: false
55+
load_server_state_from_file: "none"
56+
#localpeer: ""
57+
log_send_hostname:
58+
enabled: "enabled"
59+
param: "aword"
60+
lua_load_per_thread: ""
61+
# lua_loads:
62+
# - file: "aword"
63+
lua_prepend_path:
64+
- path: "aword"
65+
type: "cpath"
66+
#master-worker: false # Set by Ingress Controller, Cannot change.
67+
max_spread_checks: 0
68+
maxcompcpuusage: 0
69+
maxcomprate: 0
70+
maxconn: 1007
71+
maxconnrate: 0
72+
maxpipes: 0
73+
maxsessrate: 0
74+
maxsslconn: 0
75+
maxsslrate: 0
76+
maxzlibmem: 0
77+
mworker_max_reloads: 0
78+
nbproc: 0
79+
nbthread: 0
80+
no-quic: false
81+
node: ""
82+
noepoll: false
83+
noevports: false
84+
nogetaddrinfo: false
85+
nokqueue: false
86+
nopoll: false
87+
noreuseport: false
88+
nosplice: false
89+
numa_cpu_mapping: "enabled"
90+
#pidfile: "" # Set by Ingress Controller, Cannot change.
91+
pp2_never_send_local: false
92+
prealloc-fd: false
93+
presetenv:
94+
- name: "test1"
95+
value: "test1"
96+
profiling_tasks: "auto"
97+
quiet: false
98+
resetenv: ""
99+
runtime_apis:
100+
- accept_netscaler_cip: 0
101+
accept_proxy: false
102+
address: "0.0.0.0:31025"
103+
allow_0rtt: false
104+
alpn: "aword"
105+
backlog: ""
106+
ca_ignore_err: ""
107+
ca_sign_file: ""
108+
ca_sign_pass: ""
109+
ca_verify_file: ""
110+
ciphers: ""
111+
ciphersuites: ""
112+
client_sigalgs: ""
113+
crl_file: ""
114+
crt_ignore_err: ""
115+
crt_list: ""
116+
curves: ""
117+
defer_accept: false
118+
ecdhe: ""
119+
expose_fd_listeners: false
120+
force_sslv3: false
121+
force_tlsv10: false
122+
force_tlsv11: false
123+
force_tlsv12: false
124+
force_tlsv13: false
125+
generate_certificates: false
126+
gid: 0
127+
group: ""
128+
id: ""
129+
interface: ""
130+
level: "admin"
131+
maxconn: 10005
132+
mode: ""
133+
mss: ""
134+
name: "aword"
135+
namespace: ""
136+
nbconn: 0
137+
nice: 0
138+
no_alpn: false
139+
no_ca_names: false
140+
no_sslv3: false
141+
no_tls_tickets: false
142+
no_tlsv10: false
143+
no_tlsv11: false
144+
no_tlsv12: false
145+
no_tlsv13: false
146+
npn: ""
147+
prefer_client_ciphers: false
148+
# haproxy error: process
149+
# 'stats socket' ''process aword' on 'bind' lines is not supported anymore, please use 'thread' instead.'
150+
# process: "aword" #
151+
# Deprecated
152+
proto: ""
153+
quic-cc-algo: "newreno"
154+
quic-force-retry: true
155+
# haproxy error: quic-socket
156+
# 'stats socket' unknown keyword 'quic-socket'. Did you mean 'quic-force-retry' maybe ?"
157+
# haproxy >= 2.9
158+
#quic-socket: "connection"
159+
severity_output: "none"
160+
sigalgs: ""
161+
ssl: false
162+
#ssl_cafile: ""
163+
#ssl_certificate: "aword"
164+
ssl_max_ver: "SSLv3"
165+
ssl_min_ver: "TLSv1.1"
166+
strict_sni: false
167+
tcp_user_timeout: 0
168+
tfo: false
169+
thread: "all"
170+
tls_ticket_keys: ""
171+
transparent: false
172+
uid: ""
173+
user: ""
174+
v4v6: false
175+
v6only: false
176+
verify: "optional"
177+
server_state_base: "ssb_word"
178+
#server_state_file: "ssf_word" # no file exists
179+
set_dumpable: false
180+
set_var:
181+
- expr: "int(100)"
182+
name: "proc.test2"
183+
set_var_fmt:
184+
- format: "primary"
185+
name: "proc.current_state"
186+
setcap: "cap_net_bind_service"
187+
setenv:
188+
- name: "test3"
189+
value: "test3"
190+
spread_checks: 0
191+
ssl_default_bind_ciphers: ""
192+
ssl_default_bind_ciphersuites: ""
193+
ssl_default_bind_client_sigalgs: ""
194+
ssl_default_bind_curves: ""
195+
ssl_default_bind_options: ""
196+
ssl_default_bind_sigalgs: ""
197+
ssl_default_server_ciphers: ""
198+
ssl_default_server_ciphersuites: ""
199+
ssl_default_server_client_sigalgs: ""
200+
ssl_default_server_curves: ""
201+
ssl_default_server_options: ""
202+
ssl_default_server_sigalgs: ""
203+
ssl_dh_param_file: ""
204+
# haproxy error: ssl_engines
205+
# unknown keyword 'ssl-engine' in 'global' section"
206+
# HAProxy Version 2.6 disabled the support for engines in the default build.
207+
# This option is only available when HAProxy has been built with support for it.
208+
# In case the ssl-engine is required HAProxy can be rebuild with the USE_ENGINE=1 flag.
209+
# ssl_engines:
210+
# - algorithms: "RSA,DSA"
211+
# name: "rdrand"
212+
ssl_load_extra_files: ""
213+
ssl_mode_async: "enabled"
214+
ssl_propquery: ""
215+
ssl_provider: ""
216+
ssl_provider_path: ""
217+
ssl_server_verify: "none"
218+
ssl_skip_self_issued_ca: false
219+
stats_maxconn: 10008
220+
stats_timeout: 6000
221+
strict_limits: false
222+
# thread_group_lines:
223+
# - group: ""
224+
# num_or_range: ""
225+
#thread_groups: 0
226+
tune_options:
227+
buffers_limit: 0
228+
buffers_reserve: 3
229+
bufsize: 0
230+
comp_maxlevel: 0
231+
disable_zero_copy_forwarding: false
232+
# haproxy error
233+
# unknown keyword 'tune.events.max-events-at-once' in 'global' section; did you mean 'tune.maxpollevents' maybe ?"
234+
# haproxy >= 2.9
235+
#events_max_events_at_once: 10000
236+
fail_alloc: false
237+
# haproxy error: fd_edge_triggered
238+
# 'tune.fd.edge-triggered' directive is experimental, must be allowed via a global 'expose-experimental-directives'"
239+
# experimental feature
240+
#fd_edge_triggered: "disabled"
241+
h2_be_initial_window_size: 0
242+
h2_be_max_concurrent_streams: 0
243+
h2_fe_initial_window_size: 0
244+
h2_fe_max_concurrent_streams: 0
245+
h2_header_table_size: 0
246+
h2_initial_window_size: 0
247+
h2_max_concurrent_streams: 0
248+
h2_max_frame_size: 0
249+
http_cookielen: 0
250+
http_logurilen: 0
251+
http_maxhdr: 100
252+
idle_pool_shared: "disabled"
253+
idletimer: 0
254+
listener_default_shards: "by-process"
255+
listener_multi_queue: "disabled"
256+
lua_burst_timeout: 0
257+
lua_forced_yield: 0
258+
lua_log_loggers: "disabled"
259+
lua_log_stderr: "disabled"
260+
lua_maxmem: false
261+
lua_service_timeout: 0
262+
lua_session_timeout: 0
263+
lua_task_timeout: 0
264+
# haproxy error: max_checks_per_thread
265+
# unknown keyword 'tune.max-checks-per-thread' in 'global' section; did you mean 'max-spread-checks' maybe ?"
266+
# haproxy >= 2.9
267+
#max_checks_per_thread: 0
268+
maxaccept: 0
269+
maxpollevents: 0
270+
maxrewrite: 0
271+
memory_hot_size: 7
272+
pattern_cache_size: 0
273+
peers_max_updates_at_once: 0
274+
pipesize: 0
275+
pool_high_fd_ratio: 0
276+
pool_low_fd_ratio: 0
277+
quic_frontend_conn_tx_buffers_limit: 7
278+
quic_frontend_max_idle_timeout: 0
279+
quic_frontend_max_streams_bidi: 8
280+
quic_max_frame_loss: 10
281+
quic_retry_threshold: 10
282+
quic_socket_owner: "connection"
283+
# haproxy error: rcvbuf_backend, rcvbuf_frontend
284+
# unknown keyword 'tune.rcvbuf.backend' in 'global' section; did you mean 'tune.rcvbuf.client' maybe ?"
285+
# haproxy >= 2.9
286+
#rcvbuf_backend: 0
287+
rcvbuf_client: 0
288+
#rcvbuf_frontend: 0
289+
rcvbuf_server: 0
290+
recv_enough: 0
291+
runqueue_depth: 0
292+
sched_low_latency: "disabled"
293+
# haproxy error: sndbuf_backend, sndbuf_frontend
294+
# unknown keyword 'tune.sndbuf.backend' in 'global' section;
295+
# unknown keyword 'tune.sndbuf.frontend' in 'global' section;
296+
# haproxy >= 2.9
297+
#sndbuf_backend: 0
298+
sndbuf_client: 0
299+
#sndbuf_frontend: 0
300+
sndbuf_server: 0
301+
ssl_cachesize: 0
302+
ssl_capture_buffer_size: 0
303+
ssl_ctx_cache_size: 0
304+
ssl_default_dh_param: 0
305+
ssl_force_private_cache: false
306+
ssl_keylog: "disabled"
307+
ssl_lifetime: 0
308+
ssl_maxrecord: 0
309+
ssl_ocsp_update_max_delay: 0
310+
ssl_ocsp_update_min_delay: 0
311+
stick_counters: 0
312+
vars_global_max_size: 0
313+
vars_proc_max_size: 0
314+
vars_reqres_max_size: 0
315+
vars_sess_max_size: 0
316+
vars_txn_max_size: 0
317+
# haproxy error: zlib_memlevel, zlib_windowsize
318+
# unknown keyword 'tune.zlib.memlevel' in 'global' section;
319+
# unknown keyword 'tune.zlib.windowsize' in 'global' section;
320+
# haproxy >= 2.9
321+
#zlib_memlevel: 1
322+
#zlib_windowsize: 8
323+
tune_ssl_default_dh_param: 0
324+
uid: 0
325+
ulimit_n: 0
326+
unsetenv: ""
327+
user: "root"
328+
wurfl_options:
329+
cache_size: 0
330+
data_file: ""
331+
information_list: ""
332+
information_list_separator: ""
333+
patch_file: ""
334+
zero_warning: false
335+
log_targets:
336+
- address: "1.2.3.4"
337+
facility: "mail"
338+
format: "rfc3164"
339+
global: false
340+
index: 0
341+
length: 0
342+
level: "emerg"
343+
minlevel: "debug"
344+
nolog: false
345+
sample_range: ""
346+
sample_size: 0

deploy/tests/e2e/crd/cr_deploy_validation_test.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,22 @@
1616

1717
package crd
1818

19-
func (suite *CRDSuite) Test_CRD_Deploy_OK() {
19+
import (
20+
"testing"
21+
22+
"github.com/stretchr/testify/suite"
23+
)
24+
25+
// Adding GlobalSuite, just to be able to debug directly here and not from CRDSuite
26+
type DeployCRDSuite struct {
27+
CRDSuite
28+
}
29+
30+
func TestDeployCRDSuite(t *testing.T) {
31+
suite.Run(t, new(DeployCRDSuite))
32+
}
33+
34+
func (suite *DeployCRDSuite) Test_CRD_Deploy_OK() {
2035
suite.Run("CRs OK", func() {
2136
suite.tmplData.BackendHashTypeFunction = "sdbm" // enum ok
2237
suite.tmplData.GlobalBuffersReserve = 3 // min ok
@@ -28,7 +43,7 @@ func (suite *CRDSuite) Test_CRD_Deploy_OK() {
2843
})
2944
}
3045

31-
func (suite *CRDSuite) Test_CRD_Deploy_NOK() {
46+
func (suite *DeployCRDSuite) Test_CRD_Deploy_NOK() {
3247
suite.Run("CRs Enum NOK", func() {
3348
suite.tmplData.BackendHashTypeFunction = "somethingelse" // enum NOK
3449
suite.tmplData.GlobalBuffersReserve = 3 // min ok

0 commit comments

Comments
 (0)