mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
ips: integrate CDRs into RADIUS IPAM integration test
This commit is contained in:
committed by
Dan Christian Bogos
parent
f68b6e8f79
commit
c3c5b617d2
@@ -303,6 +303,7 @@
|
||||
],
|
||||
"flags": [
|
||||
"*terminate",
|
||||
"*cdrs",
|
||||
"*ips"
|
||||
],
|
||||
"request_fields": [
|
||||
|
||||
@@ -3,12 +3,18 @@
|
||||
"enabled": true,
|
||||
"ips_conns": [
|
||||
"*localhost"
|
||||
],
|
||||
"cdrs_conns": [
|
||||
"*localhost"
|
||||
]
|
||||
},
|
||||
"ips": {
|
||||
"enabled": true,
|
||||
"store_interval": "-1"
|
||||
},
|
||||
"cdrs": {
|
||||
"enabled": true
|
||||
},
|
||||
"radius_agent": {
|
||||
"enabled": true,
|
||||
"sessions_conns": [
|
||||
|
||||
@@ -297,6 +297,7 @@ VALUE Acct-Terminate-Cause User-Request 1
|
||||
},
|
||||
)
|
||||
checkAllocs(t, client, "IPsAPI")
|
||||
checkCDR(t, client, imsi)
|
||||
}
|
||||
|
||||
func sendRadReq(t *testing.T, client *radigo.Client, code radigo.PacketCode, id uint8, avps map[string]string) *radigo.Packet {
|
||||
@@ -360,3 +361,20 @@ func checkAllocs(t *testing.T, client *birpc.Client, id string, wantAllocs ...st
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func checkCDR(t *testing.T, client *birpc.Client, acnt string) {
|
||||
t.Helper()
|
||||
var cdrs []*utils.CDR
|
||||
if err := client.Call(context.Background(), utils.AdminSv1GetCDRs,
|
||||
&utils.CDRFilters{
|
||||
FilterIDs: []string{
|
||||
fmt.Sprintf("*string:~*req.Account:%s", acnt),
|
||||
},
|
||||
}, &cdrs); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(cdrs) != 1 {
|
||||
t.Fatalf("%s received %d cdrs, want exactly one", utils.AdminSv1GetCDRs, len(cdrs))
|
||||
}
|
||||
t.Logf("CDR contents: %s", utils.ToIJSON(cdrs[0]))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user