Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Hang Yan <[email protected]>
  • Loading branch information
hangyan committed Nov 20, 2024
1 parent 76f1930 commit 7f6c975
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/e2e/packetcapture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ func runPacketCaptureTest(t *testing.T, data *TestData, tc pcTestCase) {
antreaPodName, err := data.getAntreaPodOnNode(nodeName(0))
require.NoError(t, err)
fileName := fmt.Sprintf("%s.pcapng", tc.pc.Name)
dstFileName := filepath.Join(os.TempDir(), fileName)
dstFileName := filepath.Join(t.TempDir(), fileName)
packetFile := filepath.Join("/tmp", "antrea", "packetcapture", "packets", fileName)
require.NoError(t, data.copyPodFiles(antreaPodName, "antrea-agent", "kube-system", packetFile, os.TempDir()))
defer os.Remove(dstFileName)
Expand Down Expand Up @@ -727,13 +727,13 @@ func verifyPacketFile(t *testing.T, pc *crdv1alpha1.PacketCapture, reader io.Rea
assert.Equal(t, dstIP.String(), ip.DstIP.String())

if pc.Spec.Packet == nil {
return nil
continue
}

packetSpec := pc.Spec.Packet
proto := packetSpec.Protocol
if proto == nil {
return nil
continue
}
if strings.ToUpper(proto.StrVal) == "TCP" || proto.IntVal == 6 {
tcpLayer := packet.Layer(layers.LayerTypeTCP)
Expand Down

0 comments on commit 7f6c975

Please sign in to comment.