aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--templates/test/cpp/naming/create_private_dns_zone.sh.template4
-rw-r--r--templates/test/cpp/naming/create_private_dns_zone_defs.include32
-rw-r--r--templates/test/cpp/naming/private_dns_zone_init.sh.template4
-rw-r--r--templates/test/cpp/naming/private_dns_zone_init_defs.include40
-rw-r--r--templates/test/cpp/naming/resolver_gce_integration_tests_defs.include64
-rw-r--r--templates/test/cpp/naming/resolver_gce_integration_tests_runner.sh.template4
-rw-r--r--test/core/bad_client/bad_client.c11
-rw-r--r--test/core/bad_client/bad_client.h1
-rw-r--r--test/core/bad_client/tests/window_overflow.c3
-rw-r--r--test/core/tsi/transport_security_test_lib.c29
-rw-r--r--test/core/tsi/transport_security_test_lib.h19
-rw-r--r--test/cpp/naming/README.md43
-rwxr-xr-xtest/cpp/naming/create_private_dns_zone.sh27
-rwxr-xr-xtest/cpp/naming/gen_build_yaml.py110
-rwxr-xr-xtest/cpp/naming/private_dns_zone_init.sh215
-rwxr-xr-xtest/cpp/naming/resolver_component_tests_runner.sh26
-rwxr-xr-xtest/cpp/naming/resolver_gce_integration_tests_runner.sh359
-rw-r--r--test/cpp/naming/resolver_test_record_groups.yaml2
-rwxr-xr-xtest/cpp/naming/test_dns_server.py2
-rwxr-xr-xtools/internal_ci/linux/grpc_performance_profile_daily.sh2
-rwxr-xr-xtools/jenkins/run_performance_profile_daily.sh2
-rwxr-xr-xtools/run_tests/run_tests.py5
22 files changed, 973 insertions, 31 deletions
diff --git a/templates/test/cpp/naming/create_private_dns_zone.sh.template b/templates/test/cpp/naming/create_private_dns_zone.sh.template
new file mode 100644
index 0000000000..14324b098c
--- /dev/null
+++ b/templates/test/cpp/naming/create_private_dns_zone.sh.template
@@ -0,0 +1,4 @@
+%YAML 1.2
+--- |
+ <%namespace file="create_private_dns_zone_defs.include" import="*"/>\
+ ${create_private_dns_zone(resolver_gce_integration_tests_zone_id, resolver_tests_common_zone_name)}
diff --git a/templates/test/cpp/naming/create_private_dns_zone_defs.include b/templates/test/cpp/naming/create_private_dns_zone_defs.include
new file mode 100644
index 0000000000..465dd6394b
--- /dev/null
+++ b/templates/test/cpp/naming/create_private_dns_zone_defs.include
@@ -0,0 +1,32 @@
+<%def name="create_private_dns_zone(resolver_gce_integration_tests_zone_id, resolver_tests_common_zone_name)">#!/bin/bash
+# Copyright 2015 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is auto-generated
+
+set -ex
+
+cd $(dirname $0)/../../..
+
+gcloud alpha dns managed-zones create \\
+
+ ${resolver_gce_integration_tests_zone_id} \\
+
+ --dns-name=${resolver_tests_common_zone_name} \\
+
+ --description="GCE-DNS-private-zone-for-GRPC-testing" \\
+
+ --visibility=private \\
+
+ --networks=default</%def>
diff --git a/templates/test/cpp/naming/private_dns_zone_init.sh.template b/templates/test/cpp/naming/private_dns_zone_init.sh.template
new file mode 100644
index 0000000000..d5ffd04add
--- /dev/null
+++ b/templates/test/cpp/naming/private_dns_zone_init.sh.template
@@ -0,0 +1,4 @@
+%YAML 1.2
+--- |
+ <%namespace file="private_dns_zone_init_defs.include" import="*"/>\
+ ${private_dns_zone_init(all_integration_test_records, resolver_gce_integration_tests_zone_id, resolver_tests_common_zone_name)}
diff --git a/templates/test/cpp/naming/private_dns_zone_init_defs.include b/templates/test/cpp/naming/private_dns_zone_init_defs.include
new file mode 100644
index 0000000000..06bc8adb94
--- /dev/null
+++ b/templates/test/cpp/naming/private_dns_zone_init_defs.include
@@ -0,0 +1,40 @@
+<%def name="private_dns_zone_init(records,resolver_gce_integration_tests_zone_id,resolver_tests_common_zone_name)">#!/bin/bash
+# Copyright 2015 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is auto-generated
+
+set -ex
+
+cd $(dirname $0)/../../..
+
+gcloud dns record-sets transaction start -z=${resolver_gce_integration_tests_zone_id}
+
+% for r in records:
+gcloud dns record-sets transaction add \\
+
+ -z=${resolver_gce_integration_tests_zone_id} \\
+
+ --name=${r['name']}.${resolver_tests_common_zone_name} \\
+
+ --type=${r['type']} \\
+
+ --ttl=${r['ttl']} \\
+
+ ${r['data']}
+
+% endfor
+gcloud dns record-sets transaction describe -z=${resolver_gce_integration_tests_zone_id}
+gcloud dns record-sets transaction execute -z=${resolver_gce_integration_tests_zone_id}
+gcloud dns record-sets list -z=${resolver_gce_integration_tests_zone_id}</%def>
diff --git a/templates/test/cpp/naming/resolver_gce_integration_tests_defs.include b/templates/test/cpp/naming/resolver_gce_integration_tests_defs.include
new file mode 100644
index 0000000000..2413ec57d0
--- /dev/null
+++ b/templates/test/cpp/naming/resolver_gce_integration_tests_defs.include
@@ -0,0 +1,64 @@
+<%def name="resolver_gce_integration_tests(tests, records, resolver_tests_common_zone_name)">#!/bin/bash
+# Copyright 2015 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is auto-generated
+
+set -ex
+
+if [[ "$GRPC_DNS_RESOLVER" == "" ]]; then
+ export GRPC_DNS_RESOLVER=ares
+elif [[ "$GRPC_DNS_RESOLVER" != ares ]]; then
+ echo "Unexpected: GRPC_DNS_RESOLVER=$GRPC_DNS_RESOLVER. This test only works with c-ares resolver"
+ exit 1
+fi
+
+cd $(dirname $0)/../../..
+
+if [[ "$CONFIG" == "" ]]; then
+ export CONFIG=opt
+fi
+make resolver_component_test
+echo "Sanity check DNS records are resolveable with dig:"
+EXIT_CODE=0
+
+% for r in records:
+ONE_FAILED=0
+dig ${r['type']} ${r['name']}.${resolver_tests_common_zone_name} | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig ${r['type']} ${r['name']}.${resolver_tests_common_zone_name} FAILED"
+ exit 1
+fi
+
+% endfor
+echo "Sanity check PASSED. Run resolver tests:"
+
+% for test in tests:
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \\
+
+ --target_name='${test['target_name']}' \\
+
+ --expected_addrs='${test['expected_addrs']}' \\
+
+ --expected_chosen_service_config='${test['expected_chosen_service_config']}' \\
+
+ --expected_lb_policy='${test['expected_lb_policy']}' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: ${test['target_name']} FAILED"
+ EXIT_CODE=1
+fi
+
+% endfor
+exit $EXIT_CODE</%def>
diff --git a/templates/test/cpp/naming/resolver_gce_integration_tests_runner.sh.template b/templates/test/cpp/naming/resolver_gce_integration_tests_runner.sh.template
new file mode 100644
index 0000000000..c728784d29
--- /dev/null
+++ b/templates/test/cpp/naming/resolver_gce_integration_tests_runner.sh.template
@@ -0,0 +1,4 @@
+%YAML 1.2
+--- |
+ <%namespace file="resolver_gce_integration_tests_defs.include" import="*"/>\
+ ${resolver_gce_integration_tests(resolver_gce_integration_test_cases, all_integration_test_records, resolver_tests_common_zone_name)}
diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c
index 383d1240cb..fff0c793ed 100644
--- a/test/core/bad_client/bad_client.c
+++ b/test/core/bad_client/bad_client.c
@@ -134,9 +134,12 @@ void grpc_run_bad_client_test(
grpc_endpoint_write(&exec_ctx, sfd.client, &outgoing, &done_write_closure);
grpc_exec_ctx_finish(&exec_ctx);
- /* Await completion */
- GPR_ASSERT(
- gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(5)));
+ /* Await completion, unless the request is large and write may not finish
+ * before the peer shuts down. */
+ if (!(flags & GRPC_BAD_CLIENT_LARGE_REQUEST)) {
+ GPR_ASSERT(
+ gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(5)));
+ }
if (flags & GRPC_BAD_CLIENT_DISCONNECT) {
grpc_endpoint_shutdown(
@@ -186,6 +189,8 @@ void grpc_run_bad_client_test(
grpc_exec_ctx_finish(&exec_ctx);
}
+ GPR_ASSERT(
+ gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(1)));
shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL);
GPR_ASSERT(grpc_completion_queue_pluck(
diff --git a/test/core/bad_client/bad_client.h b/test/core/bad_client/bad_client.h
index 22f1a3abc7..a5b01f7f2c 100644
--- a/test/core/bad_client/bad_client.h
+++ b/test/core/bad_client/bad_client.h
@@ -37,6 +37,7 @@ typedef bool (*grpc_bad_client_client_stream_validator)(
grpc_slice_buffer *incoming);
#define GRPC_BAD_CLIENT_DISCONNECT 1
+#define GRPC_BAD_CLIENT_LARGE_REQUEST 2
/* Test runner.
diff --git a/test/core/bad_client/tests/window_overflow.c b/test/core/bad_client/tests/window_overflow.c
index 1f29bd32fb..18c647ad8a 100644
--- a/test/core/bad_client/tests/window_overflow.c
+++ b/test/core/bad_client/tests/window_overflow.c
@@ -90,7 +90,8 @@ int main(int argc, char **argv) {
addbuf(message, sizeof(message));
}
}
- grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count, 0);
+ grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count,
+ GRPC_BAD_CLIENT_LARGE_REQUEST);
gpr_free(g_buffer);
return 0;
diff --git a/test/core/tsi/transport_security_test_lib.c b/test/core/tsi/transport_security_test_lib.c
index 7d66e110f2..329b2371bf 100644
--- a/test/core/tsi/transport_security_test_lib.c
+++ b/test/core/tsi/transport_security_test_lib.c
@@ -23,9 +23,26 @@
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
#include "src/core/lib/security/transport/tsi_error.h"
#include "test/core/tsi/transport_security_test_lib.h"
+static void notification_signal(tsi_test_fixture *fixture) {
+ gpr_mu_lock(&fixture->mu);
+ fixture->notified = true;
+ gpr_cv_signal(&fixture->cv);
+ gpr_mu_unlock(&fixture->mu);
+}
+
+static void notification_wait(tsi_test_fixture *fixture) {
+ gpr_mu_lock(&fixture->mu);
+ while (!fixture->notified) {
+ gpr_cv_wait(&fixture->cv, &fixture->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+ }
+ fixture->notified = false;
+ gpr_mu_unlock(&fixture->mu);
+}
+
typedef struct handshaker_args {
tsi_test_fixture *fixture;
unsigned char *handshake_buffer;
@@ -273,9 +290,11 @@ grpc_error *on_handshake_next_done(tsi_result result, void *user_data,
/* Read more data if we need to. */
if (result == TSI_INCOMPLETE_DATA) {
GPR_ASSERT(bytes_to_send_size == 0);
+ notification_signal(fixture);
return error;
}
if (result != TSI_OK) {
+ notification_signal(fixture);
return grpc_set_tsi_error_result(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshake failed"), result);
}
@@ -295,6 +314,7 @@ grpc_error *on_handshake_next_done(tsi_result result, void *user_data,
if (handshaker_result != NULL) {
maybe_append_unused_bytes(args);
}
+ notification_signal(fixture);
return error;
}
@@ -345,7 +365,11 @@ static void do_handshaker_next(handshaker_args *args) {
if (result != TSI_ASYNC) {
args->error = on_handshake_next_done(result, args, bytes_to_send,
bytes_to_send_size, handshaker_result);
+ if (args->error != GRPC_ERROR_NONE) {
+ return;
+ }
}
+ notification_wait(fixture);
}
void tsi_test_do_handshake(tsi_test_fixture *fixture) {
@@ -532,6 +556,9 @@ void tsi_test_fixture_init(tsi_test_fixture *fixture) {
fixture->bytes_read_from_server_channel = 0;
fixture->test_unused_bytes = true;
fixture->has_client_finished_first = false;
+ gpr_mu_init(&fixture->mu);
+ gpr_cv_init(&fixture->cv);
+ fixture->notified = false;
}
void tsi_test_fixture_destroy(tsi_test_fixture *fixture) {
@@ -546,5 +573,7 @@ void tsi_test_fixture_destroy(tsi_test_fixture *fixture) {
GPR_ASSERT(fixture->vtable != NULL);
GPR_ASSERT(fixture->vtable->destruct != NULL);
fixture->vtable->destruct(fixture);
+ gpr_mu_destroy(&fixture->mu);
+ gpr_cv_destroy(&fixture->cv);
gpr_free(fixture);
}
diff --git a/test/core/tsi/transport_security_test_lib.h b/test/core/tsi/transport_security_test_lib.h
index 8ae2024ee4..ed8ff856df 100644
--- a/test/core/tsi/transport_security_test_lib.h
+++ b/test/core/tsi/transport_security_test_lib.h
@@ -21,6 +21,10 @@
#include "src/core/tsi/transport_security_interface.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE 32
#define TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE 128
#define TSI_TEST_SMALL_READ_BUFFER_ALLOCATED_SIZE 41
@@ -56,10 +60,10 @@ typedef struct tsi_test_fixture_vtable {
void (*setup_handshakers)(tsi_test_fixture *fixture);
void (*check_handshaker_peers)(tsi_test_fixture *fixture);
void (*destruct)(tsi_test_fixture *fixture);
-} tranport_security_test_vtable;
+} tsi_test_fixture_vtable;
struct tsi_test_fixture {
- const struct tsi_test_fixture_vtable *vtable;
+ const tsi_test_fixture_vtable *vtable;
/* client/server TSI handshaker used to perform TSI handshakes, and will get
instantiated during the call to setup_handshakers. */
tsi_handshaker *client_handshaker;
@@ -95,6 +99,13 @@ struct tsi_test_fixture {
(https://github.com/grpc/grpc/issues/12164).
*/
bool test_unused_bytes;
+ /* These objects will be used coordinate client/server handshakers with TSI
+ thread to perform TSI handshakes in an asynchronous manner (for GTS TSI
+ implementations).
+ */
+ gpr_cv cv;
+ gpr_mu mu;
+ bool notified;
};
struct tsi_test_frame_protector_config {
@@ -162,4 +173,8 @@ void tsi_test_do_handshake(tsi_test_fixture *fixture);
the client and server switching its role. */
void tsi_test_do_round_trip(tsi_test_fixture *fixture);
+#ifdef __cplusplus
+}
+#endif
+
#endif // GRPC_TEST_CORE_TSI_TRANSPORT_SECURITY_TEST_LIB_H_
diff --git a/test/cpp/naming/README.md b/test/cpp/naming/README.md
new file mode 100644
index 0000000000..e33184620c
--- /dev/null
+++ b/test/cpp/naming/README.md
@@ -0,0 +1,43 @@
+# Resolver Tests
+
+This directory has tests and infrastructure for unit tests and GCE
+integration tests of gRPC resolver functionality.
+
+There are two different tests here:
+
+## Resolver unit tests (resolver "component" tests)
+
+These tests run per-change, along with the rest of the grpc unit tests.
+They query a local testing DNS server.
+
+## GCE integration tests
+
+These tests use the same test binary and the same test records
+as the unit tests, but they run against GCE DNS (this is done by
+running the test on a GCE instance and not specifying an authority
+in uris). These tests run in a background job, which needs to be
+actively monitored.
+
+## Making changes to test records
+
+After making a change to `resolver_test_record_groups.yaml`:
+
+1. Increment the "version number" in the `resolver_tests_common_zone_name`
+ DNS zone (this is a yaml field at the top
+ of `resolver_test_record_groups.yaml`).
+
+2. Regenerate projects.
+
+3. From the repo root, run:
+
+```
+$ test/cpp/naming/create_dns_private_zone.sh
+$ test/cpp/naming/private_dns_zone_init.sh
+```
+
+Note that these commands must be ran in environment that
+has access to the grpc-testing GCE project.
+
+If everything runs smoothly, then once the change is merged,
+the GCE DNS integration testing job will transition to the
+new records and continue passing.
diff --git a/test/cpp/naming/create_private_dns_zone.sh b/test/cpp/naming/create_private_dns_zone.sh
new file mode 100755
index 0000000000..3d7520b90a
--- /dev/null
+++ b/test/cpp/naming/create_private_dns_zone.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Copyright 2015 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is auto-generated
+
+set -ex
+
+cd $(dirname $0)/../../..
+
+gcloud alpha dns managed-zones create \
+ resolver-tests-version-1-grpctestingexp-zone-id \
+ --dns-name=resolver-tests-version-1.grpctestingexp. \
+ --description="GCE-DNS-private-zone-for-GRPC-testing" \
+ --visibility=private \
+ --networks=default
diff --git a/test/cpp/naming/gen_build_yaml.py b/test/cpp/naming/gen_build_yaml.py
index 3a51fef7a0..91718156e9 100755
--- a/test/cpp/naming/gen_build_yaml.py
+++ b/test/cpp/naming/gen_build_yaml.py
@@ -24,6 +24,12 @@ import json
_LOCAL_DNS_SERVER_ADDRESS = '127.0.0.1:15353'
+_TARGET_RECORDS_TO_SKIP_AGAINST_GCE = [
+ # TODO: enable this once able to upload the very large TXT record
+ # in this group to GCE DNS.
+ 'ipv4-config-causing-fallback-to-tcp',
+]
+
def _append_zone_name(name, zone_name):
return '%s.%s' % (name, zone_name)
@@ -33,21 +39,107 @@ def _build_expected_addrs_cmd_arg(expected_addrs):
out.append('%s,%s' % (addr['address'], str(addr['is_balancer'])))
return ';'.join(out)
+def _data_for_type(r_type, r_data, common_zone_name):
+ if r_type in ['A', 'AAAA']:
+ return ' '.join(map(lambda x: '\"%s\"' % x, r_data))
+ if r_type == 'SRV':
+ assert len(r_data) == 1
+ target = r_data[0].split(' ')[3]
+ uploadable_target = '%s.%s' % (target, common_zone_name)
+ uploadable = r_data[0].split(' ')
+ uploadable[3] = uploadable_target
+ return '\"%s\"' % ' '.join(uploadable)
+ if r_type == 'TXT':
+ assert len(r_data) == 1
+ chunks = []
+ all_data = r_data[0]
+ cur = 0
+ # Split TXT records that span more than 255 characters (the single
+ # string length-limit in DNS) into multiple strings. Each string
+ # needs to be wrapped with double-quotes, and all inner double-quotes
+ # are escaped. The wrapping double-quotes and inner backslashes can be
+ # counted towards the 255 character length limit (as observed with gcloud),
+ # so make sure all strings fit within that limit.
+ while len(all_data[cur:]) > 0:
+ next_chunk = '\"'
+ while len(next_chunk) < 254 and len(all_data[cur:]) > 0:
+ if all_data[cur] == '\"':
+ if len(next_chunk) < 253:
+ next_chunk += '\\\"'
+ else:
+ break
+ else:
+ next_chunk += all_data[cur]
+ cur += 1
+ next_chunk += '\"'
+ if len(next_chunk) > 255:
+ raise Exception('Bug: next chunk is too long.')
+ chunks.append(next_chunk)
+ # Wrap the whole record in single quotes to make sure all strings
+ # are associated with the same TXT record (to make it one bash token for
+ # gcloud)
+ return '\'%s\'' % ' '.join(chunks)
+
+# Convert DNS records from their "within a test group" format
+# of the yaml file to an easier form for the templates to use.
+def _gcloud_uploadable_form(test_cases, common_zone_name):
+ out = []
+ for group in test_cases:
+ if group['record_to_resolve'] in _TARGET_RECORDS_TO_SKIP_AGAINST_GCE:
+ continue
+ for record_name in group['records'].keys():
+ r_ttl = None
+ all_r_data = {}
+ for r_data in group['records'][record_name]:
+ # enforce records have the same TTL only for simplicity
+ if r_ttl is None:
+ r_ttl = r_data['TTL']
+ assert r_ttl == r_data['TTL'], '%s and %s differ' % (r_ttl, r_data['TTL'])
+ r_type = r_data['type']
+ if all_r_data.get(r_type) is None:
+ all_r_data[r_type] = []
+ all_r_data[r_type].append(r_data['data'])
+ for r_type in all_r_data.keys():
+ for r in out:
+ assert r['name'] != record_name or r['type'] != r_type, 'attempt to add a duplicate record'
+ out.append({
+ 'name': record_name,
+ 'ttl': r_ttl,
+ 'type': r_type,
+ 'data': _data_for_type(r_type, all_r_data[r_type], common_zone_name)
+ })
+ return out
+
+def _gce_dns_zone_id(resolver_component_data):
+ dns_name = resolver_component_data['resolver_tests_common_zone_name']
+ return dns_name.replace('.', '-') + 'zone-id'
+
+def _resolver_test_cases(resolver_component_data, records_to_skip):
+ out = []
+ for test_case in resolver_component_data['resolver_component_tests']:
+ if test_case['record_to_resolve'] in records_to_skip:
+ continue
+ out.append({
+ 'target_name': _append_zone_name(test_case['record_to_resolve'],
+ resolver_component_data['resolver_tests_common_zone_name']),
+ 'expected_addrs': _build_expected_addrs_cmd_arg(test_case['expected_addrs']),
+ 'expected_chosen_service_config': (test_case['expected_chosen_service_config'] or ''),
+ 'expected_lb_policy': (test_case['expected_lb_policy'] or ''),
+ })
+ return out
+
def main():
resolver_component_data = ''
with open('test/cpp/naming/resolver_test_record_groups.yaml') as f:
resolver_component_data = yaml.load(f)
json = {
- 'resolver_component_test_cases': [
- {
- 'target_name': _append_zone_name(test_case['record_to_resolve'],
- resolver_component_data['resolver_component_tests_common_zone_name']),
- 'expected_addrs': _build_expected_addrs_cmd_arg(test_case['expected_addrs']),
- 'expected_chosen_service_config': (test_case['expected_chosen_service_config'] or ''),
- 'expected_lb_policy': (test_case['expected_lb_policy'] or ''),
- } for test_case in resolver_component_data['resolver_component_tests']
- ],
+ 'resolver_tests_common_zone_name': resolver_component_data['resolver_tests_common_zone_name'],
+ 'resolver_gce_integration_tests_zone_id': _gce_dns_zone_id(resolver_component_data),
+ 'all_integration_test_records': _gcloud_uploadable_form(resolver_component_data['resolver_component_tests'],
+ resolver_component_data['resolver_tests_common_zone_name']),
+ 'resolver_gce_integration_test_cases': _resolver_test_cases(resolver_component_data, _TARGET_RECORDS_TO_SKIP_AGAINST_GCE),
+ 'resolver_component_test_cases': _resolver_test_cases(resolver_component_data, []),
'targets': [
{
'name': 'resolver_component_test' + unsecure_build_config_suffix,
diff --git a/test/cpp/naming/private_dns_zone_init.sh b/test/cpp/naming/private_dns_zone_init.sh
new file mode 100755
index 0000000000..4eaf750ab7
--- /dev/null
+++ b/test/cpp/naming/private_dns_zone_init.sh
@@ -0,0 +1,215 @@
+#!/bin/bash
+# Copyright 2015 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is auto-generated
+
+set -ex
+
+cd $(dirname $0)/../../..
+
+gcloud dns record-sets transaction start -z=resolver-tests-version-1-grpctestingexp-zone-id
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=_grpclb._tcp.srv-ipv4-single-target.resolver-tests-version-1.grpctestingexp. \
+ --type=SRV \
+ --ttl=2100 \
+ "0 0 1234 ipv4-single-target.resolver-tests-version-1.grpctestingexp."
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-single-target.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=_grpclb._tcp.srv-ipv4-multi-target.resolver-tests-version-1.grpctestingexp. \
+ --type=SRV \
+ --ttl=2100 \
+ "0 0 1234 ipv4-multi-target.resolver-tests-version-1.grpctestingexp."
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-multi-target.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.5" "1.2.3.6" "1.2.3.7"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=_grpclb._tcp.srv-ipv6-single-target.resolver-tests-version-1.grpctestingexp. \
+ --type=SRV \
+ --ttl=2100 \
+ "0 0 1234 ipv6-single-target.resolver-tests-version-1.grpctestingexp."
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv6-single-target.resolver-tests-version-1.grpctestingexp. \
+ --type=AAAA \
+ --ttl=2100 \
+ "2607:f8b0:400a:801::1001"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=_grpclb._tcp.srv-ipv6-multi-target.resolver-tests-version-1.grpctestingexp. \
+ --type=SRV \
+ --ttl=2100 \
+ "0 0 1234 ipv6-multi-target.resolver-tests-version-1.grpctestingexp."
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv6-multi-target.resolver-tests-version-1.grpctestingexp. \
+ --type=AAAA \
+ --ttl=2100 \
+ "2607:f8b0:400a:801::1002" "2607:f8b0:400a:801::1003" "2607:f8b0:400a:801::1004"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. \
+ --type=TXT \
+ --ttl=2100 \
+ '"grpc_config=[{\"serviceConfig\":{\"loadBalancingPolicy\":\"round_robin\",\"methodConfig\":[{\"name\":[{\"method\":\"Foo\",\"service\":\"SimpleService\",\"waitForReady\":true}]}]}}]"'
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=_grpclb._tcp.srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. \
+ --type=SRV \
+ --ttl=2100 \
+ "0 0 1234 ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp."
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp. \
+ --type=TXT \
+ --ttl=2100 \
+ '"grpc_config=[{\"serviceConfig\":{\"loadBalancingPolicy\":\"round_robin\",\"methodConfig\":[{\"name\":[{\"method\":\"Foo\",\"service\":\"NoSrvSimpleService\",\"waitForReady\":true}]}]}}]"'
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp. \
+ --type=TXT \
+ --ttl=2100 \
+ '"grpc_config=[{\"clientLanguage\":[\"python\"],\"serviceConfig\":{\"loadBalancingPolicy\":\"round_robin\",\"methodConfig\":[{\"name\":[{\"method\":\"Foo\",\"service\":\"PythonService\",\"waitForReady\":true}]}]}}]"'
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp. \
+ --type=TXT \
+ --ttl=2100 \
+ '"grpc_config=[{\"percentage\":0,\"serviceConfig\":{\"loadBalancingPolicy\":\"round_robin\",\"methodConfig\":[{\"name\":[{\"method\":\"Foo\",\"service\":\"CppService\",\"waitForReady\":true}]}]}}]"'
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp. \
+ --type=TXT \
+ --ttl=2100 \
+ '"grpc_config=[{\"clientLanguage\":[\"go\"],\"serviceConfig\":{\"loadBalancingPolicy\":\"round_robin\",\"methodConfig\":[{\"name\":[{\"method\":\"Foo\",\"service\":\"GoService\",\"waitForReady\":true}]}]}},{\"clientLanguage\":[\"c++\"],\"serviceConfig\":{" "\"loadBalancingPolicy\":\"round_robin\",\"methodConfig\":[{\"name\":[{\"method\":\"Foo\",\"service\":\"CppService\",\"waitForReady\":true}]}]}}]"'
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp. \
+ --type=TXT \
+ --ttl=2100 \
+ '"grpc_config=[{\"percentage\":0,\"serviceConfig\":{\"loadBalancingPolicy\":\"round_robin\",\"methodConfig\":[{\"name\":[{\"method\":\"Foo\",\"service\":\"NeverPickedService\",\"waitForReady\":true}]}]}},{\"percentage\":100,\"serviceConfig\":{\"loadBalanc" "ingPolicy\":\"round_robin\",\"methodConfig\":[{\"name\":[{\"method\":\"Foo\",\"service\":\"AlwaysPickedService\",\"waitForReady\":true}]}]}}]"'
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=_grpclb._tcp.srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. \
+ --type=SRV \
+ --ttl=2100 \
+ "0 0 1234 balancer-for-ipv4-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp."
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=balancer-for-ipv4-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. \
+ --type=A \
+ --ttl=2100 \
+ "1.2.3.4"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=_grpclb._tcp.srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. \
+ --type=SRV \
+ --ttl=2100 \
+ "0 0 1234 balancer-for-ipv6-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp."
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=balancer-for-ipv6-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. \
+ --type=AAAA \
+ --ttl=2100 \
+ "2607:f8b0:400a:801::1002"
+
+gcloud dns record-sets transaction add \
+ -z=resolver-tests-version-1-grpctestingexp-zone-id \
+ --name=srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. \
+ --type=AAAA \
+ --ttl=2100 \
+ "2607:f8b0:400a:801::1002"
+
+gcloud dns record-sets transaction describe -z=resolver-tests-version-1-grpctestingexp-zone-id
+gcloud dns record-sets transaction execute -z=resolver-tests-version-1-grpctestingexp-zone-id
+gcloud dns record-sets list -z=resolver-tests-version-1-grpctestingexp-zone-id
diff --git a/test/cpp/naming/resolver_component_tests_runner.sh b/test/cpp/naming/resolver_component_tests_runner.sh
index cf71c9dcf9..407db5ed66 100755
--- a/test/cpp/naming/resolver_component_tests_runner.sh
+++ b/test/cpp/naming/resolver_component_tests_runner.sh
@@ -73,7 +73,7 @@ EXIT_CODE=0
# in the resolver.
$FLAGS_test_bin_path \
- --target_name='srv-ipv4-single-target.resolver-tests.grpctestingexp.' \
+ --target_name='srv-ipv4-single-target.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:1234,True' \
--expected_chosen_service_config='' \
--expected_lb_policy='' \
@@ -81,7 +81,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='srv-ipv4-multi-target.resolver-tests.grpctestingexp.' \
+ --target_name='srv-ipv4-multi-target.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.5:1234,True;1.2.3.6:1234,True;1.2.3.7:1234,True' \
--expected_chosen_service_config='' \
--expected_lb_policy='' \
@@ -89,7 +89,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='srv-ipv6-single-target.resolver-tests.grpctestingexp.' \
+ --target_name='srv-ipv6-single-target.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='[2607:f8b0:400a:801::1001]:1234,True' \
--expected_chosen_service_config='' \
--expected_lb_policy='' \
@@ -97,7 +97,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='srv-ipv6-multi-target.resolver-tests.grpctestingexp.' \
+ --target_name='srv-ipv6-multi-target.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='[2607:f8b0:400a:801::1002]:1234,True;[2607:f8b0:400a:801::1003]:1234,True;[2607:f8b0:400a:801::1004]:1234,True' \
--expected_chosen_service_config='' \
--expected_lb_policy='' \
@@ -105,7 +105,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='srv-ipv4-simple-service-config.resolver-tests.grpctestingexp.' \
+ --target_name='srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:1234,True' \
--expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"SimpleService","waitForReady":true}]}]}' \
--expected_lb_policy='round_robin' \
@@ -113,7 +113,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='ipv4-no-srv-simple-service-config.resolver-tests.grpctestingexp.' \
+ --target_name='ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:443,False' \
--expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"NoSrvSimpleService","waitForReady":true}]}]}' \
--expected_lb_policy='round_robin' \
@@ -121,7 +121,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='ipv4-no-config-for-cpp.resolver-tests.grpctestingexp.' \
+ --target_name='ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:443,False' \
--expected_chosen_service_config='' \
--expected_lb_policy='' \
@@ -129,7 +129,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='ipv4-cpp-config-has-zero-percentage.resolver-tests.grpctestingexp.' \
+ --target_name='ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:443,False' \
--expected_chosen_service_config='' \
--expected_lb_policy='' \
@@ -137,7 +137,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='ipv4-second-language-is-cpp.resolver-tests.grpctestingexp.' \
+ --target_name='ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:443,False' \
--expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"CppService","waitForReady":true}]}]}' \
--expected_lb_policy='round_robin' \
@@ -145,7 +145,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='ipv4-config-with-percentages.resolver-tests.grpctestingexp.' \
+ --target_name='ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:443,False' \
--expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"AlwaysPickedService","waitForReady":true}]}]}' \
--expected_lb_policy='round_robin' \
@@ -153,7 +153,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='srv-ipv4-target-has-backend-and-balancer.resolver-tests.grpctestingexp.' \
+ --target_name='srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:1234,True;1.2.3.4:443,False' \
--expected_chosen_service_config='' \
--expected_lb_policy='' \
@@ -161,7 +161,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='srv-ipv6-target-has-backend-and-balancer.resolver-tests.grpctestingexp.' \
+ --target_name='srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='[2607:f8b0:400a:801::1002]:1234,True;[2607:f8b0:400a:801::1002]:443,False' \
--expected_chosen_service_config='' \
--expected_lb_policy='' \
@@ -169,7 +169,7 @@ $FLAGS_test_bin_path \
wait $! || EXIT_CODE=1
$FLAGS_test_bin_path \
- --target_name='ipv4-config-causing-fallback-to-tcp.resolver-tests.grpctestingexp.' \
+ --target_name='ipv4-config-causing-fallback-to-tcp.resolver-tests-version-1.grpctestingexp.' \
--expected_addrs='1.2.3.4:443,False' \
--expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwo","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooThree","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooFour","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooFive","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooSix","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooSeven","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooEight","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooNine","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTen","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooEleven","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwelve","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwelve","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwelve","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwelve","service":"SimpleService","waitForReady":true}]}]}' \
--expected_lb_policy='' \
diff --git a/test/cpp/naming/resolver_gce_integration_tests_runner.sh b/test/cpp/naming/resolver_gce_integration_tests_runner.sh
new file mode 100755
index 0000000000..b20d18d9d1
--- /dev/null
+++ b/test/cpp/naming/resolver_gce_integration_tests_runner.sh
@@ -0,0 +1,359 @@
+#!/bin/bash
+# Copyright 2015 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is auto-generated
+
+set -ex
+
+if [[ "$GRPC_DNS_RESOLVER" == "" ]]; then
+ export GRPC_DNS_RESOLVER=ares
+elif [[ "$GRPC_DNS_RESOLVER" != ares ]]; then
+ echo "Unexpected: GRPC_DNS_RESOLVER=$GRPC_DNS_RESOLVER. This test only works with c-ares resolver"
+ exit 1
+fi
+
+cd $(dirname $0)/../../..
+
+if [[ "$CONFIG" == "" ]]; then
+ export CONFIG=opt
+fi
+make resolver_component_test
+echo "Sanity check DNS records are resolveable with dig:"
+EXIT_CODE=0
+
+ONE_FAILED=0
+dig SRV _grpclb._tcp.srv-ipv4-single-target.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig SRV _grpclb._tcp.srv-ipv4-single-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A ipv4-single-target.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A ipv4-single-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig SRV _grpclb._tcp.srv-ipv4-multi-target.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig SRV _grpclb._tcp.srv-ipv4-multi-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A ipv4-multi-target.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A ipv4-multi-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig SRV _grpclb._tcp.srv-ipv6-single-target.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig SRV _grpclb._tcp.srv-ipv6-single-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig AAAA ipv6-single-target.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig AAAA ipv6-single-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig SRV _grpclb._tcp.srv-ipv6-multi-target.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig SRV _grpclb._tcp.srv-ipv6-multi-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig AAAA ipv6-multi-target.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig AAAA ipv6-multi-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig TXT srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig TXT srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig SRV _grpclb._tcp.srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig SRV _grpclb._tcp.srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig TXT ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig TXT ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig TXT ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig TXT ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig TXT ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig TXT ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig TXT ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig TXT ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig TXT ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig TXT ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig SRV _grpclb._tcp.srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig SRV _grpclb._tcp.srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A balancer-for-ipv4-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A balancer-for-ipv4-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig A srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig A srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig SRV _grpclb._tcp.srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig SRV _grpclb._tcp.srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig AAAA balancer-for-ipv6-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig AAAA balancer-for-ipv6-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+ONE_FAILED=0
+dig AAAA srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. | grep 'ANSWER SECTION' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Sanity check: dig AAAA srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. FAILED"
+ exit 1
+fi
+
+echo "Sanity check PASSED. Run resolver tests:"
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='srv-ipv4-single-target.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.4:1234,True' \
+ --expected_chosen_service_config='' \
+ --expected_lb_policy='' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: srv-ipv4-single-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='srv-ipv4-multi-target.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.5:1234,True;1.2.3.6:1234,True;1.2.3.7:1234,True' \
+ --expected_chosen_service_config='' \
+ --expected_lb_policy='' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: srv-ipv4-multi-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='srv-ipv6-single-target.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='[2607:f8b0:400a:801::1001]:1234,True' \
+ --expected_chosen_service_config='' \
+ --expected_lb_policy='' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: srv-ipv6-single-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='srv-ipv6-multi-target.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='[2607:f8b0:400a:801::1002]:1234,True;[2607:f8b0:400a:801::1003]:1234,True;[2607:f8b0:400a:801::1004]:1234,True' \
+ --expected_chosen_service_config='' \
+ --expected_lb_policy='' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: srv-ipv6-multi-target.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.4:1234,True' \
+ --expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"SimpleService","waitForReady":true}]}]}' \
+ --expected_lb_policy='round_robin' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: srv-ipv4-simple-service-config.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.4:443,False' \
+ --expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"NoSrvSimpleService","waitForReady":true}]}]}' \
+ --expected_lb_policy='round_robin' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: ipv4-no-srv-simple-service-config.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.4:443,False' \
+ --expected_chosen_service_config='' \
+ --expected_lb_policy='' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: ipv4-no-config-for-cpp.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.4:443,False' \
+ --expected_chosen_service_config='' \
+ --expected_lb_policy='' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: ipv4-cpp-config-has-zero-percentage.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.4:443,False' \
+ --expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"CppService","waitForReady":true}]}]}' \
+ --expected_lb_policy='round_robin' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: ipv4-second-language-is-cpp.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.4:443,False' \
+ --expected_chosen_service_config='{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"AlwaysPickedService","waitForReady":true}]}]}' \
+ --expected_lb_policy='round_robin' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: ipv4-config-with-percentages.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='1.2.3.4:1234,True;1.2.3.4:443,False' \
+ --expected_chosen_service_config='' \
+ --expected_lb_policy='' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: srv-ipv4-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+ONE_FAILED=0
+bins/$CONFIG/resolver_component_test \
+ --target_name='srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp.' \
+ --expected_addrs='[2607:f8b0:400a:801::1002]:1234,True;[2607:f8b0:400a:801::1002]:443,False' \
+ --expected_chosen_service_config='' \
+ --expected_lb_policy='' || ONE_FAILED=1
+if [[ "$ONE_FAILED" != 0 ]]; then
+ echo "Test based on target record: srv-ipv6-target-has-backend-and-balancer.resolver-tests-version-1.grpctestingexp. FAILED"
+ EXIT_CODE=1
+fi
+
+exit $EXIT_CODE
diff --git a/test/cpp/naming/resolver_test_record_groups.yaml b/test/cpp/naming/resolver_test_record_groups.yaml
index 33d774ca70..2b3204335c 100644
--- a/test/cpp/naming/resolver_test_record_groups.yaml
+++ b/test/cpp/naming/resolver_test_record_groups.yaml
@@ -1,4 +1,4 @@
-resolver_component_tests_common_zone_name: resolver-tests.grpctestingexp.
+resolver_tests_common_zone_name: resolver-tests-version-1.grpctestingexp.
resolver_component_tests:
- expected_addrs:
- {address: '1.2.3.4:1234', is_balancer: true}
diff --git a/test/cpp/naming/test_dns_server.py b/test/cpp/naming/test_dns_server.py
index 9d4b89cffb..9f42f65ee6 100755
--- a/test/cpp/naming/test_dns_server.py
+++ b/test/cpp/naming/test_dns_server.py
@@ -66,7 +66,7 @@ def start_local_dns_server(args):
with open(args.records_config_path) as config:
test_records_config = yaml.load(config)
- common_zone_name = test_records_config['resolver_component_tests_common_zone_name']
+ common_zone_name = test_records_config['resolver_tests_common_zone_name']
for group in test_records_config['resolver_component_tests']:
for name in group['records'].keys():
for record in group['records'][name]:
diff --git a/tools/internal_ci/linux/grpc_performance_profile_daily.sh b/tools/internal_ci/linux/grpc_performance_profile_daily.sh
index 25523e21b8..34d41bc04c 100755
--- a/tools/internal_ci/linux/grpc_performance_profile_daily.sh
+++ b/tools/internal_ci/linux/grpc_performance_profile_daily.sh
@@ -22,6 +22,8 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_perf_rc
CPUS=`python -c 'import multiprocessing; print multiprocessing.cpu_count()'`
+./tools/run_tests/start_port_server.py || true
+
make CONFIG=opt memory_profile_test memory_profile_client memory_profile_server -j $CPUS
bins/opt/memory_profile_test
bq load microbenchmarks.memory memory_usage.csv
diff --git a/tools/jenkins/run_performance_profile_daily.sh b/tools/jenkins/run_performance_profile_daily.sh
index 04a2464aee..48d82a9b7f 100755
--- a/tools/jenkins/run_performance_profile_daily.sh
+++ b/tools/jenkins/run_performance_profile_daily.sh
@@ -29,4 +29,6 @@ fi
BENCHMARKS_TO_RUN="bm_fullstack_unary_ping_pong bm_fullstack_streaming_ping_pong bm_fullstack_streaming_pump bm_closure bm_cq bm_call_create bm_error bm_chttp2_hpack bm_chttp2_transport bm_pollset bm_metadata"
+./tools/run_tests/start_port_server.py || true
+
$PYTHON tools/run_tests/run_microbenchmark.py --collect summary perf latency -b $BENCHMARKS_TO_RUN
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index b38108d456..6697149dd9 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -717,6 +717,9 @@ class PythonLanguage(object):
return (pypy32_config,)
elif args.compiler == 'python_alpine':
return (python27_config,)
+ elif args.compiler == 'all_the_cpythons':
+ return (python27_config, python34_config, python35_config,
+ python36_config,)
else:
raise Exception('Compiler %s not supported.' % args.compiler)
@@ -1214,7 +1217,7 @@ argp.add_argument('--compiler',
choices=['default',
'gcc4.4', 'gcc4.6', 'gcc4.8', 'gcc4.9', 'gcc5.3', 'gcc_musl',
'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7',
- 'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine',
+ 'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine', 'all_the_cpythons',
'node0.12', 'node4', 'node5', 'node6', 'node7', 'node8',
'electron1.3', 'electron1.6',
'coreclr',