Rebrand pkg
This commit is contained in:
+11
-11
@@ -24,12 +24,12 @@ var _ = Describe("Crypto", func() {
|
||||
if err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
config.Proxy.HTTP.TLSKey = filepath.Join(userConfigDir, "ocis", "server.key")
|
||||
config.Proxy.HTTP.TLSCert = filepath.Join(userConfigDir, "ocis", "server.cert")
|
||||
config.Proxy.HTTP.TLSKey = filepath.Join(userConfigDir, "opencloud", "server.key")
|
||||
config.Proxy.HTTP.TLSCert = filepath.Join(userConfigDir, "opencloud", "server.cert")
|
||||
})
|
||||
|
||||
AfterEach(func() {
|
||||
if err := os.RemoveAll(filepath.Join(userConfigDir, "ocis")); err != nil {
|
||||
if err := os.RemoveAll(filepath.Join(userConfigDir, "opencloud")); err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
})
|
||||
@@ -38,17 +38,17 @@ var _ = Describe("Crypto", func() {
|
||||
// for the key / certificate pair in case none is configured. Regardless of how the values ended in the configuration,
|
||||
// the side effects of GenCert is what we want to test.
|
||||
Describe("Creating key / certificate pair", func() {
|
||||
Context("For ocis-proxy in the location of the user config directory", func() {
|
||||
It(fmt.Sprintf("Creates the cert / key tuple in: %s", filepath.Join(userConfigDir, "ocis")), func() {
|
||||
Context("For the proxy service in the location of the user config directory", func() {
|
||||
It(fmt.Sprintf("Creates the cert / key tuple in: %s", filepath.Join(userConfigDir, "opencloud")), func() {
|
||||
if err := crypto.GenCert(config.Proxy.HTTP.TLSCert, config.Proxy.HTTP.TLSKey, log.NopLogger()); err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
|
||||
if _, err := os.Stat(filepath.Join(userConfigDir, "ocis", "server.key")); err != nil {
|
||||
if _, err := os.Stat(filepath.Join(userConfigDir, "opencloud", "server.key")); err != nil {
|
||||
Fail("key not found at the expected location")
|
||||
}
|
||||
|
||||
if _, err := os.Stat(filepath.Join(userConfigDir, "ocis", "server.cert")); err != nil {
|
||||
if _, err := os.Stat(filepath.Join(userConfigDir, "opencloud", "server.cert")); err != nil {
|
||||
Fail("certificate not found at the expected location")
|
||||
}
|
||||
})
|
||||
@@ -62,10 +62,10 @@ var _ = Describe("Crypto", func() {
|
||||
keyTwo string
|
||||
)
|
||||
BeforeEach(func() {
|
||||
crtOne = filepath.Join(userConfigDir, "ocis/one.cert")
|
||||
keyOne = filepath.Join(userConfigDir, "ocis/one.key")
|
||||
crtTwo = filepath.Join(userConfigDir, "ocis/two.cert")
|
||||
keyTwo = filepath.Join(userConfigDir, "ocis/two.key")
|
||||
crtOne = filepath.Join(userConfigDir, "opencloud/one.cert")
|
||||
keyOne = filepath.Join(userConfigDir, "opencloud/one.key")
|
||||
crtTwo = filepath.Join(userConfigDir, "opencloud/two.cert")
|
||||
keyTwo = filepath.Join(userConfigDir, "opencloud/two.key")
|
||||
if err := crypto.GenCert(crtOne, keyOne, log.NopLogger()); err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user