@@ -69,7 +69,7 @@ def assert_specific_keys_for_nginx_plus(config, expected_values):
69
69
assert f"server_tokens \" { expected_values ['server-tokens' ]} \" ;" in config
70
70
assert "random two least_conn;" not in config \
71
71
and expected_values ['lb-method' ] in config
72
- assert "zone " in config and " 256k ;" in config
72
+ assert "zone " in config and " 512k ;" in config
73
73
74
74
75
75
def assert_specific_keys_for_nginx_oss (config , expected_values ):
@@ -79,8 +79,15 @@ def assert_specific_keys_for_nginx_oss(config, expected_values):
79
79
and expected_values ['lb-method' ] in config
80
80
assert "zone " not in config and " 256k;" not in config
81
81
82
+ def assert_defaults_of_keys_with_validation_for_nginx_plus (config , unexpected_values ):
83
+ assert_common_defaults_of_keys_with_validation (config , unexpected_values )
84
+ assert "zone " in config and " 512k;" in config
85
+
86
+ def assert_defaults_of_keys_with_validation_for_nginx_oss (config , unexpected_values ):
87
+ assert_common_defaults_of_keys_with_validation (config , unexpected_values )
88
+ assert "zone " in config and " 256k;" in config
82
89
83
- def assert_defaults_of_keys_with_validation (config , unexpected_values ):
90
+ def assert_common_defaults_of_keys_with_validation (config , unexpected_values ):
84
91
assert "proxy_buffering on;" in config
85
92
assert "real_ip_recursive" not in config
86
93
assert "max_fails=1" in config
@@ -89,7 +96,6 @@ def assert_defaults_of_keys_with_validation(config, unexpected_values):
89
96
assert "server_tokens \" on\" " in config
90
97
assert "random two least_conn;" in config and unexpected_values ['lb-method' ] not in config
91
98
assert f"proxy_send_timeout 60s;" in config
92
- assert "zone " in config and " 256k;" in config
93
99
94
100
95
101
def assert_defaults_of_keys_with_validation_in_main_config (config , unexpected_values ):
@@ -222,7 +228,10 @@ def test_keys(self, cli_arguments, kube_apis, ingress_controller_prerequisites,
222
228
ingress_controller_prerequisites .namespace )
223
229
step_4_events = get_events (kube_apis .v1 , virtual_server_setup .namespace )
224
230
assert_update_event_count_increased (virtual_server_setup , step_4_events , step_3_events )
225
- assert_defaults_of_keys_with_validation (step_4_config , expected_values )
231
+ if cli_arguments ['ic-type' ] == "nginx-ingress" :
232
+ assert_defaults_of_keys_with_validation_for_nginx_oss (step_4_config , expected_values )
233
+ else :
234
+ assert_defaults_of_keys_with_validation_for_nginx_plus (step_4_config , expected_values )
226
235
227
236
def test_keys_in_main_config (self , cli_arguments , kube_apis , ingress_controller_prerequisites ,
228
237
crd_ingress_controller , virtual_server_setup , clean_up ):
0 commit comments