M1/#292: test env overrides for admin bootstrap
This commit is contained in:
@@ -78,3 +78,19 @@ func TestEnvOverrides(t *testing.T) {
|
|||||||
t.Errorf("log.format = %q, want lowercased json", cfg.Log.Format)
|
t.Errorf("log.format = %q, want lowercased json", cfg.Log.Format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAdminBootstrapEnvOverrides(t *testing.T) {
|
||||||
|
t.Setenv("SMARTMUSIC_AUTH_ADMIN_USERNAME", "root")
|
||||||
|
t.Setenv("SMARTMUSIC_AUTH_ADMIN_PASSWORD", "sekret")
|
||||||
|
|
||||||
|
cfg, err := Load("")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Load: %v", err)
|
||||||
|
}
|
||||||
|
if cfg.Auth.AdminBootstrap.Username != "root" {
|
||||||
|
t.Errorf("admin username = %q", cfg.Auth.AdminBootstrap.Username)
|
||||||
|
}
|
||||||
|
if cfg.Auth.AdminBootstrap.Password != "sekret" {
|
||||||
|
t.Errorf("admin password = %q", cfg.Auth.AdminBootstrap.Password)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user