Update integration test after last commit

This commit is contained in:
TeoV
2018-03-12 08:44:10 -04:00
committed by Dan Christian Bogos
parent 8945854adb
commit 6204d66dcd
4 changed files with 36 additions and 44 deletions

View File

@@ -283,9 +283,6 @@ func (kev KamEvent) AsKamAuthReply(authArgs *sessions.V1AuthorizeArgs,
if authArgs.ProcessThresholds != nil && *authArgs.ProcessThresholds {
kar.ThresholdHits = *authReply.ThresholdHits
}
if authArgs.ProcessStatQueues != nil && *authArgs.ProcessStatQueues {
kar.StatReply = *authReply.StatReply
}
return
}
@@ -411,7 +408,6 @@ type KamAuthReply struct {
MaxUsage int // Maximum session time in case of success, -1 for unlimited
Suppliers string // List of suppliers, comma separated
ThresholdHits int
StatReply string
Error string // Reply in case of error
}

View File

@@ -1725,24 +1725,27 @@ func testV1FIdxGetFilterIndexes1(t *testing.T) {
ItemType: "*resources",
}
expectedIndexes := []string{
"*string:Account:1003:ResProfile3",
"*string:Account:3001:ResProfile3",
"*prefix:Destination:200:ResProfile3",
"*string:Destination:1001:ResProfile1",
"*string:Destination:1001:ResProfile2",
"*string:Destination:1001:ResProfile3",
"*string:Account:1002:ResProfile1",
"*string:Account:1002:ResProfile2",
"*string:Account:1002:ResProfile3",
"*string:Account:1003:ResProfile3",
"*prefix:Destination:20:ResProfile1",
"*prefix:Destination:20:ResProfile2",
"*string:Account:1001:ResProfile1",
"*string:Account:1001:ResProfile2",
"*string:Destination:2001:ResProfile3",
"*string:Account:2002:ResProfile2",
"*prefix:Destination:1001:ResProfile3",
"*prefix:Destination:200:ResProfile3",
"*string:Destination:2001:ResProfile1",
"*string:Destination:2001:ResProfile2",
"*prefix:Destination:1001:ResProfile3",
"*string:Account:2002:ResProfile2",
"*prefix:Account:10:ResProfile3",
"*prefix:Destination:20:ResProfile2"}
"*string:Destination:2001:ResProfile3",
"*prefix:Account:10:ResProfile1",
"*prefix:Account:10:ResProfile2",
"*prefix:Account:10:ResProfile3"}
reply := []string{}
if err := tFIdxRpc.Call("ApierV1.GetFilterIndexes", arg, &reply); err != nil {
t.Error(err)
@@ -1787,10 +1790,13 @@ func testV1FIdxGetFilterIndexes3(t *testing.T) {
FilterType: "*prefix",
}
expectedIndexes := []string{
"*prefix:Destination:200:ResProfile3",
"*prefix:Destination:1001:ResProfile3",
"*prefix:Destination:20:ResProfile1",
"*prefix:Destination:20:ResProfile2",
"*prefix:Account:10:ResProfile1",
"*prefix:Account:10:ResProfile2",
"*prefix:Account:10:ResProfile3",
"*prefix:Destination:20:ResProfile2"}
"*prefix:Destination:200:ResProfile3",
"*prefix:Destination:1001:ResProfile3"}
reply := []string{}
if err := tFIdxRpc.Call("ApierV1.GetFilterIndexes", arg, &reply); err != nil {
t.Error(err)

View File

@@ -468,12 +468,12 @@ func (dm *DataManager) SetThresholdProfile(th *ThresholdProfile, withIndex bool)
for _, flt := range fltr.Rules {
var fldType, fldName string
var fldVals []string
if !utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
} else {
if utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = flt.Type, flt.FieldName
fldVals = flt.Values
} else {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
}
for _, fldVal := range fldVals {
if err = indexer.loadFldNameFldValIndex(fldType,
@@ -586,12 +586,12 @@ func (dm *DataManager) SetStatQueueProfile(sqp *StatQueueProfile, withIndex bool
for _, flt := range fltr.Rules {
var fldType, fldName string
var fldVals []string
if !utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
} else {
if utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = flt.Type, flt.FieldName
fldVals = flt.Values
} else {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
}
for _, fldVal := range fldVals {
if err = indexer.loadFldNameFldValIndex(fldType,
@@ -788,12 +788,12 @@ func (dm *DataManager) SetResourceProfile(rp *ResourceProfile, withIndex bool) (
for _, flt := range fltr.Rules {
var fldType, fldName string
var fldVals []string
if !utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
} else {
if utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = flt.Type, flt.FieldName
fldVals = flt.Values
} else {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
}
for _, fldVal := range fldVals {
if err = indexer.loadFldNameFldValIndex(fldType,
@@ -1287,12 +1287,12 @@ func (dm *DataManager) SetSupplierProfile(supp *SupplierProfile, withIndex bool)
for _, flt := range fltr.Rules {
var fldType, fldName string
var fldVals []string
if !utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
} else {
if utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = flt.Type, flt.FieldName
fldVals = flt.Values
} else {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
}
for _, fldVal := range fldVals {
if err = indexer.loadFldNameFldValIndex(fldType,
@@ -1433,12 +1433,12 @@ func (dm *DataManager) SetAttributeProfile(ap *AttributeProfile, withIndex bool)
for _, flt := range fltr.Rules {
var fldType, fldName string
var fldVals []string
if !utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
} else {
if utils.IsSliceMember([]string{MetaString, MetaPrefix}, flt.Type) {
fldType, fldName = flt.Type, flt.FieldName
fldVals = flt.Values
} else {
fldType, fldName = utils.MetaDefault, utils.META_ANY
fldVals = []string{utils.META_ANY}
}
for _, fldVal := range fldVals {
if err = indexer.loadFldNameFldValIndex(fldType,

View File

@@ -1312,7 +1312,6 @@ type V1AuthorizeReply struct {
MaxUsage *time.Duration
Suppliers *engine.SortedSuppliers
ThresholdHits *int
StatReply *string
}
// AsCGRReply is part of utils.CGRReplier interface
@@ -1339,9 +1338,6 @@ func (v1AuthReply *V1AuthorizeReply) AsCGRReply() (cgrReply utils.CGRReply, err
if v1AuthReply.ThresholdHits != nil {
cgrReply["ThresholdHits"] = *v1AuthReply.ThresholdHits
}
if v1AuthReply.StatReply != nil {
cgrReply["StatReply"] = *v1AuthReply.StatReply
}
return
}
@@ -1450,7 +1446,6 @@ func (smg *SMGeneric) BiRPCv1AuthorizeEvent(clnt rpcclient.RpcClientConnection,
utils.Logger.Warning(
fmt.Sprintf("<SessionS> error: %s processing event %+v with StatS.", err.Error(), args.CGREvent))
}
authReply.StatReply = &statReply
}
return nil
}
@@ -1503,7 +1498,6 @@ type V1InitSessionReply struct {
ResourceAllocation *string
MaxUsage *time.Duration
ThresholdHits *int
StatReply *string
}
// AsCGRReply is part of utils.CGRReplier interface
@@ -1527,9 +1521,6 @@ func (v1Rply *V1InitSessionReply) AsCGRReply() (cgrReply utils.CGRReply, err err
if v1Rply.ThresholdHits != nil {
cgrReply["ThresholdHits"] = *v1Rply.ThresholdHits
}
if v1Rply.StatReply != nil {
cgrReply["StatReply"] = *v1Rply.StatReply
}
return
}
@@ -1618,7 +1609,6 @@ func (smg *SMGeneric) BiRPCv1InitiateSession(clnt rpcclient.RpcClientConnection,
utils.Logger.Warning(
fmt.Sprintf("<SessionS> error: %s processing event %+v with StatS.", err.Error(), args.CGREvent))
}
rply.StatReply = &statReply
}
return
}