diff --git a/apier/v1/smgenericv1_it_test.go b/apier/v1/smgenericv1_it_test.go index 6aac5ecb4..28343a374 100644 --- a/apier/v1/smgenericv1_it_test.go +++ b/apier/v1/smgenericv1_it_test.go @@ -103,7 +103,7 @@ func TestSMGV1CacheStats(t *testing.T) { expectedStats := &utils.CacheStats{Destinations: 5, ReverseDestinations: 7, RatingPlans: 4, RatingProfiles: 9, Actions: 9, ActionPlans: 4, AccountActionPlans: 5, SharedGroups: 1, DerivedChargers: 1, LcrProfiles: 5, CdrStats: 6, Users: 3, Aliases: 1, ReverseAliases: 2, ResourceProfiles: 3, Resources: 3, StatQueues: 0, - StatQueueProfiles: 0, Thresholds: 6, ThresholdProfiles: 6, Filters: 13} + StatQueueProfiles: 0, Thresholds: 6, ThresholdProfiles: 6, Filters: 14} var args utils.AttrCacheStats if err := smgV1Rpc.Call("ApierV1.GetCacheStats", args, &rcvStats); err != nil { t.Error("Got error on ApierV1.GetCacheStats: ", err.Error()) diff --git a/config/config.go b/config/config.go index a4000d416..ff6d2c0cf 100755 --- a/config/config.go +++ b/config/config.go @@ -318,6 +318,11 @@ func (self *CGRConfig) checkConfigSanity() error { return errors.New("User service not enabled but requested by RALs component.") } } + for _, connCfg := range self.RALsThresholdSConns { + if connCfg.Address == utils.MetaInternal && !self.UserServerEnabled { + return errors.New("ThresholdS not enabled but requested by RALs component.") + } + } } // CDRServer checks if self.CDRSEnabled { @@ -515,6 +520,15 @@ func (self *CGRConfig) checkConfigSanity() error { } } } + // Stat checks + if self.statsCfg != nil && self.statsCfg.Enabled { + for _, connCfg := range self.statsCfg.ThresholdSConns { + if connCfg.Address == utils.MetaInternal && !self.thresholdSCfg.Enabled { + return errors.New("ThresholdS not enabled but requested by StatS component.") + } + } + } + return nil } diff --git a/config/config_json_test.go b/config/config_json_test.go index 4c8e03c54..1064dd34e 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -785,7 +785,7 @@ func TestNewCgrJsonCfgFromFile(t *testing.T) { if gCfg, err := cgrJsonCfg.GeneralJsonCfg(); err != nil { t.Error(err) } else if !reflect.DeepEqual(eCfg, gCfg) { - t.Errorf("Expecting: %+v, received: ", eCfg, gCfg) + t.Errorf("Expecting: %+v, received: %+v", eCfg, gCfg) } cdrFields := []*CdrFieldJsonCfg{ &CdrFieldJsonCfg{Field_id: utils.StringPointer(utils.TOR), Value: utils.StringPointer("~7:s/^(voice|data|sms|mms|generic)$/*$1/")}, diff --git a/general_tests/tut_smgeneric_it_test.go b/general_tests/tut_smgeneric_it_test.go index a3e881561..bc5f02824 100644 --- a/general_tests/tut_smgeneric_it_test.go +++ b/general_tests/tut_smgeneric_it_test.go @@ -101,7 +101,7 @@ func TestTutSMGCacheStats(t *testing.T) { expectedStats := &utils.CacheStats{Destinations: 5, ReverseDestinations: 7, RatingPlans: 4, RatingProfiles: 9, Actions: 9, ActionPlans: 4, AccountActionPlans: 5, SharedGroups: 1, DerivedChargers: 1, LcrProfiles: 5, CdrStats: 6, Users: 3, Aliases: 1, ReverseAliases: 2, ResourceProfiles: 3, Resources: 3, StatQueues: 0, - StatQueueProfiles: 0, Thresholds: 6, ThresholdProfiles: 6, Filters: 13} + StatQueueProfiles: 0, Thresholds: 6, ThresholdProfiles: 6, Filters: 14} var args utils.AttrCacheStats if err := tutSMGRpc.Call("ApierV2.GetCacheStats", args, &rcvStats); err != nil { t.Error("Got error on ApierV2.GetCacheStats: ", err.Error()) diff --git a/general_tests/tutorial_it_test.go b/general_tests/tutorial_it_test.go index 8b82431ff..f96d5364e 100644 --- a/general_tests/tutorial_it_test.go +++ b/general_tests/tutorial_it_test.go @@ -105,7 +105,7 @@ func TestTutITCacheStats(t *testing.T) { expectedStats := &utils.CacheStats{Destinations: 5, ReverseDestinations: 7, RatingPlans: 4, RatingProfiles: 9, Actions: 9, ActionPlans: 4, AccountActionPlans: 5, SharedGroups: 1, DerivedChargers: 1, LcrProfiles: 5, CdrStats: 6, Users: 3, Aliases: 1, ReverseAliases: 2, ResourceProfiles: 3, Resources: 3, StatQueues: 0, - StatQueueProfiles: 0, Thresholds: 6, ThresholdProfiles: 6, Filters: 13} + StatQueueProfiles: 0, Thresholds: 6, ThresholdProfiles: 6, Filters: 14} var args utils.AttrCacheStats if err := tutLocalRpc.Call("ApierV1.GetCacheStats", args, &rcvStats); err != nil { t.Error("Got error on ApierV1.GetCacheStats: ", err.Error())