From f97eaa6cabc751013144918f65354d595e093d85 Mon Sep 17 00:00:00 2001 From: "xiayu.lyt" Date: Thu, 17 Oct 2024 15:56:39 +0800 Subject: [PATCH] fix e2e test compile error and failure Signed-off-by: xiayu.lyt --- test/e2e/testcase/service/nlbv2/listener.go | 20 ------------------- .../testcase/service/nlbv2/loadbalancer.go | 6 +++--- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/test/e2e/testcase/service/nlbv2/listener.go b/test/e2e/testcase/service/nlbv2/listener.go index 16cb21171..5285df467 100644 --- a/test/e2e/testcase/service/nlbv2/listener.go +++ b/test/e2e/testcase/service/nlbv2/listener.go @@ -417,26 +417,6 @@ func RunListenerTestCases(f *framework.Framework) { gomega.Expect(err).To(gomega.BeNil()) }) - ginkgo.It("alpn: off -> on without alpn-policy", func() { - oldsvc, err := f.Client.KubeClient.CreateNLBServiceByAnno(map[string]string{ - annotation.Annotation(annotation.LoadBalancerId): options.TestConfig.InternetNetworkLoadBalancerID, - annotation.Annotation(annotation.ProtocolPort): "tcpssl:443", - annotation.Annotation(annotation.CertID): options.TestConfig.NLBCertID, - annotation.Annotation(annotation.OverrideListener): "true", - annotation.Annotation(annotation.AlpnEnabled): string(model.OffFlag), - }) - gomega.Expect(err).To(gomega.BeNil()) - err = f.ExpectNetworkLoadBalancerEqual(oldsvc) - gomega.Expect(err).To(gomega.BeNil()) - - newsvc := oldsvc.DeepCopy() - newsvc.Annotations[annotation.Annotation(annotation.AlpnEnabled)] = string(model.OnFlag) - newsvc, err = f.Client.KubeClient.PatchService(oldsvc, newsvc) - gomega.Expect(err).To(gomega.BeNil()) - err = f.ExpectNetworkLoadBalancerEqual(newsvc) - gomega.Expect(err).NotTo(gomega.BeNil()) - }) - ginkgo.It("alpn: on -> off", func() { oldsvc, err := f.Client.KubeClient.CreateNLBServiceByAnno(map[string]string{ annotation.Annotation(annotation.LoadBalancerId): options.TestConfig.InternetNetworkLoadBalancerID, diff --git a/test/e2e/testcase/service/nlbv2/loadbalancer.go b/test/e2e/testcase/service/nlbv2/loadbalancer.go index 99d48b2bb..2dc6d504d 100644 --- a/test/e2e/testcase/service/nlbv2/loadbalancer.go +++ b/test/e2e/testcase/service/nlbv2/loadbalancer.go @@ -8,7 +8,7 @@ import ( "k8s.io/cloud-provider-alibaba-cloud/pkg/controller/helper" "k8s.io/cloud-provider-alibaba-cloud/pkg/controller/service/reconcile/annotation" "k8s.io/cloud-provider-alibaba-cloud/pkg/model" - "k8s.io/cloud-provider-alibaba-cloud/pkg/model/nlb" + nlbmodel "k8s.io/cloud-provider-alibaba-cloud/pkg/model/nlb" "k8s.io/cloud-provider-alibaba-cloud/test/e2e/framework" "k8s.io/cloud-provider-alibaba-cloud/test/e2e/options" "strings" @@ -575,7 +575,7 @@ func RunLoadBalancerTestCases(f *framework.Framework) { _, nlb, err := f.FindNetworkLoadBalancer() gomega.Expect(err).To(gomega.BeNil()) key := helper.TAGKEY - err = f.Client.CloudClient.UntagNLBResources(context.TODO(), nlb.LoadBalancerAttribute.LoadBalancerId, nlb.LoadBalancerTagType, []*string{&key}) + err = f.Client.CloudClient.UntagNLBResources(context.TODO(), nlb.LoadBalancerAttribute.LoadBalancerId, nlbmodel.LoadBalancerTagType, []*string{&key}) gomega.Expect(err).To(gomega.BeNil()) err = f.Client.KubeClient.ScaleDeployment(0) @@ -610,7 +610,7 @@ func RunLoadBalancerTestCases(f *framework.Framework) { _, slb, err := f.FindNetworkLoadBalancer() gomega.Expect(err).To(gomega.BeNil()) key := helper.TAGKEY - err = f.Client.CloudClient.UntagNLBResources(context.TODO(), slb.LoadBalancerAttribute.LoadBalancerId, nlb.LoadBalancerTagType, []*string{&key}) + err = f.Client.CloudClient.UntagNLBResources(context.TODO(), slb.LoadBalancerAttribute.LoadBalancerId, nlbmodel.LoadBalancerTagType, []*string{&key}) gomega.Expect(err).To(gomega.BeNil()) err = f.Client.KubeClient.ScaleDeployment(0)