mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 00:28:44 +05:00
Radius integration test with data converters and *cgrReply
This commit is contained in:
@@ -79,7 +79,7 @@ func (pv processorVars) valAsString(fldPath string) (val string, err error) {
|
||||
return "", errors.New("not found")
|
||||
}
|
||||
if fldName == utils.MetaCGRReply {
|
||||
cgrRply := pv[utils.MetaCGRReply].(*utils.CGRReply)
|
||||
cgrRply := pv[utils.MetaCGRReply].(utils.CGRReply)
|
||||
return cgrRply.GetFieldAsString(fldPath, utils.HIERARCHY_SEP)
|
||||
}
|
||||
if valIface, hasIt := pv[fldName]; hasIt {
|
||||
|
||||
@@ -397,7 +397,7 @@ func TestRadReplyAppendAttributes(t *testing.T) {
|
||||
Value: utils.ParseRSRFieldsMustCompile("*cgrReply>MaxUsage{*duration_seconds}", utils.INFIELD_SEP)},
|
||||
}
|
||||
procVars := make(processorVars)
|
||||
procVars[utils.MetaCGRReply] = &utils.CGRReply{
|
||||
procVars[utils.MetaCGRReply] = utils.CGRReply{
|
||||
utils.CapAttributes: map[string]interface{}{
|
||||
"RadReply": "AccessAccept",
|
||||
utils.Account: "1001",
|
||||
|
||||
@@ -118,7 +118,6 @@ func TestRAitAuth(t *testing.T) {
|
||||
if err := authReq.AddAVPWithName("Event-Timestamp", "1497106115", ""); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
reply, err := raAuthClnt.SendRequest(authReq)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
@@ -128,7 +127,7 @@ func TestRAitAuth(t *testing.T) {
|
||||
}
|
||||
if len(reply.AVPs) != 1 { // make sure max duration is received
|
||||
t.Errorf("Received AVPs: %+v", reply.AVPs)
|
||||
} else if !reflect.DeepEqual([]byte("session_max_time#3h0m0s"), reply.AVPs[0].RawValue) {
|
||||
} else if !reflect.DeepEqual([]byte("session_max_time#10800"), reply.AVPs[0].RawValue) {
|
||||
t.Errorf("Received: %s", string(reply.AVPs[0].RawValue))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user