mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
4ffff1a312
* LDAP: Interpolate env variable expressions in ldap.toml file * Removed comment
23 lines
571 B
Go
23 lines
571 B
Go
package ldap
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestReadingLDAPSettings(t *testing.T) {
|
|
config, err := readConfig("testdata/ldap.toml")
|
|
assert.Nil(t, err, "No error when reading ldap config")
|
|
assert.EqualValues(t, "127.0.0.1", config.Servers[0].Host)
|
|
}
|
|
|
|
func TestReadingLDAPSettingsWithEnvVariable(t *testing.T) {
|
|
os.Setenv("ENV_PASSWORD", "MySecret")
|
|
|
|
config, err := readConfig("testdata/ldap.toml")
|
|
assert.Nil(t, err, "No error when reading ldap config")
|
|
assert.EqualValues(t, "MySecret", config.Servers[0].BindPassword)
|
|
}
|