Skip to content

Create integration tests for grpc resolvers on GCE DNS#12010

Closed
apolcyn wants to merge 2 commits intogrpc:masterfrom
apolcyn:cares_srv_master
Closed

Create integration tests for grpc resolvers on GCE DNS#12010
apolcyn wants to merge 2 commits intogrpc:masterfrom
apolcyn:cares_srv_master

Conversation

@apolcyn
Copy link
Copy Markdown
Contributor

@apolcyn apolcyn commented Aug 1, 2017

This adds tests for ability of grpc resolvers to resolve SRV records on GCE DNS private zones. These tests have been running successfully for a while on jenkins (see https://grpc-testing.appspot.com/job/gRPC_naming_adhoc/). This adds one-time environment setup scripts, a test runner, and the c-core test.

The setup scripts try to create a consistent test environment (populate a GCE DNS private zone with test records), meant for use as follows:

Note: tools/run_tests/name_resolution/dns_records_config.py is the source of truth for all test records, with test records as python objects.

  1. tools/gce/create_private_dns_zone.sh creates an new/unpopulated GCE DNS private zone - meant for one-time use for GCE environment setup.

  2. tools/gce/private_dns_zone_init.sh initializes the GCE DNS private zone with DNS A/AAAA/SRV records - also meant for one-time use.

  3. tools/run_tests/run_name_resolution_tests.py sanity checks the test environment (checks that expected records are present using dig), and then runs the language-specific resolver tests.

  • The language-specific tests take either a starting A/AAAA record in GRPC_DNS_TEST_A_RECORD_NAME or an SRV record in GRPC_DNS_TEST_SRV_RECORD_NAME, and expected end result IP/ports in GRPC_DNS_TEST_EXPECTED_ADDRS, and verifies that resolved IP/ports match expected.
  • e.g., if GRPC_DNS_TEST_SRV_RECORD_NAME is set, then the result of first resolving the SRV record, and then resolving the pointed-to A/AAAA record, should match expected IPs.

adding @jtattermusch for overall additions of build/test scripts.

adding @y-zeng for review of test/core/naming_end2end/resolve_srv_records.c (with it's invocation in https://github.com/grpc/grpc/compare/master...apolcyn:cares_srv_master?expand=1#diff-6c4c6dfee80b3f8dcc6b1edf52d055ebR97)

cc @a11r

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

[trickle] No significant performance differences

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

[microbenchmarks] No significant performance differences

@y-zeng
Copy link
Copy Markdown
Contributor

y-zeng commented Aug 1, 2017

Thanks a lot for adding this test!
cc @markdroth

@markdroth markdroth self-requested a review August 2, 2017 16:53
@markdroth markdroth self-assigned this Aug 2, 2017
@markdroth
Copy link
Copy Markdown
Member

One problem with this approach is that it depends on GCE DNS, which means that the test is nor hermetic.

I recently discussed a better approach with @nicolasnoble, which was to change the port server to run a local DNS server via some python DNS server module, and then point at that DNS server to run the tests. Can you work on putting together something like that instead?

@apolcyn
Copy link
Copy Markdown
Contributor Author

apolcyn commented Aug 2, 2017

One goal here though was to specifically test the resolver's integration with GCE DNS - sacrificing the test being hermetic for the purpose of testing against real GCE DNS.

Perhaps we'd want both? - the GCE-specific integration test and ability to use a local DNS server?

@markdroth
Copy link
Copy Markdown
Member

I am fine with having both, but I don't think we can run the GCE DNS test as part of our automated test suite -- I think it would have to be something that we run manually. @nicolasnoble can tell you more about this.

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

[trickle] No significant performance differences

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

[microbenchmarks] No significant performance differences

@apolcyn
Copy link
Copy Markdown
Contributor Author

apolcyn commented Aug 10, 2017

BTW, it looks like the local DNS server tests and this test can share a lot of the same code, I'll keep them as separate PR's, but will probably soon revise this fit with the local DNS server tests.

@apolcyn
Copy link
Copy Markdown
Contributor Author

apolcyn commented Sep 20, 2017

closing this, to replace it with #12651

@apolcyn apolcyn closed this Sep 20, 2017
apolcyn added a commit that referenced this pull request Sep 28, 2017
Add c-ares resolver tests against GCE DNS, redo of #12010
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants