mirror of
https://github.com/pushbits/server.git
synced 2025-06-09 22:22:01 +02:00
Add support for configuration of TLS
This commit is contained in:
parent
833e666c37
commit
61d5e04ecf
8 changed files with 65 additions and 12 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/jinzhu/configor"
|
||||
"github.com/pushbits/server/internal/log"
|
||||
"github.com/pushbits/server/internal/pberrors"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
@ -231,3 +232,18 @@ func cleanUp() {
|
|||
log.L.Warnln("Cannot remove config file: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigurationValidation_ConfigTLSFilesInconsistent(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
c := Configuration{}
|
||||
c.Admin.MatrixID = "000000"
|
||||
c.Matrix.Username = "default-username"
|
||||
c.Matrix.Password = "default-password"
|
||||
c.HTTP.CertFile = "populated"
|
||||
c.HTTP.KeyFile = ""
|
||||
|
||||
is := validateConfiguration(&c)
|
||||
should := pberrors.ErrConfigTLSFilesInconsistent
|
||||
assert.Equal(is, should, "validateConfiguration() should return ConfigTLSFilesInconsistent")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue