mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Updated config APIs and added integration tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
b0208c29f0
commit
ffcb95e2ca
@@ -80,7 +80,7 @@ func TestApiersReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.ApierS,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestAsteriskAgentReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "tutorial_tests", "asterisk_ari", "cgrates", "etc", "cgrates"),
|
||||
Section: config.AsteriskAgentJSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -69,7 +69,7 @@ func TestAttributeSReload(t *testing.T) {
|
||||
}
|
||||
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.ATTRIBUTE_JSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -91,7 +91,7 @@ func TestCdrsReload(t *testing.T) {
|
||||
}
|
||||
cfg.RalsCfg().Enabled = true
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.CDRS_JSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -69,7 +69,7 @@ func TestChargerSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err = cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err = cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.ChargerSCfgJson,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -64,7 +64,7 @@ func TestDataDBReload(t *testing.T) {
|
||||
}
|
||||
var reply string
|
||||
cfg.AttributeSCfg().Enabled = true
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.DATADB_JSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestDiameterAgentReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "diamagent_mysql"),
|
||||
Section: config.DA_JSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -71,7 +71,7 @@ func TestDispatcherSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err = cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err = cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "dispatchers", "dispatchers_mysql"),
|
||||
|
||||
Section: config.DispatcherSJson,
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestDNSAgentReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "dnsagent_reload"),
|
||||
Section: config.DNSAgentJson,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -83,7 +83,7 @@ func TestEventExporterSReload(t *testing.T) {
|
||||
fcTmp.ComputePath()
|
||||
cfg.TemplatesCfg()["requiredFields"] = []*config.FCTemplate{fcTmp}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "ees"),
|
||||
Section: config.EEsJson,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -69,7 +69,7 @@ func TestEventReaderSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "ers_reload", "internal"),
|
||||
Section: config.ERsJson,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestFreeSwitchAgentReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "tutorial_tests", "fs_evsock", "cgrates", "etc", "cgrates"),
|
||||
Section: config.FreeSWITCHAgentJSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestKamailioAgentReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "tutorial_tests", "kamevapi", "cgrates", "etc", "cgrates"),
|
||||
Section: config.KamailioAgentJSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestRadiusAgentReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "radagent_mysql"),
|
||||
Section: config.RA_JSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -86,7 +86,7 @@ func TestRalsReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.RALS_JSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -61,7 +61,7 @@ func TestRateSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "rates"),
|
||||
Section: config.RateSJson,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -71,7 +71,7 @@ func TestResourceSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err = cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err = cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.RESOURCES_JSON,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -69,7 +69,7 @@ func TestSupplierSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongonew"),
|
||||
Section: config.RouteSJson,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -62,7 +62,7 @@ func TestSchedulerSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongonew"),
|
||||
Section: config.SCHEDULER_JSN,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -97,7 +97,7 @@ func TestSessionSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongonew"),
|
||||
Section: config.SessionSJson,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestSIPAgentReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err := cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err := cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "sipagent_mysql"),
|
||||
Section: config.SIPAgentJson,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -71,7 +71,7 @@ func TestStatSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err = cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err = cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.STATS_JSON,
|
||||
}, &reply); err != nil {
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestThresholdSReload(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
var reply string
|
||||
if err = cfg.V1ReloadConfigFromPath(&config.ConfigReloadWithOpts{
|
||||
if err = cfg.V1ReloadConfig(&config.ConfigReloadArgs{
|
||||
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
|
||||
Section: config.THRESHOLDS_JSON,
|
||||
}, &reply); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user