@@ -55,6 +55,9 @@ func Test_newReplicaSetProcessConfig(t *testing.T) {
5555 Destination : "file" ,
5656 Path : "/data/log/mongodb.log" ,
5757 },
58+ SetParameter : & map [string ]interface {}{
59+ "param" : "param" ,
60+ },
5861 },
5962 AuthSchemaVersion : 5 ,
6063 Disabled : false ,
@@ -103,6 +106,9 @@ func Test_newReplicaSetProcessConfig(t *testing.T) {
103106 Disabled : false ,
104107 Hidden : pointy .Bool (false ),
105108 TLS : & TLS {Mode : "disabled" },
109+ SetParameter : & map [string ]interface {}{
110+ "param" : "param" ,
111+ },
106112 WiredTiger : & map [string ]interface {}{
107113 "collectionConfig" : map [string ]interface {}{},
108114 "engineConfig" : map [string ]interface {}{
@@ -147,6 +153,9 @@ func Test_newConfigRSProcess(t *testing.T) {
147153 },
148154 "indexConfig" : map [string ]interface {}{},
149155 },
156+ SetParameter : & map [string ]interface {}{
157+ "param" : "param" ,
158+ },
150159 }
151160
152161 want := & opsmngr.Process {
@@ -180,6 +189,9 @@ func Test_newConfigRSProcess(t *testing.T) {
180189 Path : "/data/log/mongodb.log" ,
181190 },
182191 Sharding : & opsmngr.Sharding {ClusterRole : "configsvr" },
192+ SetParameter : & map [string ]interface {}{
193+ "param" : "param" ,
194+ },
183195 },
184196 AuthSchemaVersion : 5 ,
185197 Disabled : false ,
@@ -229,6 +241,9 @@ func Test_newReplicaSetProcess(t *testing.T) {
229241 },
230242 "indexConfig" : map [string ]interface {}{},
231243 },
244+ SetParameter : & map [string ]interface {}{
245+ "param" : "param" ,
246+ },
232247 }
233248
234249 want := & opsmngr.Process {
@@ -261,6 +276,9 @@ func Test_newReplicaSetProcess(t *testing.T) {
261276 Destination : "file" ,
262277 Path : "/data/log/mongodb.log" ,
263278 },
279+ SetParameter : & map [string ]interface {}{
280+ "param" : "param" ,
281+ },
264282 },
265283 AuthSchemaVersion : 5 ,
266284 Disabled : false ,
@@ -278,3 +296,60 @@ func Test_newReplicaSetProcess(t *testing.T) {
278296 got := newReplicaSetProcess (p , "myReplicaSet" )
279297 assert .Equal (t , got , want )
280298}
299+
300+ func Test_newMongosProcessConfig (t * testing.T ) {
301+ p := & opsmngr.Process {
302+ Args26 : opsmngr.Args26 {
303+ NET : opsmngr.Net {
304+ Port : 27017 ,
305+ },
306+ SystemLog : opsmngr.SystemLog {
307+ Destination : "file" ,
308+ Path : "/data/mongos/mongodb.log" ,
309+ },
310+ SetParameter : & map [string ]interface {}{
311+ "param" : "param" ,
312+ },
313+ AuditLog : & opsmngr.AuditLog {
314+ Path : "/data/mongos/audit.log" ,
315+ Destination : "file" ,
316+ Format : "JSON" ,
317+ Filter : "{ atype: { $in: [ \" createCollection\" , \" dropCollection\" ] } }" ,
318+ },
319+ },
320+ AuthSchemaVersion : 5 ,
321+ Cluster : "myCluster" ,
322+ Disabled : false ,
323+ FeatureCompatibilityVersion : "3.6" ,
324+ Hostname : "n1.omansible.int" ,
325+ LogRotate : & opsmngr.LogRotate {
326+ SizeThresholdMB : 1000 ,
327+ TimeThresholdHrs : 24 ,
328+ },
329+ ManualMode : false ,
330+ Name : "myCluster_mongos_4" ,
331+ ProcessType : "mongos" ,
332+ Version : "3.6.21-ent" ,
333+ }
334+
335+ want := & ProcessConfig {
336+ AuditLogPath : "/data/mongos/audit.log" ,
337+ AuditLogDestination : "file" ,
338+ AuditLogFormat : "JSON" ,
339+ AuditLogFilter : "{ atype: { $in: [ \" createCollection\" , \" dropCollection\" ] } }" ,
340+ FCVersion : "3.6" ,
341+ Hostname : "n1.omansible.int" ,
342+ LogDestination : "file" ,
343+ LogPath : "/data/mongos/mongodb.log" ,
344+ Name : "myCluster_mongos_4" ,
345+ Port : 27017 ,
346+ ProcessType : "mongos" ,
347+ Version : "3.6.21-ent" ,
348+ Disabled : false ,
349+ SetParameter : & map [string ]interface {}{
350+ "param" : "param" ,
351+ },
352+ }
353+ got := newMongosProcessConfig (p )
354+ assert .Equal (t , got , want )
355+ }
0 commit comments