DRIVERS-3162 Add test for SRV hostname validation when resolver and r…#1787
DRIVERS-3162 Add test for SRV hostname validation when resolver and r…#1787aclark4life wants to merge 3 commits into
Conversation
|
|
||
| ### 5. Do not throw when return address is identical to SRV hostname and SRV hostname has three or more `.` separated parts | ||
|
|
||
| - the SRV `mongodb+srv://blogs.mongodb.com` resolving to `blogs.mongodb.com` |
There was a problem hiding this comment.
Should we add the case where mongodb+srv://blogs.mongodb.com resolves to test.blogs.mongodb.com? Or is that already tested elsewhere?
There was a problem hiding this comment.
Not sure. We're adding the 5th test because the previous 3 tests confirm that an error is raised. Similar to the first test in which we confirm there is no error, this test confirms there is no error. IIUC, a response of test.blogs.mongodb.com is valid because the domains match, but the hostnames are not identical so we're not looking for this particular success in this test case.
|
@dariakp @ShaneHarvey Just noticed this stalled, what's next (if you happen to recall, else I'll review!) ? |
|
@aclark4life The tests are pretty straightforward here and I think the only thing we were waiting on was dev prod; as Shane is the eng lead on the ticket I'll defer to his judgment on what's left to finish this spec change - you have my tentative approval modulo lint issues. It's a good idea to include a link to the driver PR/CI in the description though, for future reference. |
|
@aclark4life these changes LGTM but https://jira.mongodb.org/browse/DEVPROD-17419 added the real SRV hosts so we can actually add JSON spec tests for these two cases. Should we update this PR to remove the prose test and add the spec test files? JSON files are easier for drivers to implement so that would be my preference. |
| - the SRV `mongodb+srv://mongo.local` resolving to `test_1.my_hostmongo.local` | ||
| - the SRV `mongodb+srv://blogs.mongodb.com` resolving to `cluster.testmongodb.com` | ||
|
|
||
| ### 5. Do not throw when return address is identical to SRV hostname and SRV hostname has three or more `.` separated parts |
There was a problem hiding this comment.
sorry if this is silly and i'm missing something but why cant this be a unified test?
(If i'm reading the PYTHON-3527's PR correctly, I see that JSON files were added and I do believe they're in the same format as the other unified tests in this spec?)
There was a problem hiding this comment.
sorry if this is silly and i'm missing something but why cant this be a unified test?
(If i'm reading the PYTHON-3527's PR correctly, I see that JSON files were added and I do believe they're in the same format as the other unified tests in this spec?)
Assume you mean PYTHON-5327! Also can you explain what that means for this PR? Add unit tests here? @blink1073 suggested something similar … also note there are two PRs for this in the driver, listed here.
There was a problem hiding this comment.
Ah yes, sorry about the typo, but i was referring to the identical-hostnames-valid-four-parts.json and identical-hostnames-valid-three-parts.json files specifically. I believe they're JSON spec tests and thus should be added to this repo (and are the same as the prose test you've described?)
There was a problem hiding this comment.
and removed from pymongo or … ?
There was a problem hiding this comment.
Good call @sleepyStick thanks!
Removed prose test case and added JSON/YAML spec test files matching the ones from the driver PR:
replica-set/identical-hostnames-valid-three-parts.{json,yml}(mongodb+srv://build.10gen.cc)replica-set/identical-hostnames-valid-four-parts.{json,yml}(mongodb+srv://test.build.10gen.cc)
Documented two new SRV records in the DNS records table in the README (created in DEVPROD-17419 and fixed in DEVPROD-34211) so the tests are reproducible.
These can now be removed from pymongo and consumed from the spec repo like the other JSON tests. 🎉
|
|
A tad unrelated but it seems like the PYTHON-4575 jira ticket is actually split from DRIVERS-2922? So maybe there's only one python PR associated with this driver ticket? |
…esolved hostnames are identical with three domain levels
e6d53a1 to
606b4d8
Compare
DRIVERS-3162
Driver PR:
Please complete the following before merging:
clusters, and serverless).