From b11da1dc2311fd3ae21e62edc491652e22e50f10 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 17 Apr 2018 19:38:43 +0200 Subject: [PATCH] Radius integration test with data converters and *cgrReply --- agents/librad.go | 2 +- agents/librad_test.go | 2 +- agents/radagent_it_test.go | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/agents/librad.go b/agents/librad.go index 436afbf10..11f80c933 100644 --- a/agents/librad.go +++ b/agents/librad.go @@ -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 { diff --git a/agents/librad_test.go b/agents/librad_test.go index 2c5096205..f52237494 100644 --- a/agents/librad_test.go +++ b/agents/librad_test.go @@ -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", diff --git a/agents/radagent_it_test.go b/agents/radagent_it_test.go index 3dbb6fcc3..fa1cbf768 100644 --- a/agents/radagent_it_test.go +++ b/agents/radagent_it_test.go @@ -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)) } }