From 7d57296860a0a06c8b5151292e729e76f3c3ffd2 Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Thu, 10 Jun 2021 17:48:11 +0300 Subject: [PATCH] No more Path Field in ArgsReload struct --- services/accounts_it_test.go | 2 +- services/actions_it_test.go | 2 +- services/analyzers_it_test.go | 2 +- services/asteriskagent_it_test.go | 4 ++-- services/attributes_it_test.go | 2 +- services/cdrs_it_test.go | 2 +- services/chargers_it_test.go | 2 +- services/cores_it_test.go | 2 +- services/datadb_it_test.go | 2 +- services/diameteragent_it_test.go | 2 +- services/dispatchers_it_test.go | 3 +-- services/dnsagent_it_test.go | 2 +- services/ees_it_test.go | 2 +- services/ers_it_test.go | 2 +- services/freeswitchagent_it_test.go | 2 +- services/httpagent_it_test.go | 2 +- services/kamailioagent_it_test.go | 2 +- services/loaders_it_test.go | 2 +- services/radiusagent_it_test.go | 4 ++-- services/rates_it_test.go | 2 +- services/registrarc_it_test.go | 2 +- services/resources_it_test.go | 2 +- services/routes_it_test.go | 2 +- services/sipagent_it_test.go | 2 +- services/stats_it_test.go | 2 +- services/stordb_it_test.go | 4 ++-- services/thresholds_it_test.go | 4 ++-- 27 files changed, 31 insertions(+), 32 deletions(-) diff --git a/services/accounts_it_test.go b/services/accounts_it_test.go index 97480dafa..fe0bc9928 100644 --- a/services/accounts_it_test.go +++ b/services/accounts_it_test.go @@ -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) diff --git a/services/actions_it_test.go b/services/actions_it_test.go index 4d1b86485..40e980e4b 100644 --- a/services/actions_it_test.go +++ b/services/actions_it_test.go @@ -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) diff --git a/services/analyzers_it_test.go b/services/analyzers_it_test.go index d795008de..306c22d39 100644 --- a/services/analyzers_it_test.go +++ b/services/analyzers_it_test.go @@ -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) diff --git a/services/asteriskagent_it_test.go b/services/asteriskagent_it_test.go index 7587a1b47..96b0df3c7 100644 --- a/services/asteriskagent_it_test.go +++ b/services/asteriskagent_it_test.go @@ -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) diff --git a/services/attributes_it_test.go b/services/attributes_it_test.go index bb9b0ed82..e0e95bf20 100644 --- a/services/attributes_it_test.go +++ b/services/attributes_it_test.go @@ -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) diff --git a/services/cdrs_it_test.go b/services/cdrs_it_test.go index 5d3b5cb24..e632246f8 100644 --- a/services/cdrs_it_test.go +++ b/services/cdrs_it_test.go @@ -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) diff --git a/services/chargers_it_test.go b/services/chargers_it_test.go index a2b950fae..ca08ed962 100644 --- a/services/chargers_it_test.go +++ b/services/chargers_it_test.go @@ -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) diff --git a/services/cores_it_test.go b/services/cores_it_test.go index 7dab91576..29344e0cd 100644 --- a/services/cores_it_test.go +++ b/services/cores_it_test.go @@ -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) diff --git a/services/datadb_it_test.go b/services/datadb_it_test.go index 9fb9a22aa..1bc517116 100644 --- a/services/datadb_it_test.go +++ b/services/datadb_it_test.go @@ -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) diff --git a/services/diameteragent_it_test.go b/services/diameteragent_it_test.go index 208b29b6b..b96d8d87e 100644 --- a/services/diameteragent_it_test.go +++ b/services/diameteragent_it_test.go @@ -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) diff --git a/services/dispatchers_it_test.go b/services/dispatchers_it_test.go index c61eaefe2..83d09d3ea 100644 --- a/services/dispatchers_it_test.go +++ b/services/dispatchers_it_test.go @@ -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) diff --git a/services/dnsagent_it_test.go b/services/dnsagent_it_test.go index ba2a171f9..92cafbce9 100644 --- a/services/dnsagent_it_test.go +++ b/services/dnsagent_it_test.go @@ -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) diff --git a/services/ees_it_test.go b/services/ees_it_test.go index aeb962ec6..7b47b51a7 100644 --- a/services/ees_it_test.go +++ b/services/ees_it_test.go @@ -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) diff --git a/services/ers_it_test.go b/services/ers_it_test.go index 438350d65..2787f0991 100644 --- a/services/ers_it_test.go +++ b/services/ers_it_test.go @@ -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) diff --git a/services/freeswitchagent_it_test.go b/services/freeswitchagent_it_test.go index cb0d91e2b..ace8809d6 100644 --- a/services/freeswitchagent_it_test.go +++ b/services/freeswitchagent_it_test.go @@ -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) diff --git a/services/httpagent_it_test.go b/services/httpagent_it_test.go index b17336bb0..27dee0cdd 100644 --- a/services/httpagent_it_test.go +++ b/services/httpagent_it_test.go @@ -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) diff --git a/services/kamailioagent_it_test.go b/services/kamailioagent_it_test.go index 8615516e5..0f0adce25 100644 --- a/services/kamailioagent_it_test.go +++ b/services/kamailioagent_it_test.go @@ -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) diff --git a/services/loaders_it_test.go b/services/loaders_it_test.go index cbb4b7061..a6b26e1dc 100644 --- a/services/loaders_it_test.go +++ b/services/loaders_it_test.go @@ -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) diff --git a/services/radiusagent_it_test.go b/services/radiusagent_it_test.go index 46b933c2a..07fc59a29 100644 --- a/services/radiusagent_it_test.go +++ b/services/radiusagent_it_test.go @@ -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) diff --git a/services/rates_it_test.go b/services/rates_it_test.go index 50780c891..abbceaaa2 100644 --- a/services/rates_it_test.go +++ b/services/rates_it_test.go @@ -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) diff --git a/services/registrarc_it_test.go b/services/registrarc_it_test.go index eb6021b4e..270d37370 100644 --- a/services/registrarc_it_test.go +++ b/services/registrarc_it_test.go @@ -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) diff --git a/services/resources_it_test.go b/services/resources_it_test.go index ebec908ee..b6ed2eebd 100644 --- a/services/resources_it_test.go +++ b/services/resources_it_test.go @@ -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) diff --git a/services/routes_it_test.go b/services/routes_it_test.go index aba16de76..f7044ea98 100644 --- a/services/routes_it_test.go +++ b/services/routes_it_test.go @@ -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) diff --git a/services/sipagent_it_test.go b/services/sipagent_it_test.go index 6b3f92206..a97012661 100644 --- a/services/sipagent_it_test.go +++ b/services/sipagent_it_test.go @@ -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) diff --git a/services/stats_it_test.go b/services/stats_it_test.go index c63f0a737..24652cd92 100644 --- a/services/stats_it_test.go +++ b/services/stats_it_test.go @@ -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) diff --git a/services/stordb_it_test.go b/services/stordb_it_test.go index 3a3f1651d..6e253ba91 100644 --- a/services/stordb_it_test.go +++ b/services/stordb_it_test.go @@ -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) diff --git a/services/thresholds_it_test.go b/services/thresholds_it_test.go index 52ab5cd28..5a5a942e5 100644 --- a/services/thresholds_it_test.go +++ b/services/thresholds_it_test.go @@ -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)