Skip to content

Commit

Permalink
e2e: add multicast receiver on same node as sender
Browse files Browse the repository at this point in the history
Signed-off-by: Riccardo Ravaioli <[email protected]>
  • Loading branch information
ricky-rav committed Jun 20, 2024
1 parent 7d981a1 commit 3e4ea4b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/e2e/multicast.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
mcastSource = "pod-client"
mcastServer1 = "pod-server1"
mcastServer2 = "pod-server2"
mcastServer3 = "pod-server3"
)

var _ = ginkgo.Describe("Multicast", func() {
Expand Down Expand Up @@ -119,6 +120,18 @@ var _ = ginkgo.Describe("Multicast", func() {
mcastServerPod2.Spec.NodeName = serverNodeInfo.name
e2epod.NewPodClient(fr).CreateSync(context.TODO(), mcastServerPod2)

// Start a multicast listener on the same groups and verify it received the traffic (iperf server is the multicast listener)
// join multicast group (-B 224.3.3.3), UDP (-u), during (-t 30) seconds, report every (-i 1) seconds
ginkgo.By("creating first multicast listener pod in node " + clientNodeInfo.name)
iperf = fmt.Sprintf("iperf -s -B %s -u -t 180 -i 5", mcastGroup)
if IsIPv6Cluster(cs) {
iperf = iperf + " -V"
}
cmd = []string{"/bin/sh", "-c", iperf}
mcastServerPod3 := newAgnhostPod(fr.Namespace.Name, mcastServer3, cmd...)
mcastServerPod3.Spec.NodeName = clientNodeInfo.name
e2epod.NewPodClient(fr).CreateSync(context.TODO(), mcastServerPod3)

ginkgo.By("checking if pod server1 received multicast traffic")
gomega.Eventually(func() (string, error) {
return e2epod.GetPodLogs(context.TODO(), cs, ns, mcastServer1, mcastServer1)
Expand All @@ -130,6 +143,13 @@ var _ = ginkgo.Describe("Multicast", func() {
return e2epod.GetPodLogs(context.TODO(), cs, ns, mcastServer2, mcastServer2)
},
30*time.Second, 1*time.Second).ShouldNot(gomega.ContainSubstring("connected"))

ginkgo.By("checking if pod server3 received multicast traffic")
gomega.Eventually(func() (string, error) {
return e2epod.GetPodLogs(context.TODO(), cs, ns, mcastServer3, mcastServer3)
},
30*time.Second, 1*time.Second).Should(gomega.ContainSubstring("connected"))

})

})
Expand Down

0 comments on commit 3e4ea4b

Please sign in to comment.