CI: Add CentOS 7 build test to prevent future issues (#851)

Issue #850 showed a regression on CentOS 7. Lets add a CI Test for that
to prevent future issues.

Authored-By: Brad House (@bradh352)
pull/853/head
Brad House 4 months ago committed by GitHub
parent 4abdf7de36
commit d450e87815
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 61
      .github/workflows/centos7.yml
  2. 8
      test/ares-test-internal.cc
  3. 6
      test/ares-test-live.cc
  4. 2
      test/ares-test-misc.cc
  5. 48
      test/ares-test-mock-ai.cc

@ -0,0 +1,61 @@
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
name: CentOS 7
on:
push:
pull_request:
concurrency:
group: ${{ github.ref }}-centos7
cancel-in-progress: true
env:
TEST_FILTER: "--gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*"
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -G Ninja"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON -DCMAKE_PREFIX_PATH=/usr/local/"
MAKE: make
jobs:
build:
runs-on: ubuntu-latest
container:
image: centos:7
options: --privileged
name: "CentOS 7"
steps:
- name: Switch Repo to Vault
run: |
sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo
yum clean all
- name: Install EPEL
run: |
yum install -y epel-release
sed -i -e 's|https://dl.fedoraproject.org/pub/epel|archives.fedoraproject.org/pub/archive/epel|' /etc/yum.repos.d/*.repo
yum repolist
- name: Install packages
run: |
yum install -y gcc gcc-c++ make autoconf automake libtool cmake3 git ninja-build gdb
ln -sf /usr/bin/cmake3 /usr/bin/cmake
- name: Checkout c-ares
uses: actions/checkout@v1
- name: Build GoogleTest
# GoogleTest v1.10 doesn't require c++14
run: |
git clone --depth=1 -b v1.10.x https://github.com/google/googletest googletest
cd googletest
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_GMOCK=ON -DINSTALL_GTEST=ON -G Ninja .
ninja install
cd ..
- name: "CMake: build and test c-ares"
env:
BUILD_TYPE: CMAKE
TEST_DEBUGGER: gdb
run: |
./ci/build.sh
./ci/test.sh
- name: "Autotools: build and test c-ares"
env:
BUILD_TYPE: autotools
# Can't run tests due to C++14 check and compiler not supporting C++14
run: |
./ci/build.sh

@ -291,7 +291,7 @@ TEST_F(FileChannelTest, GetAddrInfoHostsPositive) {
"1.3.5.7 \n" "1.3.5.7 \n"
"::1 ipv6.com"); "::1 ipv6.com");
EnvValue with_env("CARES_HOSTS", hostsfile.filename()); EnvValue with_env("CARES_HOSTS", hostsfile.filename());
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
AddrInfoResult result = {}; AddrInfoResult result = {};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT;
@ -311,7 +311,7 @@ TEST_F(FileChannelTest, GetAddrInfoHostsSpaces) {
"1.3.5.7 \n" "1.3.5.7 \n"
"::1 ipv6.com"); "::1 ipv6.com");
EnvValue with_env("CARES_HOSTS", hostsfile.filename()); EnvValue with_env("CARES_HOSTS", hostsfile.filename());
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
AddrInfoResult result = {}; AddrInfoResult result = {};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT;
@ -331,7 +331,7 @@ TEST_F(FileChannelTest, GetAddrInfoHostsByALias) {
"1.3.5.7 \n" "1.3.5.7 \n"
"::1 ipv6.com"); "::1 ipv6.com");
EnvValue with_env("CARES_HOSTS", hostsfile.filename()); EnvValue with_env("CARES_HOSTS", hostsfile.filename());
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
AddrInfoResult result = {}; AddrInfoResult result = {};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT;
@ -351,7 +351,7 @@ TEST_F(FileChannelTest, GetAddrInfoHostsIPV6) {
"1.3.5.7 \n" "1.3.5.7 \n"
"::1 ipv6.com"); "::1 ipv6.com");
EnvValue with_env("CARES_HOSTS", hostsfile.filename()); EnvValue with_env("CARES_HOSTS", hostsfile.filename());
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
AddrInfoResult result = {}; AddrInfoResult result = {};
hints.ai_family = AF_INET6; hints.ai_family = AF_INET6;
hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT;

@ -74,7 +74,7 @@ MATCHER_P(IncludesAddrType, addrtype, "") {
} }
//VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoV4) { //VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoV4) {
//struct ares_addrinfo_hints hints = {}; //struct ares_addrinfo_hints hints = {0, 0, 0, 0};
//hints.ai_family = AF_INET; //hints.ai_family = AF_INET;
//AddrInfoResult result; //AddrInfoResult result;
//ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -86,7 +86,7 @@ MATCHER_P(IncludesAddrType, addrtype, "") {
//} //}
//VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoV6) { //VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoV6) {
//struct ares_addrinfo_hints hints = {}; //struct ares_addrinfo_hints hints = {0, 0, 0, 0};
//hints.ai_family = AF_INET6; //hints.ai_family = AF_INET6;
//AddrInfoResult result; //AddrInfoResult result;
//ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -98,7 +98,7 @@ MATCHER_P(IncludesAddrType, addrtype, "") {
//} //}
//VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoUnspec) { //VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoUnspec) {
//struct ares_addrinfo_hints hints = {}; //struct ares_addrinfo_hints hints = {0, 0, 0, 0};
//hints.ai_family = AF_UNSPEC; //hints.ai_family = AF_UNSPEC;
//AddrInfoResult result; //AddrInfoResult result;
//ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);

@ -336,7 +336,7 @@ TEST_F(DefaultChannelTest, HostByNameFileOnionDomain) {
TEST_F(DefaultChannelTest, GetAddrinfoOnionDomain) { TEST_F(DefaultChannelTest, GetAddrinfoOnionDomain) {
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
ares_getaddrinfo(channel_, "dontleak.onion", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "dontleak.onion", NULL, &hints, AddrInfoCallback, &result);
EXPECT_TRUE(result.done_); EXPECT_TRUE(result.done_);

@ -104,7 +104,7 @@ TEST_P(MockUDPChannelTestAI, GetAddrInfoParallelLookups) {
ON_CALL(server_, OnRequest("www.example.com", T_A)) ON_CALL(server_, OnRequest("www.example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp2)); .WillByDefault(SetReply(&server_, &rsp2));
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
AddrInfoResult result1; AddrInfoResult result1;
@ -145,7 +145,7 @@ TEST_P(MockUDPChannelTestAI, TruncationRetry) {
.WillOnce(SetReply(&server_, &rspok)); .WillOnce(SetReply(&server_, &rspok));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -162,7 +162,7 @@ TEST_P(MockTCPChannelTestAI, MalformedResponse) {
.WillByDefault(SetReplyData(&server_, one)); .WillByDefault(SetReplyData(&server_, one));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -180,7 +180,7 @@ TEST_P(MockTCPChannelTestAI, FormErrResponse) {
.WillOnce(SetReply(&server_, &rsp)); .WillOnce(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -198,7 +198,7 @@ TEST_P(MockTCPChannelTestAI, ServFailResponse) {
.WillByDefault(SetReply(&server_, &rsp)); .WillByDefault(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -216,7 +216,7 @@ TEST_P(MockTCPChannelTestAI, NotImplResponse) {
.WillByDefault(SetReply(&server_, &rsp)); .WillByDefault(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -234,7 +234,7 @@ TEST_P(MockTCPChannelTestAI, RefusedResponse) {
.WillByDefault(SetReply(&server_, &rsp)); .WillByDefault(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -252,7 +252,7 @@ TEST_P(MockTCPChannelTestAI, YXDomainResponse) {
.WillOnce(SetReply(&server_, &rsp)); .WillOnce(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -295,7 +295,7 @@ TEST_P(MockExtraOptsTestAI, SimpleQuery) {
.WillByDefault(SetReply(&server_, &rsp)); .WillByDefault(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -346,7 +346,7 @@ TEST_P(MockExtraOptsNDots5TestAI, SimpleQuery) {
.WillByDefault(SetReply(&server_, &rsp)); .WillByDefault(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "dynamodb.us-east-1.amazonaws.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "dynamodb.us-east-1.amazonaws.com.", NULL, &hints, AddrInfoCallback, &result);
@ -392,7 +392,7 @@ TEST_P(MockExtraOptsNDots0TestAI, SimpleQuery) {
.WillByDefault(SetReply(&server_, &rsp_ndots0_third)); .WillByDefault(SetReply(&server_, &rsp_ndots0_third));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "ndots0", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "ndots0", NULL, &hints, AddrInfoCallback, &result);
@ -434,7 +434,7 @@ TEST_P(MockNoCheckRespChannelTestAI, ServFailResponse) {
.WillByDefault(SetReply(&server_, &rsp)); .WillByDefault(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -452,7 +452,7 @@ TEST_P(MockNoCheckRespChannelTestAI, NotImplResponse) {
.WillByDefault(SetReply(&server_, &rsp)); .WillByDefault(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -470,7 +470,7 @@ TEST_P(MockNoCheckRespChannelTestAI, RefusedResponse) {
.WillByDefault(SetReply(&server_, &rsp)); .WillByDefault(SetReply(&server_, &rsp));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -489,7 +489,7 @@ TEST_P(MockChannelTestAI, FamilyV6) {
ON_CALL(server_, OnRequest("example.com", T_AAAA)) ON_CALL(server_, OnRequest("example.com", T_AAAA))
.WillByDefault(SetReply(&server_, &rsp6)); .WillByDefault(SetReply(&server_, &rsp6));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET6; hints.ai_family = AF_INET6;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "example.com.", NULL, &hints, ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
@ -516,7 +516,7 @@ TEST_P(MockChannelTestAI, PartialQueryCancel) {
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
ares_getaddrinfo(channel_, "example.com.", NULL, &hints, ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
AddrInfoCallback, &result); AddrInfoCallback, &result);
@ -536,7 +536,7 @@ TEST_P(MockChannelTestAI, FamilyV4) {
ON_CALL(server_, OnRequest("example.com", T_A)) ON_CALL(server_, OnRequest("example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp4)); .WillByDefault(SetReply(&server_, &rsp4));
AddrInfoResult result = {}; AddrInfoResult result = {};
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "example.com.", NULL, &hints, ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
@ -556,7 +556,7 @@ TEST_P(MockChannelTestAI, FamilyV4_MultipleAddresses) {
ON_CALL(server_, OnRequest("example.com", T_A)) ON_CALL(server_, OnRequest("example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp4)); .WillByDefault(SetReply(&server_, &rsp4));
AddrInfoResult result = {}; AddrInfoResult result = {};
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "example.com.", NULL, &hints, ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
@ -584,7 +584,7 @@ TEST_P(MockChannelTestAI, FamilyUnspecified) {
ON_CALL(server_, OnRequest("example.com", T_A)) ON_CALL(server_, OnRequest("example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp4)); .WillByDefault(SetReply(&server_, &rsp4));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "example.com.", NULL, &hints, ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
@ -614,7 +614,7 @@ TEST_P(MockEDNSChannelTestAI, RetryWithoutEDNS) {
.WillOnce(SetReply(&server_, &rspok)); .WillOnce(SetReply(&server_, &rspok));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
@ -643,7 +643,7 @@ TEST_P(MockChannelTestAI, SearchDomains) {
.WillByDefault(SetReply(&server_, &yesthird)); .WillByDefault(SetReply(&server_, &yesthird));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www", NULL, &hints, AddrInfoCallback, &result);
@ -689,7 +689,7 @@ TEST_P(MockChannelTestAI, SearchDomainsServFailOnAAAA) {
.WillByDefault(SetReply(&server_, &failthird4)); .WillByDefault(SetReply(&server_, &failthird4));
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www", NULL, &hints, AddrInfoCallback, &result);
@ -707,7 +707,7 @@ class MockMultiServerChannelTestAI
: MockChannelOptsTest(3, GetParam().first, GetParam().second, opts, optmask) {} : MockChannelOptsTest(3, GetParam().first, GetParam().second, opts, optmask) {}
void CheckExample() { void CheckExample() {
AddrInfoResult result; AddrInfoResult result;
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "www.example.com.", NULL, &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "www.example.com.", NULL, &hints, AddrInfoCallback, &result);
@ -785,7 +785,7 @@ TEST_P(MockChannelTestAI, FamilyV4ServiceName) {
ON_CALL(server_, OnRequest("example.com", T_A)) ON_CALL(server_, OnRequest("example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp4)); .WillByDefault(SetReply(&server_, &rsp4));
AddrInfoResult result = {}; AddrInfoResult result = {};
struct ares_addrinfo_hints hints = {}; struct ares_addrinfo_hints hints = {0, 0, 0, 0};
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_flags = ARES_AI_NOSORT; hints.ai_flags = ARES_AI_NOSORT;
ares_getaddrinfo(channel_, "example.com", "http", &hints, AddrInfoCallback, &result); ares_getaddrinfo(channel_, "example.com", "http", &hints, AddrInfoCallback, &result);

Loading…
Cancel
Save