-
Notifications
You must be signed in to change notification settings - Fork 0
/
export_test.go
47 lines (38 loc) · 1.28 KB
/
export_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package mongo
import (
"github.com/juju/juju/service/common"
svctesting "github.com/juju/juju/service/common/testing"
)
var (
MakeJournalDirs = makeJournalDirs
MongoConfigPath = &mongoConfigPath
SharedSecretPath = sharedSecretPath
SSLKeyPath = sslKeyPath
NewConf = newConf
HostWordSize = &hostWordSize
RuntimeGOOS = &runtimeGOOS
AvailSpace = &availSpace
SmallOplogSizeMB = &smallOplogSizeMB
PreallocFile = &preallocFile
DefaultOplogSize = defaultOplogSize
FsAvailSpace = fsAvailSpace
PreallocFileSizes = preallocFileSizes
PreallocFiles = preallocFiles
)
func PatchService(patchValue func(interface{}, interface{}), data *svctesting.FakeServiceData) {
patchValue(&discoverService, func(name string) (mongoService, error) {
svc := svctesting.NewFakeService(name, common.Conf{})
svc.FakeServiceData = data
return svc, nil
})
patchValue(&newService, func(name string, conf common.Conf) (mongoService, error) {
svc := svctesting.NewFakeService(name, conf)
svc.FakeServiceData = data
return svc, nil
})
}
func SysctlEditableEnsureServer(args EnsureServerParams, sysctlFiles map[string]string) error {
return ensureServer(args, sysctlFiles)
}