@@ -67,24 +67,15 @@ def assert_specific_keys_for_nginx_oss(config, expected_values):
67
67
and expected_values ['lb-method' ] in config
68
68
69
69
70
- def assert_defaults_of_keys_with_validation (config ):
70
+ def assert_defaults_of_keys_with_validation (config , unexpected_values ):
71
71
assert "proxy_buffering on;" in config
72
72
assert "real_ip_recursive" not in config
73
73
assert "max_fails=1" in config
74
74
assert "keepalive" not in config
75
75
assert "listen 80;" in config
76
76
assert "if ($http_x_forwarded_proto = 'http') {" not in config
77
-
78
-
79
- def assert_defaults_of_specific_keys_for_nginx_plus (config , expected_values ):
80
- assert f"server_tokens \" { expected_values ['server-tokens' ]} \" " in config
81
- assert "random two least_conn;" in config and expected_values ['lb-method' ] not in config
82
-
83
-
84
- def assert_defaults_of_specific_keys_for_nginx_oss (config , expected_values ):
85
77
assert "server_tokens \" on\" " in config
86
- assert "random two least_conn;" in config \
87
- and expected_values ['lb-method' ] not in config
78
+ assert "random two least_conn;" in config and unexpected_values ['lb-method' ] not in config
88
79
89
80
90
81
def assert_ssl_keys (config ):
@@ -207,12 +198,7 @@ def test_keys(self, cli_arguments, kube_apis, ingress_controller_prerequisites,
207
198
ingress_controller_prerequisites .namespace )
208
199
step_4_events = get_events (kube_apis .v1 , virtual_server_setup .namespace )
209
200
assert_valid_event_count_increased (virtual_server_setup , step_4_events , step_3_events )
210
- assert_defaults_of_keys_with_validation (step_4_config )
211
- # to cover the OSS case, this will be changed in the future
212
- if cli_arguments ['ic-type' ] == "nginx-ingress" :
213
- assert_defaults_of_specific_keys_for_nginx_oss (step_4_config , expected_values )
214
- else :
215
- assert_defaults_of_specific_keys_for_nginx_plus (step_4_config , expected_values )
201
+ assert_defaults_of_keys_with_validation (step_4_config , expected_values )
216
202
217
203
218
204
@pytest .mark .parametrize ('crd_ingress_controller, virtual_server_setup' ,
0 commit comments