mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 20:59:53 +05:00
Merge pull request #794 from TeoV/master
Update Filters.csv and checkConfigSanity
This commit is contained in:
@@ -295,7 +295,7 @@ func testV1RsAllocateResource(t *testing.T) {
|
||||
if err := rlsV1Rpc.Call("ResourceSV1.AllocateResource", argsRU, &reply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
eAllocationMsg = "ResGroup2"
|
||||
eAllocationMsg = "SPECIAL_1002"
|
||||
if reply != eAllocationMsg {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eAllocationMsg, reply)
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -319,6 +319,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 {
|
||||
@@ -516,6 +521,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
|
||||
}
|
||||
|
||||
|
||||
@@ -788,7 +788,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/")},
|
||||
|
||||
@@ -25,3 +25,4 @@ cgrates.org,FLTR_RES_1,*gte,Usage,10.0,
|
||||
cgrates.org,FLTR_DST_FS,*destinations,Destination,DST_FS,2014-07-29T15:00:00Z
|
||||
cgrates.org,FLTR_RES_GR3,*string,Account,3001,2014-07-29T15:00:00Z
|
||||
cgrates.org,FLTR_CDRS,*cdr_stats,,CDRST1:*min_ASR:34;CDRST_1001:*min_ASR:20,2014-07-29T15:00:00Z
|
||||
cgrates.org,FLTR_STS1,*string,Account,1001;1002,2014-07-29T15:00:00Z
|
||||
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],QueueLength[4],TTL[5],Metrics[6],Blocker[7],Stored[8],Weight[9],MinItems[10],Thresholds[11]
|
||||
cgrates.org,Stats1,FLTR_1,2014-07-29T15:00:00Z,100,1s,*asr;*acc;*tcc;*acd;*tcd;*pdd,true,true,20,2,THRESH1;THRESH2
|
||||
cgrates.org,Stats1,FLTR_STS1,2014-07-29T15:00:00Z,100,1s,*asr;*acc;*tcc;*acd;*tcd;*pdd,true,true,20,2,THRESH1;THRESH2
|
||||
|
||||
|
@@ -25,4 +25,5 @@ cgrates.org,FLTR_RES_1,*gte,Usage,10.0,
|
||||
cgrates.org,FLTR_DST_FS,*destinations,Destination,DST_FS,2014-07-29T15:00:00Z
|
||||
cgrates.org,FLTR_RES_GR3,*string,Account,3001,2014-07-29T15:00:00Z
|
||||
cgrates.org,FLTR_CDRS,*cdr_stats,,CDRST1:*min_ASR:34;CDRST_1001:*min_ASR:20,2014-07-29T15:00:00Z
|
||||
cgrates.org,FLTR_STS1,*string,Account,1001;1002,2014-07-29T15:00:00Z
|
||||
cgrates.org,FLTR_CDR_UPDATE,*string,EventType,CDR,2014-07-29T15:00:00Z
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],TTL[4],Limit[5],AllocationMessage[6],Blocker[7],Stored[8],Weight[9],Thresholds[10]
|
||||
cgrates.org,ResGroup1,FLTR_1,2014-07-29T15:00:00Z,1s,7,,false,false,20,
|
||||
cgrates.org,ResGroup2,FLTR_DST_FS,2014-07-29T15:00:00Z,3600s,8,SPECIAL_1002,false,true,10,
|
||||
cgrates.org,ResGroup3,FLTR_CDRS,2014-07-29T15:00:00Z,0s,1,,true,false,20,
|
||||
#cgrates.org,ResGroup3,*timings,SetupTime,PEAK,,,,,,,,
|
||||
#cgrates.org,ResGroup3,*stats,,CDRST1:*min_ASR:34;CDRST_1001:*min_ASR:20,,,,,,,,
|
||||
cgrates.org,ResGroup3,FLTR_RES_GR3,2014-07-29T15:00:00Z,0s,1,,true,false,20,
|
||||
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],QueueLength[4],TTL[5],Metrics[6],Blocker[7],Stored[8],Weight[9],MinItems[10],Thresholds[11]
|
||||
cgrates.org,Stats1,FLTR_1,2014-07-29T15:00:00Z,100,1s,*asr;*acc;*tcc;*acd;*tcd;*pdd,true,true,20,2,THRESH1;THRESH2
|
||||
cgrates.org,Stats1,FLTR_STS1,2014-07-29T15:00:00Z,100,1s,*asr;*acc;*tcc;*acd;*tcd;*pdd,true,true,20,2,THRESH1;THRESH2
|
||||
|
||||
|
@@ -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: 7, ThresholdProfiles: 7, Filters: 14}
|
||||
StatQueueProfiles: 0, Thresholds: 7, ThresholdProfiles: 7, Filters: 15}
|
||||
var args utils.AttrCacheStats
|
||||
if err := tutSMGRpc.Call("ApierV2.GetCacheStats", args, &rcvStats); err != nil {
|
||||
t.Error("Got error on ApierV2.GetCacheStats: ", err.Error())
|
||||
|
||||
@@ -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: 7, ThresholdProfiles: 7, Filters: 14}
|
||||
StatQueueProfiles: 0, Thresholds: 7, ThresholdProfiles: 7, Filters: 15}
|
||||
var args utils.AttrCacheStats
|
||||
if err := tutLocalRpc.Call("ApierV1.GetCacheStats", args, &rcvStats); err != nil {
|
||||
t.Error("Got error on ApierV1.GetCacheStats: ", err.Error())
|
||||
|
||||
Reference in New Issue
Block a user