ZTC-234: macOS tests

This commit is contained in:
Joel May
2022-11-10 09:09:47 -08:00
parent 2baea15387
commit 6a1dad0ce2
4 changed files with 83 additions and 11 deletions

View File

@@ -8,6 +8,8 @@ import (
"testing"
"github.com/stretchr/testify/require"
"github.com/cloudflare/cloudflared/packet"
)
func TestSingleEchoIDTracker(t *testing.T) {
@@ -119,3 +121,9 @@ func (eit *echoIDTracker) get(key flow3Tuple) (id uint16, exist bool) {
id, exists := eit.mapping[key]
return id, exists
}
func getFunnel(t *testing.T, proxy *icmpProxy, tuple flow3Tuple) (packet.Funnel, bool) {
assignedEchoID, success := proxy.echoIDTracker.getOrAssign(tuple)
require.True(t, success)
return proxy.srcFunnelTracker.Get(echoFunnelID(assignedEchoID))
}