diff --git a/internal/configs/ingress_test.go b/internal/configs/ingress_test.go index 7d689856bf..0da7f9ac25 100644 --- a/internal/configs/ingress_test.go +++ b/internal/configs/ingress_test.go @@ -163,8 +163,8 @@ func TestGenerateNginxCfgWithIPV6Disabled(t *testing.T) { result, warnings := generateNginxCfg(&cafeIngressEx, nil, nil, false, configParams, isPlus, false, &StaticConfigParams{DisableIPV6: true}, false) - if diff := cmp.Diff(expected, result); diff != "" { - t.Errorf("generateNginxCfg() returned unexpected result (-want +got):\n%s", diff) + if !cmp.Equal(expected, result) { + t.Errorf("generateNginxCfg() returned unexpected result (-want +got):\n%s", cmp.Diff(expected, result)) } if len(warnings) != 0 { t.Errorf("generateNginxCfg() returned warnings: %v", warnings) diff --git a/tests/suite/test_disable_ipv6_ingress.py b/tests/suite/test_disable_ipv6_ingress.py index 7993004c9c..7fca5ac093 100644 --- a/tests/suite/test_disable_ipv6_ingress.py +++ b/tests/suite/test_disable_ipv6_ingress.py @@ -1,5 +1,4 @@ import pytest - from settings import TEST_DATA from suite.fixtures import PublicEndpoint from suite.resources_utils import ( @@ -33,12 +32,7 @@ class DisableIPV6Setup: namespace (str): """ - def __init__(self, - public_endpoint: PublicEndpoint, - ingress_name, - ingress_host, - ingress_pod_name, - namespace): + def __init__(self, public_endpoint: PublicEndpoint, ingress_name, ingress_host, ingress_pod_name, namespace): self.public_endpoint = public_endpoint self.ingress_host = ingress_host self.ingress_name = ingress_name @@ -47,22 +41,26 @@ def __init__(self, @pytest.fixture(scope="class", params=["standard", "mergeable"]) -def disable_ipv6_setup(request, - kube_apis, - ingress_controller_prerequisites, - ingress_controller_endpoint, - ingress_controller, - test_namespace - ) -> DisableIPV6Setup: +def disable_ipv6_setup( + request, + kube_apis, + ingress_controller_prerequisites, + ingress_controller_endpoint, + ingress_controller, + test_namespace, +) -> DisableIPV6Setup: print("------------------------- Deploy Disable IPV6 Example -----------------------------------") - secret_name = create_secret_from_yaml(kube_apis.v1, test_namespace, - f"{TEST_DATA}/disable-ipv6-ingress/disable-ipv6-secret.yaml") + secret_name = create_secret_from_yaml( + kube_apis.v1, test_namespace, f"{TEST_DATA}/disable-ipv6-ingress/disable-ipv6-secret.yaml" + ) - create_items_from_yaml(kube_apis, f"{TEST_DATA}/disable-ipv6-ingress/{request.param}/disable-ipv6-ingress.yaml", - test_namespace) + create_items_from_yaml( + kube_apis, f"{TEST_DATA}/disable-ipv6-ingress/{request.param}/disable-ipv6-ingress.yaml", test_namespace + ) ingress_name = get_name_from_yaml(f"{TEST_DATA}/disable-ipv6-ingress/{request.param}/disable-ipv6-ingress.yaml") ingress_host = get_first_ingress_host_from_yaml( - f"{TEST_DATA}/disable-ipv6-ingress/{request.param}/disable-ipv6-ingress.yaml") + f"{TEST_DATA}/disable-ipv6-ingress/{request.param}/disable-ipv6-ingress.yaml" + ) create_example_app(kube_apis, "simple", test_namespace) wait_until_all_pods_are_ready(kube_apis.v1, test_namespace) @@ -76,35 +74,30 @@ def disable_ipv6_setup(request, def fin(): print("Clean up the Disable IPV6 Application:") delete_common_app(kube_apis, "simple", test_namespace) - delete_items_from_yaml(kube_apis, f"{TEST_DATA}/disable-ipv6-ingress/{request.param}/disable-ipv6-ingress.yaml", - test_namespace) + delete_items_from_yaml( + kube_apis, f"{TEST_DATA}/disable-ipv6-ingress/{request.param}/disable-ipv6-ingress.yaml", test_namespace + ) delete_secret(kube_apis.v1, secret_name, test_namespace) request.addfinalizer(fin) - return DisableIPV6Setup(ingress_controller_endpoint, - ingress_name, - ingress_host, - ic_pod_name, - test_namespace) + return DisableIPV6Setup(ingress_controller_endpoint, ingress_name, ingress_host, ic_pod_name, test_namespace) @pytest.mark.ingresses class TestDisableIPV6: - @pytest.mark.parametrize( "ingress_controller", [ pytest.param({"extra_args": ["-disable-ipv6"]}, id="one-additional-cli-args"), - ], indirect=True, ) def test_ipv6_listeners_not_in_config( - self, - kube_apis, - disable_ipv6_setup: DisableIPV6Setup, - ingress_controller_prerequisites, + self, + kube_apis, + disable_ipv6_setup: DisableIPV6Setup, + ingress_controller_prerequisites, ): wait_before_test() nginx_config = get_nginx_template_conf(kube_apis.v1, ingress_controller_prerequisites.namespace)