Skip to content

Commit

Permalink
Fix udp test
Browse files Browse the repository at this point in the history
  • Loading branch information
lixmal committed Dec 20, 2024
1 parent 8216ab6 commit 5d97cf8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/firewall/uspfilter/conntrack/udp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func TestUDPTracker_TrackOutbound(t *testing.T) {
tracker.TrackOutbound(srcIP, dstIP, srcPort, dstPort)

// Verify connection was tracked
conn, exists := tracker.connections[srcPort]
key := makeKey(srcIP, srcPort, dstIP, dstPort)
conn, exists := tracker.connections[key]
require.True(t, exists)
assert.True(t, conn.SourceIP.Equal(srcIP))
assert.True(t, conn.DestIP.Equal(dstIP))
Expand Down Expand Up @@ -156,7 +157,7 @@ func TestUDPTracker_Cleanup(t *testing.T) {

// Create tracker with custom cleanup interval
tracker := &UDPTracker{
connections: make(map[uint16]*UDPConnTrack),
connections: make(map[ConnKey]*UDPConnTrack),
timeout: timeout,
cleanupTicker: time.NewTicker(cleanupInterval),
done: make(chan struct{}),
Expand Down

0 comments on commit 5d97cf8

Please sign in to comment.