diff --git a/test/e2e/iptables-vpc-nat-gw/e2e_test.go b/test/e2e/iptables-vpc-nat-gw/e2e_test.go index d51c6c9173d..6e63bf6049a 100644 --- a/test/e2e/iptables-vpc-nat-gw/e2e_test.go +++ b/test/e2e/iptables-vpc-nat-gw/e2e_test.go @@ -193,8 +193,6 @@ var _ = framework.Describe("[group:iptables-vpc-nat-gw]", func() { var iptablesDnatRuleClient *framework.IptablesDnatClient var dockerExtNet1Network *dockertypes.NetworkResource - var containerID string - var image string var net1NicName string // multiple external network case @@ -238,7 +236,6 @@ var _ = framework.Describe("[group:iptables-vpc-nat-gw]", func() { net2EipName = "net2-eip-" + framework.RandomSuffix() ginkgo.BeforeEach(func() { - containerID = "" cs = f.ClientSet attachNetClient = f.NetworkAttachmentDefinitionClientNS(framework.KubeOvnNamespace) subnetClient = f.SubnetClient() @@ -251,10 +248,6 @@ var _ = framework.Describe("[group:iptables-vpc-nat-gw]", func() { iptablesSnatRuleClient = f.IptablesSnatClient() iptablesDnatRuleClient = f.IptablesDnatClient() - if image == "" { - image = framework.GetKubeOvnImage(cs) - } - if skip { ginkgo.Skip("underlay spec only runs on kind clusters") } @@ -335,12 +328,6 @@ var _ = framework.Describe("[group:iptables-vpc-nat-gw]", func() { }) ginkgo.AfterEach(func() { - if containerID != "" { - ginkgo.By("Deleting container " + containerID) - err := docker.ContainerRemove(containerID) - framework.ExpectNoError(err) - } - ginkgo.By("Deleting macvlan underlay subnet " + networkAttachDefName) subnetClient.DeleteSync(networkAttachDefName) @@ -1035,8 +1022,6 @@ var _ = framework.Describe("[group:qos-policy]", func() { var iptablesFIPClient *framework.IptablesFIPClient var qosPolicyClient *framework.QoSPolicyClient - var containerID string - var image string var net1NicName string var dockerExtNetName string @@ -1082,7 +1067,6 @@ var _ = framework.Describe("[group:qos-policy]", func() { vpcQosParams.attachDefName = "qos-ovn-vpc-external-network-" + framework.RandomSuffix() vpcQosParams.subnetProvider = fmt.Sprintf("%s.%s", vpcQosParams.attachDefName, framework.KubeOvnNamespace) - containerID = "" cs = f.ClientSet podClient = f.PodClient() attachNetClient = f.NetworkAttachmentDefinitionClientNS(framework.KubeOvnNamespace) @@ -1093,9 +1077,6 @@ var _ = framework.Describe("[group:qos-policy]", func() { ipClient = f.IPClient() iptablesFIPClient = f.IptablesFIPClient() qosPolicyClient = f.QoSPolicyClient() - if image == "" { - image = framework.GetKubeOvnImage(cs) - } if skip { ginkgo.Skip("underlay spec only runs on kind clusters") @@ -1158,12 +1139,6 @@ var _ = framework.Describe("[group:qos-policy]", func() { }) ginkgo.AfterEach(func() { - if containerID != "" { - ginkgo.By("Deleting container " + containerID) - err := docker.ContainerRemove(containerID) - framework.ExpectNoError(err) - } - ginkgo.By("Deleting macvlan underlay subnet " + vpcQosParams.attachDefName) subnetClient.DeleteSync(vpcQosParams.attachDefName) diff --git a/test/e2e/kube-ovn/pod/vpc_pod_probe.go b/test/e2e/kube-ovn/pod/vpc_pod_probe.go index d8882e0f1ae..ac58d1fe593 100644 --- a/test/e2e/kube-ovn/pod/vpc_pod_probe.go +++ b/test/e2e/kube-ovn/pod/vpc_pod_probe.go @@ -56,15 +56,11 @@ var _ = framework.SerialDescribe("[group:pod]", func() { ginkgo.By("Deleting subnet " + subnetName) subnetClient.DeleteSync(subnetName) - if vpcName != "" { - ginkgo.By("Deleting custom vpc " + vpcName) - vpcClient.DeleteSync(vpcName) - } + ginkgo.By("Deleting custom vpc " + vpcName) + vpcClient.DeleteSync(vpcName) - if len(extraSubnetNames) != 0 { - for _, subnetName := range extraSubnetNames { - subnetClient.DeleteSync(subnetName) - } + for _, subnetName := range extraSubnetNames { + subnetClient.DeleteSync(subnetName) } }) diff --git a/test/e2e/kube-ovn/subnet/subnet.go b/test/e2e/kube-ovn/subnet/subnet.go index dafea129302..2ff5a1dc6e6 100644 --- a/test/e2e/kube-ovn/subnet/subnet.go +++ b/test/e2e/kube-ovn/subnet/subnet.go @@ -121,10 +121,8 @@ var _ = framework.Describe("[group:subnet]", func() { } }) ginkgo.AfterEach(func() { - if deployName != "" { - ginkgo.By("Deleting deployment " + deployName) - deployClient.DeleteSync(deployName) - } + ginkgo.By("Deleting deployment " + deployName) + deployClient.DeleteSync(deployName) for i := 1; i <= podCount; i++ { podName := fmt.Sprintf("%s-%d", podNamePrefix, i) diff --git a/test/e2e/ovn-vpc-nat-gw/e2e_test.go b/test/e2e/ovn-vpc-nat-gw/e2e_test.go index 45d58e09bcf..896269d7e75 100644 --- a/test/e2e/ovn-vpc-nat-gw/e2e_test.go +++ b/test/e2e/ovn-vpc-nat-gw/e2e_test.go @@ -95,16 +95,12 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() { var ovnDnatRuleClient *framework.OvnDnatRuleClient var podClient *framework.PodClient - var aapVip1Name, aapVip2Name string var lrpEipSnatName, lrpExtraEipSnatName string - var dnatVipName, dnatEipName, dnatName string - var fipVipName, fipEipName, fipName string - var snatEipName, snatName string + var fipName string var ipDnatVipName, ipDnatEipName, ipDnatName string var ipFipVipName, ipFipEipName, ipFipName string var cidrSnatEipName, cidrSnatName, ipSnatVipName, ipSnatEipName, ipSnatName string - var containerID string var image, namespaceName string var sharedVipName, sharedEipDnatName, sharedEipFipShoudOkName, sharedEipFipShoudFailName string @@ -135,21 +131,9 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() { noBfdVpcName = "no-bfd-vpc-" + framework.RandomSuffix() bfdVpcName = "bfd-vpc-" + framework.RandomSuffix() - // test allow address pair vip - aapVip1Name = "aap-vip1-" + framework.RandomSuffix() - aapVip2Name = "aap-vip2-" + framework.RandomSuffix() - // nats use ip crd name or vip crd - fipVipName = "fip-vip-" + framework.RandomSuffix() - fipEipName = "fip-eip-" + framework.RandomSuffix() fipName = "fip-" + framework.RandomSuffix() - dnatVipName = "dnat-vip-" + framework.RandomSuffix() - dnatEipName = "dnat-eip-" + framework.RandomSuffix() - dnatName = "dnat-" + framework.RandomSuffix() - - snatEipName = "snat-eip-" + framework.RandomSuffix() - snatName = "snat-" + framework.RandomSuffix() noBfdSubnetName = "no-bfd-subnet-" + framework.RandomSuffix() noBfdExtraSubnetName = "no-bfd-extra-subnet-" + framework.RandomSuffix() lrpEipSnatName = "lrp-eip-snat-" + framework.RandomSuffix() @@ -195,7 +179,6 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() { ipSnatEipName = "ip-snat-eip-" + framework.RandomSuffix() ipSnatName = "ip-snat-" + framework.RandomSuffix() - containerID = "" if image == "" { image = framework.GetKubeOvnImage(cs) } @@ -360,30 +343,8 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() { }) ginkgo.AfterEach(func() { - if containerID != "" { - ginkgo.By("Deleting container " + containerID) - err := docker.ContainerRemove(containerID) - framework.ExpectNoError(err) - } - ginkgo.By("Deleting ovn fip " + fipName) ovnFipClient.DeleteSync(fipName) - ginkgo.By("Deleting ovn dnat " + dnatName) - ovnDnatRuleClient.DeleteSync(dnatName) - ginkgo.By("Deleting ovn snat " + snatName) - ovnSnatRuleClient.DeleteSync(snatName) - - ginkgo.By("Deleting ovn fip " + fipEipName) - ovnFipClient.DeleteSync(fipEipName) - ginkgo.By("Deleting ovn eip " + dnatEipName) - ovnEipClient.DeleteSync(dnatEipName) - ginkgo.By("Deleting ovn eip " + snatEipName) - ovnEipClient.DeleteSync(snatEipName) - - ginkgo.By("Deleting ovn allowed address pair vip " + aapVip1Name) - vipClient.DeleteSync(aapVip1Name) - ginkgo.By("Deleting ovn allowed address pair vip " + aapVip2Name) - vipClient.DeleteSync(aapVip2Name) // clean up share eip case resource ginkgo.By("Deleting share ovn dnat " + sharedEipDnatName) @@ -425,12 +386,6 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() { ginkgo.By("Deleting ovn vip " + ipSnatVipName) vipClient.DeleteSync(ipSnatVipName) - ginkgo.By("Deleting ovn vip " + aapVip2Name) - vipClient.DeleteSync(aapVip2Name) - ginkgo.By("Deleting ovn vip " + dnatVipName) - vipClient.DeleteSync(dnatVipName) - ginkgo.By("Deleting ovn vip " + fipVipName) - vipClient.DeleteSync(fipVipName) ginkgo.By("Deleting ovn share vip " + sharedVipName) vipClient.DeleteSync(sharedVipName)