@@ -41,32 +41,26 @@ assert.eq(0, c.count(), "dumprestore_ssl.foo collection is not initially empty")
4141c . save ( { a : 22 } ) ;
4242assert . eq ( 1 , c . count ( ) , "failed to insert document into dumprestore_ssl.foo collection" ) ;
4343
44- exit_code = runMongoProgram ( "mongodump" ,
45- "--out" ,
46- external_scratch_dir ,
47- "--port" ,
48- md . port ,
49- "--ssl" ,
50- "--sslPEMKeyFile" ,
51- "jstests/libs/password_protected.pem" ,
52- "--sslPEMKeyPassword" ,
53- "qwerty" ) ;
44+ exit_code = MongoRunner . runMongoTool ( "mongodump" , {
45+ out : external_scratch_dir ,
46+ port : md . port ,
47+ ssl : "" ,
48+ sslPEMKeyFile : "jstests/libs/password_protected.pem" ,
49+ sslPEMKeyPassword : "qwerty" ,
50+ } ) ;
5451
5552assert . eq ( exit_code , 0 , "Failed to start mongodump with ssl" ) ;
5653
5754c . drop ( ) ;
5855assert . eq ( 0 , c . count ( ) , "dumprestore_ssl.foo collection is not empty after drop" ) ;
5956
60- exit_code = runMongoProgram ( "mongorestore" ,
61- "--dir" ,
62- external_scratch_dir ,
63- "--port" ,
64- md . port ,
65- "--ssl" ,
66- "--sslPEMKeyFile" ,
67- "jstests/libs/password_protected.pem" ,
68- "--sslPEMKeyPassword" ,
69- "qwerty" ) ;
57+ exit_code = MongoRunner . runMongoTool ( "mongorestore" , {
58+ dir : external_scratch_dir ,
59+ port : md . port ,
60+ ssl : "" ,
61+ sslPEMKeyFile : "jstests/libs/password_protected.pem" ,
62+ sslPEMKeyPassword : "qwerty" ,
63+ } ) ;
7064
7165assert . eq ( exit_code , 0 , "Failed to start mongorestore with ssl" ) ;
7266
@@ -85,40 +79,30 @@ assert.eq(1, c.count(), "failed to insert document into exportimport_ssl.foo col
8579
8680var exportimport_file = "data.json" ;
8781
88- exit_code = runMongoProgram ( "mongoexport" ,
89- "--out" ,
90- external_scratch_dir + exportimport_file ,
91- "-d" ,
92- exportimport_ssl_dbname ,
93- "-c" ,
94- "foo" ,
95- "--port" ,
96- md . port ,
97- "--ssl" ,
98- "--sslPEMKeyFile" ,
99- "jstests/libs/password_protected.pem" ,
100- "--sslPEMKeyPassword" ,
101- "qwerty" ) ;
82+ exit_code = MongoRunner . runMongoTool ( "mongoexport" , {
83+ out : external_scratch_dir + exportimport_file ,
84+ db : exportimport_ssl_dbname ,
85+ collection : "foo" ,
86+ port : md . port ,
87+ ssl : "" ,
88+ sslPEMKeyFile : "jstests/libs/password_protected.pem" ,
89+ sslPEMKeyPassword : "qwerty" ,
90+ } ) ;
10291
10392assert . eq ( exit_code , 0 , "Failed to start mongoexport with ssl" ) ;
10493
10594c . drop ( ) ;
10695assert . eq ( 0 , c . count ( ) , "afterdrop" , "-d" , exportimport_ssl_dbname , "-c" , "foo" ) ;
10796
108- exit_code = runMongoProgram ( "mongoimport" ,
109- "--file" ,
110- external_scratch_dir + exportimport_file ,
111- "-d" ,
112- exportimport_ssl_dbname ,
113- "-c" ,
114- "foo" ,
115- "--port" ,
116- md . port ,
117- "--ssl" ,
118- "--sslPEMKeyFile" ,
119- "jstests/libs/password_protected.pem" ,
120- "--sslPEMKeyPassword" ,
121- "qwerty" ) ;
97+ exit_code = MongoRunner . runMongoTool ( "mongoimport" , {
98+ file : external_scratch_dir + exportimport_file ,
99+ db : exportimport_ssl_dbname ,
100+ collection : "foo" ,
101+ port : md . port ,
102+ ssl : "" ,
103+ sslPEMKeyFile : "jstests/libs/password_protected.pem" ,
104+ sslPEMKeyPassword : "qwerty" ,
105+ } ) ;
122106
123107assert . eq ( exit_code , 0 , "Failed to start mongoimport with ssl" ) ;
124108
@@ -135,18 +119,16 @@ mongofiles_db = md.getDB(mongofiles_ssl_dbname);
135119source_filename = 'jstests/ssl/ssl_cert_password.js' ;
136120filename = 'ssl_cert_password.js' ;
137121
138- exit_code = runMongoProgram ( "mongofiles" ,
139- "-d" ,
140- mongofiles_ssl_dbname ,
141- "put" ,
142- source_filename ,
143- "--port" ,
144- md . port ,
145- "--ssl" ,
146- "--sslPEMKeyFile" ,
147- "jstests/libs/password_protected.pem" ,
148- "--sslPEMKeyPassword" ,
149- "qwerty" ) ;
122+ exit_code = MongoRunner . runMongoTool ( "mongofiles" ,
123+ {
124+ db : mongofiles_ssl_dbname ,
125+ port : md . port ,
126+ ssl : "" ,
127+ sslPEMKeyFile : "jstests/libs/password_protected.pem" ,
128+ sslPEMKeyPassword : "qwerty" ,
129+ } ,
130+ "put" ,
131+ source_filename ) ;
150132
151133assert . eq ( exit_code , 0 , "Failed to start mongofiles with ssl" ) ;
152134
@@ -159,20 +141,17 @@ md5_computed = mongofiles_db.runCommand({filemd5: file_obj._id}).md5;
159141assert . eq ( md5 , md5_stored , "md5 incorrect for file" ) ;
160142assert . eq ( md5 , md5_computed , "md5 computed incorrectly by server" ) ;
161143
162- exit_code = runMongoProgram ( "mongofiles" ,
163- "-d" ,
164- mongofiles_ssl_dbname ,
165- "get" ,
166- source_filename ,
167- "-l" ,
168- external_scratch_dir + filename ,
169- "--port" ,
170- md . port ,
171- "--ssl" ,
172- "--sslPEMKeyFile" ,
173- "jstests/libs/password_protected.pem" ,
174- "--sslPEMKeyPassword" ,
175- "qwerty" ) ;
144+ exit_code = MongoRunner . runMongoTool ( "mongofiles" ,
145+ {
146+ db : mongofiles_ssl_dbname ,
147+ local : external_scratch_dir + filename ,
148+ port : md . port ,
149+ ssl : "" ,
150+ sslPEMKeyFile : "jstests/libs/password_protected.pem" ,
151+ sslPEMKeyPassword : "qwerty" ,
152+ } ,
153+ "get" ,
154+ source_filename ) ;
176155
177156assert . eq ( exit_code , 0 , "Failed to start mongofiles with ssl" ) ;
178157
0 commit comments