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

Function TestFindExternalIPExplicitMapping

external_ip_mapper_test.go:547–563  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

545}
546
547func TestFindExternalIPExplicitMapping(t *testing.T) {
548 mapper, err := newAddressRewriteMapper([]AddressRewriteRule{
549 makeLocalRule("10.0.0.1", "1.2.3.4"),
550 makeLocalRule("10.0.0.2", "1.2.3.5"),
551 makeLocalRule("fe80::1", "2200::1"),
552 makeLocalRule("fe80::2", "2200::2"),
553 })
554 assert.NoError(t, err)
555 assert.NotNil(t, mapper)
556
557 assertExternalIPStrings(t, mapper, CandidateTypeHost, "10.0.0.1", "", "1.2.3.4")
558 assertExternalIPStrings(t, mapper, CandidateTypeHost, "10.0.0.2", "", "1.2.3.5")
559 assertNoExternalMapping(t, mapper, CandidateTypeHost, "10.0.0.3")
560 assertExternalIPStrings(t, mapper, CandidateTypeHost, "fe80::1", "", "2200::1")
561 assertExternalIPStrings(t, mapper, CandidateTypeHost, "fe80::2", "", "2200::2")
562 assertNoExternalMapping(t, mapper, CandidateTypeHost, "fe80::3")
563}
564
565func TestFindExternalIPServerReflexive(t *testing.T) {
566 mapper, err := newAddressRewriteMapper([]AddressRewriteRule{makeRule(CandidateTypeServerReflexive, "1.2.3.4")})

Callers

nothing calls this directly

Calls 4

newAddressRewriteMapperFunction · 0.85
makeLocalRuleFunction · 0.85
assertExternalIPStringsFunction · 0.85
assertNoExternalMappingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…