mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 05:39:54 +05:00
Fixes for general tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
6d200d8604
commit
f8a21a541c
@@ -218,8 +218,8 @@ func TestA1itDataSession1(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
cc = *ec.AsCallCost()
|
||||
if len(cc.Timespans) != 3 {
|
||||
t.Errorf("Unexpected number of timespans: %+v", len(cc.Timespans))
|
||||
if len(cc.Timespans) != 1 {
|
||||
t.Errorf("Unexpected number of timespans: %+v, for %+v\n from:%+v", len(cc.Timespans), utils.ToJSON(cc.Timespans), utils.ToJSON(ec))
|
||||
}
|
||||
if cc.RatedUsage != 2202800 {
|
||||
t.Errorf("RatingUsage expected: %f received %f, callcost: %+v ", 2202800.0, cc.RatedUsage, cc)
|
||||
|
||||
@@ -81,9 +81,9 @@ func testCDREInitCfg(t *testing.T) {
|
||||
config.SetCgrConfig(cdreCfg)
|
||||
switch cdreConfigDIR {
|
||||
case "tutmongo":
|
||||
cdreDelay = 4000
|
||||
default:
|
||||
cdreDelay = 2000
|
||||
default:
|
||||
cdreDelay = 1000
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ func testCDREProcessCdr(t *testing.T) {
|
||||
ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}}
|
||||
cdr.ComputeCGRID()
|
||||
var reply string
|
||||
if err := cdreRPC.Call("CdrsV1.ProcessCdr", cdr, &reply); err != nil {
|
||||
if err := cdreRPC.Call(utils.CdrsV2ProcessCDR, cdr, &reply); err != nil {
|
||||
t.Error("Unexpected error: ", err.Error())
|
||||
} else if reply != utils.OK {
|
||||
t.Error("Unexpected reply received: ", reply)
|
||||
|
||||
@@ -276,7 +276,7 @@ func TestCDRsOnExpAMQPPosterFileFailover(t *testing.T) {
|
||||
if readBytes, err := ioutil.ReadFile(filePath); err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(failoverContent, readBytes) { // Checking just the prefix should do since some content is dynamic
|
||||
t.Errorf("Expecting: %q, received: %q", string(failoverContent), string(readBytes))
|
||||
t.Errorf("Expecting: %v, received: %v", utils.ToJSON(failoverContent), utils.ToJSON(readBytes))
|
||||
}
|
||||
if err := os.Remove(filePath); err != nil {
|
||||
t.Error("Failed removing file: ", filePath)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -257,21 +257,22 @@ func TestTpExecuteActionCgrRpcAcc(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTpExecuteActionCgrRpcCdrStats(t *testing.T) {
|
||||
var reply string
|
||||
if err := tpRPC.Call("ApierV2.ExecuteAction", utils.AttrExecuteAction{
|
||||
ActionsId: "RPC_CDRSTATS",
|
||||
}, &reply); err != nil {
|
||||
t.Error("Got error on ApierV2.ExecuteAction: ", err.Error())
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Calling ExecuteAction got reply: %s", reply)
|
||||
}
|
||||
var queue engine.CDRStatsQueue
|
||||
time.Sleep(20 * time.Millisecond)
|
||||
if err := tpRPC.Call("CDRStatsV1.GetQueue", "qtest", &queue); err != nil {
|
||||
t.Error("Got error on CDRStatsV1.GetQueue: ", err.Error())
|
||||
}
|
||||
}
|
||||
// Deprecated
|
||||
// func TestTpExecuteActionCgrRpcCdrStats(t *testing.T) {
|
||||
// var reply string
|
||||
// if err := tpRPC.Call("ApierV2.ExecuteAction", utils.AttrExecuteAction{
|
||||
// ActionsId: "RPC_CDRSTATS",
|
||||
// }, &reply); err != nil {
|
||||
// t.Error("Got error on ApierV2.ExecuteAction: ", err.Error())
|
||||
// } else if reply != utils.OK {
|
||||
// t.Errorf("Calling ExecuteAction got reply: %s", reply)
|
||||
// }
|
||||
// var queue engine.CDRStatsQueue
|
||||
// time.Sleep(20 * time.Millisecond)
|
||||
// if err := tpRPC.Call("CDRStatsV1.GetQueue", "qtest", &queue); err != nil {
|
||||
// t.Error("Got error on CDRStatsV1.GetQueue: ", err.Error())
|
||||
// }
|
||||
// }
|
||||
|
||||
func TestTpCreateExecuteActionMatch(t *testing.T) {
|
||||
var reply string
|
||||
|
||||
Reference in New Issue
Block a user