Loading tests/resolv_integration_test.cpp +4 −6 Original line number Diff line number Diff line Loading @@ -2414,13 +2414,16 @@ TEST_F(ResolverTest, Async_EmptyAnswer) { EXPECT_EQ(std::cv_status::no_timeout, cv.wait_for(lk, std::chrono::seconds(1))); } ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, 0, "howdy.example.com", {"::1.2.3.4"}); dns.setResponseProbability(0.0); int fd2 = resNetworkQuery(TEST_NETID, "howdy.example.com", ns_c_in, ns_t_a, 0); EXPECT_TRUE(fd2 != -1); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, RCODE_TIMEOUT, "howdy.example.com", {}); int fd3 = resNetworkQuery(TEST_NETID, "howdy.example.com", ns_c_in, ns_t_a, 0); EXPECT_TRUE(fd3 != -1); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, RCODE_TIMEOUT, "howdy.example.com", {}); uint8_t buf[MAXPACKET] = {}; int rcode; Loading @@ -2438,6 +2441,7 @@ TEST_F(ResolverTest, Async_EmptyAnswer) { int fd4 = resNetworkQuery(TEST_NETID, "howdy.example.com", ns_c_in, ns_t_a, 0); EXPECT_TRUE(fd4 != -1); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, 0, "howdy.example.com", {"1.2.3.4"}); memset(buf, 0, MAXPACKET); res = getAsyncResponse(fd4, &rcode, buf, MAXPACKET); Loading @@ -2448,12 +2452,6 @@ TEST_F(ResolverTest, Async_EmptyAnswer) { res = getAsyncResponse(fd1, &rcode, buf, MAXPACKET); EXPECT_GT(res, 0); EXPECT_EQ("::1.2.3.4", toString(buf, res, AF_INET6)); // Trailing dot is removed. Is it intended? ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, 0, "howdy.example.com", {"::1.2.3.4"}); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, RCODE_TIMEOUT, "howdy.example.com", {}); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, RCODE_TIMEOUT, "howdy.example.com", {}); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, 0, "howdy.example.com", {"1.2.3.4"}); } TEST_F(ResolverTest, Async_MalformedQuery) { Loading Loading
tests/resolv_integration_test.cpp +4 −6 Original line number Diff line number Diff line Loading @@ -2414,13 +2414,16 @@ TEST_F(ResolverTest, Async_EmptyAnswer) { EXPECT_EQ(std::cv_status::no_timeout, cv.wait_for(lk, std::chrono::seconds(1))); } ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, 0, "howdy.example.com", {"::1.2.3.4"}); dns.setResponseProbability(0.0); int fd2 = resNetworkQuery(TEST_NETID, "howdy.example.com", ns_c_in, ns_t_a, 0); EXPECT_TRUE(fd2 != -1); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, RCODE_TIMEOUT, "howdy.example.com", {}); int fd3 = resNetworkQuery(TEST_NETID, "howdy.example.com", ns_c_in, ns_t_a, 0); EXPECT_TRUE(fd3 != -1); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, RCODE_TIMEOUT, "howdy.example.com", {}); uint8_t buf[MAXPACKET] = {}; int rcode; Loading @@ -2438,6 +2441,7 @@ TEST_F(ResolverTest, Async_EmptyAnswer) { int fd4 = resNetworkQuery(TEST_NETID, "howdy.example.com", ns_c_in, ns_t_a, 0); EXPECT_TRUE(fd4 != -1); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, 0, "howdy.example.com", {"1.2.3.4"}); memset(buf, 0, MAXPACKET); res = getAsyncResponse(fd4, &rcode, buf, MAXPACKET); Loading @@ -2448,12 +2452,6 @@ TEST_F(ResolverTest, Async_EmptyAnswer) { res = getAsyncResponse(fd1, &rcode, buf, MAXPACKET); EXPECT_GT(res, 0); EXPECT_EQ("::1.2.3.4", toString(buf, res, AF_INET6)); // Trailing dot is removed. Is it intended? ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, 0, "howdy.example.com", {"::1.2.3.4"}); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, RCODE_TIMEOUT, "howdy.example.com", {}); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, RCODE_TIMEOUT, "howdy.example.com", {}); ExpectDnsEvent(INetdEventListener::EVENT_RES_NSEND, 0, "howdy.example.com", {"1.2.3.4"}); } TEST_F(ResolverTest, Async_MalformedQuery) { Loading