Skip to content

Commit

Permalink
fv: icmp related workload-workload
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastigera committed Apr 16, 2020
1 parent e4759c1 commit 14b7721
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion fv/bpf_test.go
Expand Up @@ -1253,7 +1253,7 @@ func describeBPFTests(opts ...bpfTestOpt) bool {
})

Describe("with wrong target port", func() {
// TCP would send RST instead of ICMP, it is enough to test one wa of
// TCP would send RST instead of ICMP, it is enough to test one way of
// triggering the ICMP message
if testOpts.protocol != "udp" {
return
Expand Down Expand Up @@ -1282,6 +1282,21 @@ func describeBPFTests(opts ...bpfTestOpt) bool {
Eventually(func() int { return tcpdump.MatchCount("ICMP") }).
Should(BeNumerically(">", 0), matcher)
})

It("should get port unreachable workload to workload", func() {
tcpdump := w[1][1].AttachTCPDump()
tcpdump.SetLogEnabled(true)
matcher := fmt.Sprintf("IP %s > %s: ICMP %s udp port %d unreachable",
tgtWorkload.IP, w[1][1].IP, tgtWorkload.IP, tgtPort)
tcpdump.AddMatcher("ICMP", regexp.MustCompile(matcher))
tcpdump.Start(testOpts.protocol, "port", strconv.Itoa(tgtPort), "or", "icmp")
defer tcpdump.Stop()

cc.ExpectNone(w[1][1], TargetIP(tgtWorkload.IP), uint16(tgtPort))
cc.CheckConnectivity()
Eventually(func() int { return tcpdump.MatchCount("ICMP") }).
Should(BeNumerically(">", 0), matcher)
})
})
})
})
Expand Down

0 comments on commit 14b7721

Please sign in to comment.