From 0151fd2dcf1501cfe00f1d2801b4d39abe14ae7b Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Fri, 7 Mar 2025 13:31:49 -0500 Subject: [PATCH] DRIVERS-3128 test secondary with IPv6 literal in SDAM --- .../tests/rs/secondary_ipv6_literal.json | 38 +++++++++++++++++++ .../tests/rs/secondary_ipv6_literal.yml | 25 ++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 source/server-discovery-and-monitoring/tests/rs/secondary_ipv6_literal.json create mode 100644 source/server-discovery-and-monitoring/tests/rs/secondary_ipv6_literal.yml diff --git a/source/server-discovery-and-monitoring/tests/rs/secondary_ipv6_literal.json b/source/server-discovery-and-monitoring/tests/rs/secondary_ipv6_literal.json new file mode 100644 index 0000000000..c23d8dc4c9 --- /dev/null +++ b/source/server-discovery-and-monitoring/tests/rs/secondary_ipv6_literal.json @@ -0,0 +1,38 @@ +{ + "description": "Secondary with IPv6 literal", + "uri": "mongodb://[::1]/?replicaSet=rs", + "phases": [ + { + "responses": [ + [ + "[::1]:27017", + { + "ok": 1, + "helloOk": true, + "isWritablePrimary": false, + "secondary": true, + "setName": "rs", + "me": "[::1]:27017", + "hosts": [ + "[::1]:27017" + ], + "minWireVersion": 0, + "maxWireVersion": 26 + } + ] + ], + "outcome": { + "servers": { + "[::1]:27017": { + "type": "RSSecondary", + "setName": "rs" + } + }, + "topologyType": "ReplicaSetNoPrimary", + "setName": "rs", + "logicalSessionTimeoutMinutes": null, + "compatible": true + } + } + ] +} diff --git a/source/server-discovery-and-monitoring/tests/rs/secondary_ipv6_literal.yml b/source/server-discovery-and-monitoring/tests/rs/secondary_ipv6_literal.yml new file mode 100644 index 0000000000..bac3496968 --- /dev/null +++ b/source/server-discovery-and-monitoring/tests/rs/secondary_ipv6_literal.yml @@ -0,0 +1,25 @@ +# Regression test for bug discovered in HELP-68823. +description: Secondary with IPv6 literal +uri: mongodb://[::1]/?replicaSet=rs +phases: +- responses: + - - "[::1]:27017" + - ok: 1 + helloOk: true + isWritablePrimary: false + secondary: true + setName: rs + me: "[::1]:27017" + hosts: + - "[::1]:27017" + minWireVersion: 0 + maxWireVersion: 26 + outcome: + servers: + "[::1]:27017": + type: RSSecondary + setName: rs + topologyType: ReplicaSetNoPrimary + setName: rs + logicalSessionTimeoutMinutes: null + compatible: true