mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Revise tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
9b08994b5e
commit
746846eaaf
@@ -64,7 +64,7 @@ ENABLE_ACNT,*enable_account,,,,,,,,,,,,,false,false,10`
|
||||
csvr, err := engine.NewTpReader(dbAcntActs.DataDB(), engine.NewStringCSVStorage(utils.CSVSep, destinations, timings,
|
||||
rates, destinationRates, ratingPlans, ratingProfiles, sharedGroups,
|
||||
actions, actionPlans, actionTriggers, accountActions,
|
||||
resLimits, ips, stats, trends, rankings, thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil, false)
|
||||
resLimits, ips, stats, trends, rankings, thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ func TestAuthLoadCsvError(t *testing.T) {
|
||||
chargerProfiles := ``
|
||||
csvr, err := engine.NewTpReader(dbAuth.DataDB(), engine.NewStringCSVStorage(utils.CSVSep, destinations, timings, rates, destinationRates,
|
||||
ratingPlans, ratingProfiles, sharedGroups, actions, actionPlans, actionTriggers, accountActions,
|
||||
resLimits, ips, stats, trends, rankings, thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil, false)
|
||||
resLimits, ips, stats, trends, rankings, thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -104,7 +104,7 @@ cgrates.org,call,*any,2013-01-06T00:00:00Z,RP_ANY,`
|
||||
chargerProfiles := ``
|
||||
csvr, err := engine.NewTpReader(dbAuth.DataDB(), engine.NewStringCSVStorage(utils.CSVSep, destinations, timings, rates, destinationRates,
|
||||
ratingPlans, ratingProfiles, sharedGroups, actions, actionPlans, actionTriggers, accountActions,
|
||||
resLimits, ips, stats, trends, rankings, thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil, false)
|
||||
resLimits, ips, stats, trends, rankings, thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ cgrates.org,sms,*any,2012-01-01T00:00:00Z,RP_SMS1,`
|
||||
utils.EmptyString, utils.EmptyString, utils.EmptyString, utils.EmptyString,
|
||||
utils.EmptyString, utils.EmptyString, utils.EmptyString, utils.EmptyString,
|
||||
utils.EmptyString, utils.EmptyString, utils.EmptyString, utils.EmptyString,
|
||||
), utils.EmptyString, utils.EmptyString, nil, nil, false)
|
||||
), utils.EmptyString, utils.EmptyString, nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ RP_DATA1,DR_DATA_2,TM2,10`
|
||||
utils.EmptyString, utils.EmptyString, utils.EmptyString, utils.EmptyString,
|
||||
utils.EmptyString, utils.EmptyString, utils.EmptyString, utils.EmptyString,
|
||||
),
|
||||
utils.EmptyString, utils.EmptyString, nil, nil, false)
|
||||
utils.EmptyString, utils.EmptyString, nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ TOPUP10_AT,TOPUP10_AC1,ASAP,10`
|
||||
destinationRates, ratingPlans, ratingProfiles,
|
||||
sharedGroups, actions, actionPlans, actionTriggers, accountActions,
|
||||
resLimits, ips, stats, trends, rankings, thresholds, filters, suppliers,
|
||||
attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil, false)
|
||||
attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ TOPUP10_AT,TOPUP10_AC1,ASAP,10`
|
||||
csvr, err := engine.NewTpReader(dataDB2.DataDB(), engine.NewStringCSVStorage(utils.CSVSep, destinations, timings,
|
||||
rates, destinationRates, ratingPlans, ratingProfiles, sharedGroups, actions, actionPlans,
|
||||
actionTriggers, accountActions, resLimits, ips,
|
||||
stats, trends, rankings, thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil, false)
|
||||
stats, trends, rankings, thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ cgrates.org,call,discounted_minutes,2013-01-06T00:00:00Z,RP_UK_Mobile_BIG5_PKG,`
|
||||
csvr, err := engine.NewTpReader(dataDB3.DataDB(), engine.NewStringCSVStorage(utils.CSVSep, destinations, timings, rates,
|
||||
destinationRates, ratingPlans, ratingProfiles, sharedGroups, actions, actionPlans, actionTriggers,
|
||||
accountActions, resLimits, ips, stats, trends, rankings,
|
||||
thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil, false)
|
||||
thresholds, filters, suppliers, attrProfiles, chargerProfiles, ``, ""), "", "", nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -391,9 +391,16 @@ func testDynThdGetAccountAfterDebit(t *testing.T) {
|
||||
}
|
||||
|
||||
func testDynThdGetThresholdAfterDebit(t *testing.T) {
|
||||
expThd := &engine.Threshold{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "THD_ACNT_1002",
|
||||
Hits: 1,
|
||||
}
|
||||
var result2 *engine.Threshold
|
||||
if err := dynThdRpc.Call(context.Background(), utils.ThresholdSv1GetThreshold, &utils.TenantIDWithAPIOpts{TenantID: &utils.TenantID{Tenant: "cgrates.org", ID: "THD_ACNT_1002"}}, &result2); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := dynThdRpc.Call(context.Background(), utils.ThresholdSv1GetThreshold, &utils.TenantIDWithAPIOpts{TenantID: &utils.TenantID{Tenant: "cgrates.org", ID: "THD_ACNT_1002"}}, &result2); err != nil {
|
||||
t.Error(err)
|
||||
} else if result2.Snooze = expThd.Snooze; !reflect.DeepEqual(result2, expThd) {
|
||||
t.Errorf("\nexpected: <%+v>, \nreceived: <%+v>", utils.ToJSON(expThd), utils.ToJSON(result2))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ func testExpVerifyStats(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Blocker: true,
|
||||
Stored: true,
|
||||
Stored: false,
|
||||
Weight: 30,
|
||||
MinItems: 0,
|
||||
ThresholdIDs: []string{utils.MetaNone},
|
||||
|
||||
@@ -369,7 +369,7 @@ func testRpcdrsNewEngineSameDB(t *testing.T) {
|
||||
|
||||
tpFiles := map[string]string{
|
||||
utils.StatsCsv: `#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],QueueLength[4],TTL[5],MinItems[6],Metrics[7],MetricFilterIDs[8],Stored[9],Blocker[10],Weight[11],ThresholdIDs[12]
|
||||
cgrates.org,STAT_AGG,,2014-07-29T15:00:00Z,0,-1,0,*tcd;*tcc;*sum#1,,true,false,30,*none`,
|
||||
cgrates.org,STAT_AGG,,2014-07-29T15:00:00Z,0,-1,0,*tcd;*tcc;*sum#1,,false,false,30,*none`,
|
||||
}
|
||||
|
||||
if _, err := engine.StopStartEngine(rpcdrsCfgPath, *utils.WaitRater); err != nil {
|
||||
|
||||
@@ -55,7 +55,6 @@ var (
|
||||
func TestRsV1IT(t *testing.T) {
|
||||
switch *utils.DBType {
|
||||
case utils.MetaInternal:
|
||||
t.Skip("unfinished, resources solution needed")
|
||||
rlsV1ConfDIR = "tutinternal"
|
||||
case utils.MetaMySQL:
|
||||
rlsV1ConfDIR = "tutmysql"
|
||||
|
||||
@@ -81,7 +81,6 @@ var (
|
||||
func TestRoutesCaseV1IT(t *testing.T) {
|
||||
switch *utils.DBType {
|
||||
case utils.MetaInternal:
|
||||
t.Skip("unfinished, resources solution needed")
|
||||
rtsCaseSv1ConfDIR = "tutinternal"
|
||||
case utils.MetaMySQL:
|
||||
rtsCaseSv1ConfDIR = "tutmysql"
|
||||
|
||||
@@ -51,7 +51,7 @@ func TestSMSLoadCsvTpSmsChrg1(t *testing.T) {
|
||||
utils.EmptyString, utils.EmptyString, utils.EmptyString, utils.EmptyString,
|
||||
utils.EmptyString, utils.EmptyString, utils.EmptyString, utils.EmptyString,
|
||||
utils.EmptyString, utils.EmptyString, utils.EmptyString, utils.EmptyString,
|
||||
utils.EmptyString), utils.EmptyString, utils.EmptyString, nil, nil, false)
|
||||
utils.EmptyString), utils.EmptyString, utils.EmptyString, nil, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ func TestTrendSchedule(t *testing.T) {
|
||||
cgrates.org,TREND_1,@every 1s,Stats1_1,,-1,-1,1,*last,1,false,Threshold1;Threshold2
|
||||
cgrates.org,TREND_2,@every 1s,Stats1_2,,-1,-1,1,*last,1,false,*none`,
|
||||
utils.StatsCsv: `#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],QueueLength[4],TTL[5],MinItems[6],Metrics[7],MetricFilterIDs[8],Stored[9],Blocker[10],Weight[11],ThresholdIDs[12]
|
||||
cgrates.org,Stats1_1,*string:~*req.Account:1001,,,,,*tcc;*acd;*tcd,,true,,,
|
||||
cgrates.org,Stats1_2,*string:~*req.Account:1002,,,,,*sum#~*req.Usage;*pdd,,true,,,`,
|
||||
cgrates.org,Stats1_1,*string:~*req.Account:1001,,,,,*tcc;*acd;*tcd,,false,,,
|
||||
cgrates.org,Stats1_2,*string:~*req.Account:1002,,,,,*sum#~*req.Usage;*pdd,,false,,,`,
|
||||
utils.ThresholdsCsv: `#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],MaxHits[4],MinHits[5],MinSleep[6],Blocker[7],Weight[8],ActionIDs[9],Async[10],EeIDs[11]
|
||||
cgrates.org,Threshold1,*string:~*req.Metrics.*acd.ID:*acd,2024-07-29T15:00:00Z,-1,10,1s,false,10,,true,
|
||||
cgrates.org,Threshold2,*string:~*req.Metrics.*pdd.ID:*pdd,2024-07-29T15:00:00Z,-1,10,1s,false,10,,true,
|
||||
|
||||
Reference in New Issue
Block a user