No more Path Field in ArgsReload struct

This commit is contained in:
porosnicuadrian
2021-06-10 17:48:11 +03:00
committed by Dan Christian Bogos
parent fce4cfff3e
commit 7d57296860
27 changed files with 31 additions and 32 deletions

View File

@@ -68,8 +68,8 @@ func TestAccountSReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.AccountSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -68,8 +68,8 @@ func TestActionSReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.ActionSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -65,8 +65,8 @@ func TestAnalyzerSReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "analyzers")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "analyzers"),
Section: config.AnalyzerSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -67,8 +67,8 @@ func TestAsteriskAgentReload(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "tutorial_tests", "asterisk_ari", "cgrates", "etc", "cgrates")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "tutorial_tests", "asterisk_ari", "cgrates", "etc", "cgrates"),
Section: config.AsteriskAgentJSON,
}, &reply); err != nil {
t.Fatal(err)
@@ -129,8 +129,8 @@ func TestAsteriskAgentReload2(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "tutorial_tests", "asterisk_ari", "cgrates", "etc", "cgrates")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "tutorial_tests", "asterisk_ari", "cgrates", "etc", "cgrates"),
Section: config.AsteriskAgentJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -70,8 +70,8 @@ func TestAttributeSReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.AttributeSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -77,8 +77,8 @@ func TestCdrsReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.CDRsJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -70,8 +70,8 @@ func TestChargerSReload(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.ChargerSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -63,8 +63,8 @@ func TestCoreSReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "caps_queue")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "caps_queue"),
Section: config.CoreSJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -65,8 +65,8 @@ func TestDataDBReload(t *testing.T) {
}
var reply string
cfg.AttributeSCfg().Enabled = true
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.DataDBJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -62,8 +62,8 @@ func TestDiameterAgentReload1(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "diamagent_mysql")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "diamagent_mysql"),
Section: config.DiameterAgentJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -72,9 +72,8 @@ func TestDispatcherSReload(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "dispatchers", "dispatchers_mysql")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "dispatchers", "dispatchers_mysql"),
Section: config.DispatcherSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -69,8 +69,8 @@ func TestDNSAgentReload(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "dnsagent_reload")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "dnsagent_reload"),
Section: config.DNSAgentJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -85,8 +85,8 @@ func TestEventExporterSReload(t *testing.T) {
fcTmp.ComputePath()
cfg.TemplatesCfg()["requiredFields"] = []*config.FCTemplate{fcTmp}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "ees")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "ees"),
Section: config.EEsJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -77,8 +77,8 @@ func TestEventReaderSReload(t *testing.T) {
t.Fatal("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "ers_reload", "internal")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "ers_reload", "internal"),
Section: config.ERsJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -69,8 +69,8 @@ func TestFreeSwitchAgentReload(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "tutorial_tests", "fs_evsock", "cgrates", "etc", "cgrates")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "tutorial_tests", "fs_evsock", "cgrates", "etc", "cgrates"),
Section: config.FreeSWITCHAgentJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -67,8 +67,8 @@ func TestHTTPAgentReload(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "httpagent_mysql_test")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "httpagent_mysql_test"),
Section: config.HTTPAgentJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -68,8 +68,8 @@ func TestKamailioAgentReload(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "tutorial_tests", "kamevapi", "cgrates", "etc", "cgrates")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "tutorial_tests", "kamevapi", "cgrates", "etc", "cgrates"),
Section: config.KamailioAgentJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -91,8 +91,8 @@ func TestLoaderSReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "loaders", "tutinternal")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "loaders", "tutinternal"),
Section: config.LoaderSJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -70,8 +70,8 @@ func TestRadiusAgentReload(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "radagent_mysql")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "radagent_mysql"),
Section: config.RadiusAgentJSON,
}, &reply); err != nil {
t.Fatal(err)
@@ -134,8 +134,8 @@ func TestRadiusAgentReload2(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "radagent_mysql")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "radagent_mysql"),
Section: config.RadiusAgentJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -62,8 +62,8 @@ func TestRateSReload(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "rates")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "rates"),
Section: config.RateSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -69,8 +69,8 @@ func TestDispatcherHReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "registrarc", "all_mongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "registrarc", "all_mongo"),
Section: config.RegistrarCJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -72,8 +72,8 @@ func TestResourceSReload(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.ResourceSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -66,8 +66,8 @@ func TestRouteSReload(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "cluelrn")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "cluelrn"),
Section: config.RouteSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -65,8 +65,8 @@ func TestSIPAgentReload(t *testing.T) {
t.Fatalf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "sipagent_mysql")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "sipagent_mysql"),
Section: config.SIPAgentJSON,
}, &reply); err != nil {
t.Fatal(err)

View File

@@ -72,8 +72,8 @@ func TestStatSReload(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.StatSJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -70,8 +70,8 @@ func TestStorDBReload(t *testing.T) {
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.CDRsJSON,
}, &reply); err != nil {
t.Error(err)
@@ -97,8 +97,8 @@ func TestStorDBReload(t *testing.T) {
}
time.Sleep(10 * time.Millisecond)
cfg.StorDbCfg().Password = ""
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.StorDBJSON,
}, &reply); err != nil {
t.Error(err)

View File

@@ -68,8 +68,8 @@ func TestThresholdSReload(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.ThresholdSJSON,
}, &reply); err != nil {
t.Error(err)
@@ -136,8 +136,8 @@ func TestThresholdSReload2(t *testing.T) {
t.Errorf("Expected service to be down")
}
var reply string
cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo")
if err := cfg.V1ReloadConfig(context.Background(), &config.ReloadArgs{
Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "tutmongo"),
Section: config.ThresholdSJSON,
}, &reply); err != nil {
t.Error(err)