Use a FQDN hostname as an invalid hostname

On some networks, it's possible to have a DNS search domain pushed that
might make what is an invalid hostname succeed a DNS query.
In this case, invalid.com has a wildcard DNS entry and it would make this
test fail. Using a FQDN instead prevents search domains from being used.

Bug: none
Change-Id: I013f012db147b9c428b18d60e94a615153f199a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237810
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35355}
This commit is contained in:
Florent Castelli 2021-11-16 12:50:13 +01:00 committed by WebRTC LUCI CQ
parent 4cbfe4192c
commit c09b14c3c5

View File

@ -76,7 +76,7 @@ static const SocketAddress kTurnIPv6IntAddr(
static const SocketAddress kTurnUdpIPv6IntAddr(
"2400:4030:1:2c00:be30:abcd:efab:cdef",
cricket::TURN_SERVER_PORT);
static const SocketAddress kTurnInvalidAddr("www.google.invalid", 3478);
static const SocketAddress kTurnInvalidAddr("www.google.invalid.", 3478);
static const char kCandidateFoundation[] = "foundation";
static const char kIceUfrag1[] = "TESTICEUFRAG0001";
@ -1625,8 +1625,7 @@ TEST_F(TurnPortTest, TestResolverShutdown) {
int last_fd_count = GetFDCount();
// Need to supply unresolved address to kick off resolver.
CreateTurnPort(kLocalIPv6Addr, kTurnUsername, kTurnPassword,
ProtocolAddress(rtc::SocketAddress("www.google.invalid", 3478),
PROTO_UDP));
ProtocolAddress(kTurnInvalidAddr, PROTO_UDP));
turn_port_->PrepareAddress();
ASSERT_TRUE_WAIT(turn_error_, kResolverTimeout);
EXPECT_TRUE(turn_port_->Candidates().empty());