Merge pull request #794 from TeoV/master

Update Filters.csv and checkConfigSanity
This commit is contained in:
Dan Christian Bogos
2017-10-27 19:50:04 +02:00
committed by GitHub
11 changed files with 24 additions and 10 deletions

View File

@@ -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)
}

View File

@@ -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())

View File

@@ -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
}

View File

@@ -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/")},

View File

@@ -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 #Tenant[0] ID[1] FilterType[2] FilterFieldName[3] FilterFieldValues[4] ActivationInterval[5]
25 cgrates.org FLTR_DST_FS *destinations Destination DST_FS 2014-07-29T15:00:00Z
26 cgrates.org FLTR_RES_GR3 *string Account 3001 2014-07-29T15:00:00Z
27 cgrates.org FLTR_CDRS *cdr_stats CDRST1:*min_ASR:34;CDRST_1001:*min_ASR:20 2014-07-29T15:00:00Z
28 cgrates.org FLTR_STS1 *string Account 1001;1002 2014-07-29T15:00:00Z

View File

@@ -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
1 #Tenant[0] Id[1] FilterIDs[2] ActivationInterval[3] QueueLength[4] TTL[5] Metrics[6] Blocker[7] Stored[8] Weight[9] MinItems[10] Thresholds[11]
2 cgrates.org Stats1 FLTR_1 FLTR_STS1 2014-07-29T15:00:00Z 100 1s *asr;*acc;*tcc;*acd;*tcd;*pdd true true 20 2 THRESH1;THRESH2

View File

@@ -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 #Tenant[0] ID[1] FilterType[2] FilterFieldName[3] FilterFieldValues[4] ActivationInterval[5]
25 cgrates.org FLTR_DST_FS *destinations Destination DST_FS 2014-07-29T15:00:00Z
26 cgrates.org FLTR_RES_GR3 *string Account 3001 2014-07-29T15:00:00Z
27 cgrates.org FLTR_CDRS *cdr_stats CDRST1:*min_ASR:34;CDRST_1001:*min_ASR:20 2014-07-29T15:00:00Z
28 cgrates.org FLTR_STS1 *string Account 1001;1002 2014-07-29T15:00:00Z
29 cgrates.org FLTR_CDR_UPDATE *string EventType CDR 2014-07-29T15:00:00Z

View File

@@ -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 #Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],TTL[4],Limit[5],AllocationMessage[6],Blocker[7],Stored[8],Weight[9],Thresholds[10] #Tenant[0] Id[1] FilterIDs[2] ActivationInterval[3] TTL[4] Limit[5] AllocationMessage[6] Blocker[7] Stored[8] Weight[9] Thresholds[10]
2 cgrates.org,ResGroup1,FLTR_1,2014-07-29T15:00:00Z,1s,7,,false,false,20, cgrates.org ResGroup1 FLTR_1 2014-07-29T15:00:00Z 1s 7 false false 20
3 cgrates.org,ResGroup2,FLTR_DST_FS,2014-07-29T15:00:00Z,3600s,8,SPECIAL_1002,false,true,10, cgrates.org ResGroup2 FLTR_DST_FS 2014-07-29T15:00:00Z 3600s 8 SPECIAL_1002 false true 10
4 cgrates.org,ResGroup3,FLTR_CDRS,2014-07-29T15:00:00Z,0s,1,,true,false,20, cgrates.org ResGroup3 FLTR_RES_GR3 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,,,,,,,,

View File

@@ -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
1 #Tenant[0] Id[1] FilterIDs[2] ActivationInterval[3] QueueLength[4] TTL[5] Metrics[6] Blocker[7] Stored[8] Weight[9] MinItems[10] Thresholds[11]
2 cgrates.org Stats1 FLTR_1 FLTR_STS1 2014-07-29T15:00:00Z 100 1s *asr;*acc;*tcc;*acd;*tcd;*pdd true true 20 2 THRESH1;THRESH2

View File

@@ -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())

View File

@@ -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())