2020-09-28 19:18:49 +00:00
|
|
|
package main
|
2020-09-30 11:08:44 +00:00
|
|
|
|
|
|
|
import (
|
2020-09-30 13:07:36 +00:00
|
|
|
"testing"
|
|
|
|
|
2020-09-30 11:08:44 +00:00
|
|
|
"github.com/spf13/viper"
|
|
|
|
"gitlab.crans.org/nounous/ghostream/auth"
|
|
|
|
"gitlab.crans.org/nounous/ghostream/internal/monitoring"
|
2020-09-30 13:07:36 +00:00
|
|
|
"gitlab.crans.org/nounous/ghostream/stream/forwarding"
|
2020-09-30 11:08:44 +00:00
|
|
|
"gitlab.crans.org/nounous/ghostream/stream/srt"
|
|
|
|
"gitlab.crans.org/nounous/ghostream/stream/webrtc"
|
|
|
|
"gitlab.crans.org/nounous/ghostream/web"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TestLoadConfiguration tests the configuration file loading and the init of some parameters
|
|
|
|
func TestLoadConfiguration(t *testing.T) {
|
|
|
|
loadConfiguration()
|
|
|
|
cfg := struct {
|
|
|
|
Auth auth.Options
|
2020-09-30 13:07:36 +00:00
|
|
|
Forwarding forwarding.Options
|
2020-09-30 11:08:44 +00:00
|
|
|
Monitoring monitoring.Options
|
|
|
|
Srt srt.Options
|
|
|
|
Web web.Options
|
|
|
|
WebRTC webrtc.Options
|
|
|
|
}{}
|
|
|
|
if err := viper.Unmarshal(&cfg); err != nil {
|
|
|
|
t.Fatal("Failed to load settings", err)
|
|
|
|
}
|
|
|
|
}
|