diff options
author | apolcyn <apolcyn@google.com> | 2018-03-08 11:36:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-08 11:36:35 -0800 |
commit | 44dac6050a4ec30cbc794bcd031fb6c0627f7923 (patch) | |
tree | da337f2ff03bfa30853fed1a0836de3b15397477 /templates | |
parent | ef3fb665ac17e9e06873dfa06825a9dd379334e7 (diff) | |
parent | 0a05b782fe0acdd4d5d14ee486baf51d779449c7 (diff) |
Merge pull request #14610 from apolcyn/python_dig
Remove the C++ test dependency on dig and dnsutils
Diffstat (limited to 'templates')
-rw-r--r-- | templates/test/cpp/naming/resolver_component_tests_defs.include | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/templates/test/cpp/naming/resolver_component_tests_defs.include b/templates/test/cpp/naming/resolver_component_tests_defs.include index efa54a456b..4589ced8c9 100644 --- a/templates/test/cpp/naming/resolver_component_tests_defs.include +++ b/templates/test/cpp/naming/resolver_component_tests_defs.include @@ -21,9 +21,11 @@ set -ex FLAGS_test_bin_path=$(echo "$1" | grep '\--test_bin_path=' | cut -d "=" -f 2) FLAGS_dns_server_bin_path=$(echo "$2" | grep '\--dns_server_bin_path=' | cut -d "=" -f 2) FLAGS_records_config_path=$(echo "$3" | grep '\--records_config_path=' | cut -d "=" -f 2) -FLAGS_test_dns_server_port=$(echo "$4" | grep '\--test_dns_server_port=' | cut -d "=" -f 2) +FLAGS_dns_server_port=$(echo "$4" | grep '\--dns_server_port=' | cut -d "=" -f 2) +FLAGS_dns_resolver_bin_path=$(echo "$5" | grep '\--dns_resolver_bin_path=' | cut -d "=" -f 2) +FLAGS_tcp_connect_bin_path=$(echo "$6" | grep '\--tcp_connect_bin_path=' | cut -d "=" -f 2) -for cmd_arg in "$FLAGS_test_bin_path" "$FLAGS_dns_server_bin_path" "$FLAGS_records_config_path" "$FLAGS_test_dns_server_port"; do +for cmd_arg in "$FLAGS_test_bin_path" "$FLAGS_dns_server_bin_path" "$FLAGS_records_config_path" "$FLAGS_dns_server_port" "$FLAGS_dns_resolver_bin_path" "$FLAGS_tcp_connect_bin_path"; do if [[ "$cmd_arg" == "" ]]; then echo "Missing a CMD arg" && exit 1 fi @@ -34,17 +36,17 @@ if [[ "$GRPC_DNS_RESOLVER" != "" && "$GRPC_DNS_RESOLVER" != ares ]]; then fi export GRPC_DNS_RESOLVER=ares -"$FLAGS_dns_server_bin_path" --records_config_path="$FLAGS_records_config_path" --port="$FLAGS_test_dns_server_port" > /dev/null 2>&1 & +"$FLAGS_dns_server_bin_path" --records_config_path="$FLAGS_records_config_path" --port="$FLAGS_dns_server_port" > /dev/null 2>&1 & DNS_SERVER_PID=$! echo "Local DNS server started. PID: $DNS_SERVER_PID" # Health check local DNS server TCP and UDP ports for ((i=0;i<30;i++)); do - echo "Retry health-check DNS query to local DNS server over tcp and udp" + echo "Retry health-check local DNS server by attempting a DNS query and TCP handshake" RETRY=0 - dig A health-check-local-dns-server-is-alive.resolver-tests.grpctestingexp. @localhost -p "$FLAGS_test_dns_server_port" +tries=1 +timeout=1 | grep '123.123.123.123' || RETRY=1 - dig A health-check-local-dns-server-is-alive.resolver-tests.grpctestingexp. @localhost -p "$FLAGS_test_dns_server_port" +tries=1 +timeout=1 +tcp | grep '123.123.123.123' || RETRY=1 + $FLAGS_dns_resolver_bin_path -s 127.0.0.1 -p "$FLAGS_dns_server_port" -n health-check-local-dns-server-is-alive.resolver-tests.grpctestingexp. -t 1 | grep '123.123.123.123' || RETRY=1 + $FLAGS_tcp_connect_bin_path -s 127.0.0.1 -p "$FLAGS_dns_server_port" -t 1 || RETRY=1 if [[ "$RETRY" == 0 ]]; then break fi; @@ -83,7 +85,7 @@ $FLAGS_test_bin_path \\ --expected_lb_policy='${test['expected_lb_policy']}' \\ - --local_dns_server_address="127.0.0.1:$FLAGS_test_dns_server_port" & + --local_dns_server_address="127.0.0.1:$FLAGS_dns_server_port" & wait "$!" || EXIT_CODE=1 % endfor |