Skip to content

Commit

Permalink
e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Karol Szwaj <[email protected]>
  • Loading branch information
cnvergence committed Dec 5, 2024
1 parent 860b1aa commit 1c39f16
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/e2e/kube-ovn/ipam/ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ var _ = framework.Describe("[group:ipam]", func() {
ns := framework.MakeNamespace(newNamespaceName, nil, nsAnnotations)
nsClient.Create(ns)

ginkgo.By("Creating subnet " + subnetName)
cidr = framework.RandomCIDR(f.ClusterIPFamily)
newSubnet := framework.MakeSubnet(subnetName, "", cidr, "", "", "", nil, nil, []string{newNamespaceName})

Check failure on line 198 in test/e2e/kube-ovn/ipam/ipam.go

View workflow job for this annotation

GitHub Actions / Build kube-ovn

ineffectual assignment to newSubnet (ineffassign)
newSubnet = subnetClient.CreateSync(subnet)

ginkgo.By("Creating deployment " + deployName + " without IPPool")
labels := map[string]string{"app": deployName}
deploy := framework.MakeDeployment(deployName, int32(replicas), labels, nil, "pause", framework.PauseImage, "")
Expand All @@ -207,11 +212,11 @@ var _ = framework.Describe("[group:ipam]", func() {
ips := strings.Split(ippool, ippoolSep)
for _, pod := range pods.Items {
framework.ExpectHaveKeyWithValue(pod.Annotations, util.AllocatedAnnotation, "true")
framework.ExpectHaveKeyWithValue(pod.Annotations, util.CidrAnnotation, subnet.Spec.CIDRBlock)
framework.ExpectHaveKeyWithValue(pod.Annotations, util.GatewayAnnotation, subnet.Spec.Gateway)
framework.ExpectHaveKeyWithValue(pod.Annotations, util.CidrAnnotation, newSubnet.Spec.CIDRBlock)
framework.ExpectHaveKeyWithValue(pod.Annotations, util.GatewayAnnotation, newSubnet.Spec.Gateway)
framework.ExpectHaveKeyWithValue(pod.Annotations, util.IPPoolAnnotation, ippool)
framework.ExpectContainElement(ips, pod.Annotations[util.IPAddressAnnotation])
framework.ExpectHaveKeyWithValue(pod.Annotations, util.LogicalSwitchAnnotation, subnet.Name)
framework.ExpectHaveKeyWithValue(pod.Annotations, util.LogicalSwitchAnnotation, newSubnet.Name)
framework.ExpectMAC(pod.Annotations[util.MacAddressAnnotation])
framework.ExpectHaveKeyWithValue(pod.Annotations, util.RoutedAnnotation, "true")

Expand Down

0 comments on commit 1c39f16

Please sign in to comment.