mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fix agents integration tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
23f944e1d9
commit
628ae21a5b
@@ -193,11 +193,20 @@ func testHAitAuth1001(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
eXml := []byte(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
var eXml []byte
|
||||
if t := time.Now(); t.Weekday() != 6 && t.Weekday() != 7 { // Different rating plans for weekend
|
||||
eXml = []byte(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<response>
|
||||
<Allow>1</Allow>
|
||||
<MaxDuration>6042</MaxDuration>
|
||||
</response>`)
|
||||
} else {
|
||||
eXml = []byte(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<response>
|
||||
<Allow>1</Allow>
|
||||
<MaxDuration>10800</MaxDuration>
|
||||
</response>`)
|
||||
}
|
||||
if body, err := ioutil.ReadAll(rply.Body); err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(eXml, body) {
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
"id": "mtcall_cdr",
|
||||
"filters": ["*string:*req.request_type:MTCALL_CDR"],
|
||||
"tenant": "cgrates.org",
|
||||
"flags": ["*cdrs"],
|
||||
"flags": ["*cdrs","*log"],
|
||||
"request_fields":[
|
||||
{"tag": "RequestType", "field_id": "RequestType", "type": "*constant",
|
||||
"value": "*pseudoprepaid", "mandatory": true},
|
||||
@@ -69,14 +69,16 @@
|
||||
"value": "~*req.msisdn", "mandatory": true},
|
||||
{"tag": "Destination", "field_id": "Destination", "type": "*composed",
|
||||
"value": "~*req.destination", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed",
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable",
|
||||
"value": "~*req.timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "SetupTime", "type": "*composed",
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable",
|
||||
"value": "~*req.timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*composed",
|
||||
"value": "~*req.leg_duration;s", "mandatory": true},
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"],
|
||||
"field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*composed", "value": "~*cgrep.Error", "blocker": true},
|
||||
{"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*composed",
|
||||
"value": "~*req.CDR_ID", "mandatory": true},
|
||||
{"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant",
|
||||
|
||||
@@ -71,12 +71,14 @@
|
||||
"value": "~*req.destination", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed",
|
||||
"value": "~*req.timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "SetupTime", "type": "*composed",
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed",
|
||||
"value": "~*req.timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*composed",
|
||||
"value": "~*req.leg_duration;s", "mandatory": true},
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"],
|
||||
"field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*composed", "value": "~*cgrep.Error", "blocker": true},
|
||||
{"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*composed",
|
||||
"value": "~*req.CDR_ID", "mandatory": true},
|
||||
{"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant",
|
||||
|
||||
Reference in New Issue
Block a user