Create integration tests for grpc resolvers on GCE DNS#12010
Create integration tests for grpc resolvers on GCE DNS#12010apolcyn wants to merge 2 commits intogrpc:masterfrom
Conversation
|
|
|
Thanks a lot for adding this test! |
|
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? |
|
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? |
|
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. |
|
|
|
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. |
|
closing this, to replace it with #12651 |
Add c-ares resolver tests against GCE DNS, redo of #12010
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-coretest.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.pyis the source of truth for all test records, with test records as python objects.tools/gce/create_private_dns_zone.shcreates an new/unpopulated GCE DNS private zone - meant for one-time use for GCE environment setup.tools/gce/private_dns_zone_init.shinitializes the GCE DNS private zone with DNS A/AAAA/SRV records - also meant for one-time use.tools/run_tests/run_name_resolution_tests.pysanity checks the test environment (checks that expected records are present usingdig), and then runs the language-specific resolver tests.GRPC_DNS_TEST_A_RECORD_NAMEor an SRV record inGRPC_DNS_TEST_SRV_RECORD_NAME, and expected end result IP/ports inGRPC_DNS_TEST_EXPECTED_ADDRS, and verifies that resolved IP/ports match expected.GRPC_DNS_TEST_SRV_RECORD_NAMEis 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