Radius integration test with data converters and *cgrReply

This commit is contained in:
DanB
2018-04-17 19:38:43 +02:00
parent eabacead26
commit b11da1dc23
3 changed files with 3 additions and 4 deletions

View File

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

View File

@@ -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",

View File

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