forked from rexray/rexray
/
tests_config.go
68 lines (57 loc) · 1.77 KB
/
tests_config.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package tests
import (
"fmt"
"os"
"path"
apiserver "github.com/codedellemc/rexray/libstorage/api/server"
"github.com/codedellemc/rexray/libstorage/api/types"
)
var (
// v0ID is the expected ID of the volume used in the test operations.
//
// This value is configurable externally via the environment variable
// LSX_TESTS_V0ID.
v0ID = "vfs-000"
// v0Name is the execpted name of the volume used in the test operations.
//
// This value is configurable externally via the environment variable
// LSX_TESTS_V0NAME.
v0Name = "v0"
// v0NextDev is the expected name of the next available devie.
//
// This value is configurable externally via the environment variable
// LSX_TESTS_V0NEXTDEVICE.
v0NextDev = "/dev/xvda"
tlsPath = path.Join(
os.Getenv("GOPATH"),
"/src/github.com/codedellemc/rexray/libstorage/.tls")
suiteServerCrt = path.Join(tlsPath, "libstorage-server.crt")
suiteServerKey = path.Join(tlsPath, "libstorage-server.key")
suiteClientCrt = path.Join(tlsPath, "libstorage-client.crt")
suiteClientKey = path.Join(tlsPath, "libstorage-client.key")
suiteTrustedCerts = path.Join(tlsPath, "libstorage-ca.crt")
suiteKnownHosts = path.Join(tlsPath, "known_hosts")
)
func init() {
if v := os.Getenv("LSX_TESTS_V0ID"); v != "" {
v0ID = v
}
if v := os.Getenv("LSX_TESTS_V0NAME"); v != "" {
v0Name = v
}
if v := os.Getenv("LSX_TESTS_V0NEXTDEVICE"); v != "" {
v0NextDev = v
}
//types.Stdout = GinkgoWriter
apiserver.DisableStartupInfo = true
if !types.Debug {
if v := os.Getenv("LIBSTORAGE_LOGGING_LEVEL"); v == "" {
os.Setenv("LIBSTORAGE_LOGGING_LEVEL", "panic")
}
}
}
func (t *testRunner) initConfigData() {
configFileData := fmt.Sprintf(
configFileFormat, t.proto, t.laddr, t.driverName)
t.configFileData = []byte(configFileData)
}