-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #95 autonomous UnitTest, and improve IT misconfig feedback
- Loading branch information
Showing
2 changed files
with
31 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,17 +23,21 @@ describe("MTWrapper unit tests", function () { | |
const mtOptions = new MTOptions({ | ||
db: testDbName, | ||
port: testFixedPort, | ||
path: testBackupDirectory | ||
path: testBackupDirectory, | ||
username:"myUser", | ||
password:"myPass" | ||
}); | ||
|
||
const command = wrapper.commandConnectFromOptions(mtOptions, '--beginning'); | ||
|
||
command.should.be.eql("--beginning --host 127.0.0.1 --port 17017 --username root --password mypass --authenticationDatabase admin --db myDbForTest"); | ||
command.should.be.eql("--beginning --host 127.0.0.1 --port 17017 --username myUser --password myPass --authenticationDatabase admin --db myDbForTest"); | ||
}); | ||
|
||
it("should wrap dump commandConnectFromOptions uri ssl", async function () { | ||
const mtOptions = new MTOptions({ | ||
uri: testDbUri, | ||
username:"myUser", | ||
password:"myPass", | ||
ssl: "1", | ||
sslCAFile: "/tmp/myCAfile", | ||
sslPEMKeyFile: "/tmp/pem/sslPEMKeyFile", | ||
|
@@ -45,7 +49,7 @@ describe("MTWrapper unit tests", function () { | |
|
||
const command = wrapper.commandConnectFromOptions(mtOptions, '--beginning'); | ||
|
||
command.should.be.eql("--beginning --uri mongodb://root:[email protected]:17017/myDbForTest?authSource=admin " | ||
command.should.be.eql(`--beginning --uri ${testDbUri} ` | ||
+ "--ssl --sslCAFile /tmp/myCAfile --sslPEMKeyFile /tmp/pem/sslPEMKeyFile --sslPEMKeyPassword strongPassHere " | ||
+ "--sslCRLFile /tmp/pem/sslCRLFile --sslFIPSMode --tlsInsecure"); | ||
}); | ||
|
@@ -54,12 +58,14 @@ describe("MTWrapper unit tests", function () { | |
const mtOptions = new MTOptions({ | ||
db: testDbName, | ||
port: testFixedPort, | ||
path: testBackupDirectory | ||
path: testBackupDirectory, | ||
username:"myUser", | ||
password:"myPass", | ||
}); | ||
|
||
const command = wrapper.commandConnectFromOptions(mtOptions, '--beginning', true); | ||
|
||
command.should.be.eql("--beginning --host 127.0.0.1 --port 17017 --username root --password mypass --authenticationDatabase admin --nsInclude myDbForTest.*"); | ||
command.should.be.eql("--beginning --host 127.0.0.1 --port 17017 --username myUser --password myPass --authenticationDatabase admin --nsInclude myDbForTest.*"); | ||
}); | ||
|
||
it("should wrap restore commandConnectFromOptions db user basic source and target dbs", async function () { | ||
|
@@ -68,12 +74,14 @@ describe("MTWrapper unit tests", function () { | |
dbFrom: testSourceDbName, | ||
dbTo: testTargetDbName, | ||
port: testFixedPort, | ||
path: testBackupDirectory | ||
path: testBackupDirectory, | ||
username:"myUser", | ||
password:"myPass", | ||
}); | ||
|
||
const command = wrapper.commandConnectFromOptions(mtOptions, '--beginning', true); | ||
|
||
command.should.be.eql("--beginning --host 127.0.0.1 --port 17017 --username root --password mypass --authenticationDatabase admin --nsFrom mySourceDbForTest.* --nsTo myTargetDbForTest.*"); | ||
command.should.be.eql("--beginning --host 127.0.0.1 --port 17017 --username myUser --password myPass --authenticationDatabase admin --nsFrom mySourceDbForTest.* --nsTo myTargetDbForTest.*"); | ||
}); | ||
|
||
it("should wrap restore commandConnectFromOptions uri ssl", async function () { | ||
|
@@ -91,7 +99,7 @@ describe("MTWrapper unit tests", function () { | |
const command = wrapper.commandConnectFromOptions(mtOptions, '--beginning', true); | ||
|
||
command.should.be.eql( | ||
"--beginning --uri mongodb://root:[email protected]:17017/myDbForTest?authSource=admin " | ||
`--beginning --uri ${testDbUri} ` | ||
+ "--ssl --sslCAFile /tmp/myCAFile --sslPEMKeyFile /tmp/pem/sslPEMKeyFile --sslPEMKeyPassword strongPassHere " | ||
+ "--sslCRLFile /tmp/pem/sslCRLFile --sslFIPSMode --tlsInsecure"); | ||
}); | ||
|
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