-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* PMM-13543 Support socket path. PMM-13477 Support of PSMDB 8.0. * Apply suggestions from code review Co-authored-by: Alex Demidoff <[email protected]> --------- Co-authored-by: Alex Demidoff <[email protected]>
- Loading branch information
Showing
3 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,6 +227,48 @@ func TestBuildURI(t *testing.T) { | |
newPassword: "yyy?!#$%^&*()_+", | ||
expect: "mongodb://xxx%3F%21%23$%25%5E&%2A%28%29_+:yyy%3F%21%23$%25%5E&%2A%28%[email protected]", | ||
}, | ||
{ | ||
situation: "path to socket", | ||
origin: "mongodb:///tmp/mongodb-27017.sock", | ||
newUser: "", | ||
newPassword: "", | ||
expect: "mongodb:///tmp/mongodb-27017.sock", | ||
}, | ||
{ | ||
situation: "path to socket with params", | ||
origin: "mongodb://username:s3cur3%20p%40$$w0r4.@%2Fvar%2Frun%2Fmongodb%2Fmongodb.sock/database?connectTimeoutMS=1000&directConnection=true&serverSelectionTimeoutMS=1000", | ||
newUser: "", | ||
newPassword: "", | ||
expect: "mongodb://username:s3cur3%20p%40$$w0r4.@%2Fvar%2Frun%2Fmongodb%2Fmongodb.sock/database?connectTimeoutMS=1000&directConnection=true&serverSelectionTimeoutMS=1000", | ||
}, | ||
{ | ||
situation: "path to socket with auth", | ||
origin: "mongodb://xxx:yyy@/tmp/mongodb-27017.sock", | ||
newUser: "", | ||
newPassword: "", | ||
expect: "mongodb://xxx:yyy@/tmp/mongodb-27017.sock", | ||
}, | ||
{ | ||
situation: "path to socket with auth and user params", | ||
origin: "mongodb:///tmp/mongodb-27017.sock", | ||
newUser: "xxx", | ||
newPassword: "yyy", | ||
expect: "mongodb://xxx:yyy@/tmp/mongodb-27017.sock", | ||
}, | ||
{ | ||
situation: "path to socket without prefix", | ||
origin: "/tmp/mongodb-27017.sock", | ||
newUser: "", | ||
newPassword: "", | ||
expect: "mongodb:///tmp/mongodb-27017.sock", | ||
}, | ||
{ | ||
situation: "path to socket without prefix with auth", | ||
origin: "/tmp/mongodb-27017.sock", | ||
newUser: "xxx", | ||
newPassword: "yyy", | ||
expect: "mongodb://xxx:yyy@/tmp/mongodb-27017.sock", | ||
}, | ||
} | ||
for _, tc := range tests { | ||
t.Run(tc.situation, func(t *testing.T) { | ||
|