Add cgr_max_usage variable to fsagent

This commit is contained in:
arberkatellari
2024-10-10 15:45:01 +02:00
committed by Dan Christian Bogos
parent 2137e141f6
commit 2f05395ec1
4 changed files with 26 additions and 20 deletions

View File

@@ -2123,7 +2123,7 @@ func (sS *SessionS) BiRPCv1AuthorizeEvent(ctx *context.Context,
if !args.GetAttributes && !args.AuthorizeResources &&
!args.GetMaxUsage && !args.GetRoutes {
return utils.NewErrMandatoryIeMissing("subsystems")
return utils.NewErrMandatoryIeMissing(utils.Subsystems)
}
if args.GetAttributes {
rplyAttr, err := sS.processAttributes(args.CGREvent, args.AttributeIDs, false)
@@ -2409,7 +2409,7 @@ func (sS *SessionS) BiRPCv1InitiateSession(ctx *context.Context,
// end of RPC caching
if !args.GetAttributes && !args.AllocateResources && !args.InitSession {
return utils.NewErrMandatoryIeMissing("subsystems")
return utils.NewErrMandatoryIeMissing(utils.Subsystems)
}
originID, _ := args.CGREvent.FieldAsString(utils.OriginID)
if args.GetAttributes {
@@ -2650,7 +2650,7 @@ func (sS *SessionS) BiRPCv1UpdateSession(ctx *context.Context,
// end of RPC caching
if !args.GetAttributes && !args.UpdateSession {
return utils.NewErrMandatoryIeMissing("subsystems")
return utils.NewErrMandatoryIeMissing(utils.Subsystems)
}
if args.GetAttributes {
@@ -2795,7 +2795,7 @@ func (sS *SessionS) BiRPCv1TerminateSession(ctx *context.Context,
}
// end of RPC caching
if !args.TerminateSession && !args.ReleaseResources {
return utils.NewErrMandatoryIeMissing("subsystems")
return utils.NewErrMandatoryIeMissing(utils.Subsystems)
}
ev := engine.MapEvent(args.CGREvent.Event)

View File

@@ -2453,7 +2453,7 @@ func TestBiRPCv1AuthorizeEvent(t *testing.T) {
args.CGREvent = cgrEvent
//RPC caching
sessions.cgrCfg.CacheCfg().Partitions[utils.CacheRPCResponses].Limit = -1
expected = "MANDATORY_IE_MISSING: [subsystems]"
expected = "MANDATORY_IE_MISSING: [Subsystems]"
caches := engine.NewCacheS(cfg, dm, nil)
value := &utils.CachedRPCResponse{
@@ -2900,7 +2900,7 @@ func TestBiRPCv1InitiateSession1(t *testing.T) {
args = NewV1InitSessionArgs(false, []string{},
false, []string{}, false, []string{}, false, false,
cgrEvent, true)
expected = "MANDATORY_IE_MISSING: [subsystems]"
expected = "MANDATORY_IE_MISSING: [Subsystems]"
if err := sessions.BiRPCv1InitiateSession(context.Background(), args, rply); err == nil || err.Error() != expected {
t.Errorf("Expected %+v, received %+v", expected, err)
}
@@ -3211,7 +3211,7 @@ func TestBiRPCv1UpdateSession1(t *testing.T) {
args = NewV1UpdateSessionArgs(false, []string{}, false,
cgrEvent, true)
expected = "MANDATORY_IE_MISSING: [subsystems]"
expected = "MANDATORY_IE_MISSING: [Subsystems]"
if err := sessions.BiRPCv1UpdateSession(context.Background(), args, rply); err == nil || err.Error() != expected {
t.Errorf("Exepected %+v, received %+v", expected, err)
}
@@ -3346,7 +3346,7 @@ func TestBiRPCv1TerminateSession1(t *testing.T) {
cgrEvent.ID = utils.EmptyString
args = NewV1TerminateSessionArgs(false, false, false, nil, false, nil, cgrEvent, true)
expected = "MANDATORY_IE_MISSING: [subsystems]"
expected = "MANDATORY_IE_MISSING: [Subsystems]"
if err := sessions.BiRPCv1TerminateSession(context.Background(), args, &reply); err == nil || err.Error() != expected {
t.Errorf("Exepected %+v, received %+v", expected, err)
}