MCPcopy Create free account
hub / github.com/pion/ice / TestRemoteDialIPForLocalInterface

Function TestRemoteDialIPForLocalInterface

agent_test.go:3177–3209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3175}
3176
3177func TestRemoteDialIPForLocalInterface(t *testing.T) {
3178 t.Run("adds local zone for zone-less link-local IPv6", func(t *testing.T) {
3179 remote := netip.MustParseAddr("fe80::1234")
3180 local := netip.MustParseAddr("fe80::1%eth0")
3181
3182 got := remoteDialIPForLocalInterface(remote, local)
3183 require.Equal(t, netip.MustParseAddr("fe80::1234%eth0"), got)
3184 })
3185
3186 t.Run("keeps existing remote zone", func(t *testing.T) {
3187 remote := netip.MustParseAddr("fe80::1234%eth9")
3188 local := netip.MustParseAddr("fe80::1%eth0")
3189
3190 got := remoteDialIPForLocalInterface(remote, local)
3191 require.Equal(t, remote, got)
3192 })
3193
3194 t.Run("does not modify global IPv6", func(t *testing.T) {
3195 remote := netip.MustParseAddr("2001:db8::1234")
3196 local := netip.MustParseAddr("fe80::1%eth0")
3197
3198 got := remoteDialIPForLocalInterface(remote, local)
3199 require.Equal(t, remote, got)
3200 })
3201
3202 t.Run("does not modify zone-less link-local when local has no zone", func(t *testing.T) {
3203 remote := netip.MustParseAddr("fe80::1234")
3204 local := netip.MustParseAddr("2001:db8::1")
3205
3206 got := remoteDialIPForLocalInterface(remote, local)
3207 require.Equal(t, remote, got)
3208 })
3209}
3210
3211func TestMDNSQueryTimeout(t *testing.T) {
3212 t.Run("falls back to default when unset", func(t *testing.T) {

Callers

nothing calls this directly

Calls 3

RunMethod · 0.80
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…