diff options
author | Alex Polcyn <apolcyn@google.com> | 2018-03-05 09:33:47 +0000 |
---|---|---|
committer | Alexander Polcyn <apolcyn@google.com> | 2018-03-06 11:52:58 -0800 |
commit | 3c5e12de08a255edf78890d7408e2f98ebca7e2d (patch) | |
tree | fb2b08b3aafb3c908a2ceeb6beacb15c5d0060a7 /templates/test | |
parent | 092f19947426d74a8b992072e3a9805c3885eada (diff) |
Remove the C++ test dependency on dig and dnsutils
Diffstat (limited to 'templates/test')
-rw-r--r-- | templates/test/cpp/naming/resolver_component_tests_defs.include | 10 |
1 files changed, 6 insertions, 4 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..8faabafc79 100644 --- a/templates/test/cpp/naming/resolver_component_tests_defs.include +++ b/templates/test/cpp/naming/resolver_component_tests_defs.include @@ -22,8 +22,10 @@ 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_test_dns_resolver_bin_path=$(echo "$5" | grep '\--test_dns_resolver_bin_path=' | cut -d "=" -f 2) +FLAGS_test_tcp_connect_bin_path=$(echo "$6" | grep '\--test_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_test_dns_server_port" "$FLAGS_test_dns_resolver_bin_path" "$FLAGS_test_tcp_connect_bin_path"; do if [[ "$cmd_arg" == "" ]]; then echo "Missing a CMD arg" && exit 1 fi @@ -41,10 +43,10 @@ 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_test_dns_resolver_bin_path -s 127.0.0.1 -p "$FLAGS_test_dns_server_port" -n health-check-local-dns-server-is-alive.resolver-tests.grpctestingexp. -t 1 | grep '123.123.123.123' || RETRY=1 + $FLAGS_test_tcp_connect_bin_path -s 127.0.0.1 -p "$FLAGS_test_dns_server_port" -t 1 || RETRY=1 if [[ "$RETRY" == 0 ]]; then break fi; |