diff options
author | Mehrdad Afshari <mmx@google.com> | 2018-02-07 11:43:23 -0800 |
---|---|---|
committer | Mehrdad Afshari <mmx@google.com> | 2018-02-07 11:43:23 -0800 |
commit | 4c959bab8a2e9f2f89c3f982d5e65137b86f9f18 (patch) | |
tree | 855e0500e36451c20d680d46ea4d1a3459892167 /templates/test/cpp | |
parent | 11b8878348506a6e95e22baa8845b9a8670aee6f (diff) |
Fix resolver_component_tests_defs.include to pass shellcheck
Diffstat (limited to 'templates/test/cpp')
-rw-r--r-- | templates/test/cpp/naming/resolver_component_tests_defs.include | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/templates/test/cpp/naming/resolver_component_tests_defs.include b/templates/test/cpp/naming/resolver_component_tests_defs.include index 6fa91c741a..efa54a456b 100644 --- a/templates/test/cpp/naming/resolver_component_tests_defs.include +++ b/templates/test/cpp/naming/resolver_component_tests_defs.include @@ -18,10 +18,10 @@ set -ex # all command args required in this set order -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_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) for cmd_arg in "$FLAGS_test_bin_path" "$FLAGS_dns_server_bin_path" "$FLAGS_records_config_path" "$FLAGS_test_dns_server_port"; do if [[ "$cmd_arg" == "" ]]; then @@ -34,7 +34,7 @@ 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" 2>&1 > /dev/null & +"$FLAGS_dns_server_bin_path" --records_config_path="$FLAGS_records_config_path" --port="$FLAGS_test_dns_server_port" > /dev/null 2>&1 & DNS_SERVER_PID=$! echo "Local DNS server started. PID: $DNS_SERVER_PID" @@ -53,15 +53,15 @@ done if [[ $RETRY == 1 ]]; then echo "FAILED TO START LOCAL DNS SERVER" - kill -SIGTERM $DNS_SERVER_PID + kill -SIGTERM "$DNS_SERVER_PID" wait exit 1 fi function terminate_all { echo "Received signal. Terminating $! and $DNS_SERVER_PID" - kill -SIGTERM $! || true - kill -SIGTERM $DNS_SERVER_PID || true + kill -SIGTERM "$!" || true + kill -SIGTERM "$DNS_SERVER_PID" || true wait exit 1 } @@ -83,10 +83,10 @@ $FLAGS_test_bin_path \\ --expected_lb_policy='${test['expected_lb_policy']}' \\ - --local_dns_server_address=127.0.0.1:$FLAGS_test_dns_server_port & -wait $! || EXIT_CODE=1 + --local_dns_server_address="127.0.0.1:$FLAGS_test_dns_server_port" & +wait "$!" || EXIT_CODE=1 % endfor -kill -SIGTERM $DNS_SERVER_PID || true +kill -SIGTERM "$DNS_SERVER_PID" || true wait exit $EXIT_CODE</%def> |