Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
Signed-off-by: clyi <[email protected]>
  • Loading branch information
changluyi committed Dec 26, 2024
1 parent 4819e15 commit 516ab60
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/e2e/multus/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"flag"
"fmt"
"strings"
"testing"

nadv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
Expand Down Expand Up @@ -513,8 +514,9 @@ var _ = framework.SerialDescribe("[group:multus]", func() {
ginkgo.By("Creating pod " + podName)
mac := "00:00:00:11:22:33"
randomIP := framework.RandomIPs(subnet.Spec.CIDRBlock, "", 1)
requestIP := strings.Split(randomIP, ",")[0]

annotations := map[string]string{nadv1.NetworkAttachmentAnnot: fmt.Sprintf(`[{"name": "%s", "namespace": "%s", "mac": "%s", "ips": ["%s"]}]`, nad.Name, nad.Namespace, mac, randomIP)}
annotations := map[string]string{nadv1.NetworkAttachmentAnnot: fmt.Sprintf(`[{"name": "%s", "namespace": "%s", "mac": "%s", "ips": ["%s"]}]`, nad.Name, nad.Namespace, mac, requestIP)}
annotations[fmt.Sprintf(util.LogicalSwitchAnnotationTemplate, provider)] = subnetName

cmd := []string{"sh", "-c", "sleep infinity"}
Expand All @@ -528,6 +530,6 @@ var _ = framework.SerialDescribe("[group:multus]", func() {
retIP := pod.Annotations[fmt.Sprintf(util.IPAddressAnnotationTemplate, provider)]

framework.ExpectEqual(mac, retMac)
framework.ExpectEqual(randomIP, retIP)
framework.ExpectEqual(requestIP, retIP)
})
})

0 comments on commit 516ab60

Please sign in to comment.