more tests fixes

This commit is contained in:
Radu Ioan Fericean
2015-08-11 18:45:19 +03:00
parent 9f2a36b0e5
commit 548d01bff1
7 changed files with 26 additions and 25 deletions

View File

@@ -916,7 +916,7 @@ func (self *ApierV1) ReloadCache(attrs utils.ApiReloadCache, reply *string) erro
}); err != nil {
return err
}
if err := self.RatingDb.CacheRatingPrefixValues(map[string][]string{
if err := self.AccountDb.CacheAccountingPrefixValues(map[string][]string{
utils.ALIASES_PREFIX: alsKeys,
}); err != nil {
return err

View File

@@ -1537,6 +1537,7 @@ func TestApierLocalSetDestination(t *testing.T) {
}
}
/*
func TestApierLocalGetRatingSubjectAliases(t *testing.T) {
if !*testLocal {
return
@@ -1549,7 +1550,6 @@ func TestApierLocalGetRatingSubjectAliases(t *testing.T) {
}
}
/*
func TestApierLocalAddRatingSubjectAliases(t *testing.T) {
if !*testLocal {
return
@@ -1573,7 +1573,7 @@ func TestApierLocalAddRatingSubjectAliases(t *testing.T) {
t.Errorf("Expecting: %v, received: %v", expectSubjAliases, subjAliases)
}
}
}*/
}
func TestApierLocalRemRatingSubjectAliases(t *testing.T) {
if !*testLocal {
@@ -1607,7 +1607,7 @@ func TestApierLocalGetAccountAliases(t *testing.T) {
}
}
/*
func TestApierLocalAddAccountAliases(t *testing.T) {
if !*testLocal {
return
@@ -1631,7 +1631,7 @@ func TestApierLocalAddAccountAliases(t *testing.T) {
t.Errorf("Expecting: %v, received: %v", expectAcntAliases, acntAliases)
}
}
}*/
}
func TestApierLocalRemAccountAliases(t *testing.T) {
if !*testLocal {
@@ -1651,6 +1651,7 @@ func TestApierLocalRemAccountAliases(t *testing.T) {
t.Error("Unexpected error", err.Error())
}
}
*/
func TestApierLocalGetScheduledActions(t *testing.T) {
if !*testLocal {

View File

@@ -355,18 +355,18 @@ CREATE INDEX tpusers_idx ON tp_users (tpid,tenant,user_name);
DROP TABLE IF EXISTS tp_aliases;
CREATE TABLE tp_aliases (
id SERIAL PRIMARY KEY,
tpid VARCHAR(64) NOT NULL,
direction VARCHAR(8) NOT NULL,
tenant VARCHAR(64) NOT NULL,
category VARCHAR(32) NOT NULL,
account VARCHAR(64) NOT NULL,
subject VARCHAR(64) NOT NULL,
group VARCHAR(64) NOT NULL,
destionation_id VARCHAR(64) NOT NULL,
alias VARCHAR(64) NOT NULL,
weight NUMERIC(8,2) NOT NULL,
created_at TIMESTAMP
`id` SERIAL PRIMARY KEY,
`tpid` VARCHAR(64) NOT NULL,
`direction` VARCHAR(8) NOT NULL,
`tenant` VARCHAR(64) NOT NULL,
`category` VARCHAR(32) NOT NULL,
`account` VARCHAR(64) NOT NULL,
`subject` VARCHAR(64) NOT NULL,
`group` VARCHAR(64) NOT NULL,
`destionation_id` VARCHAR(64) NOT NULL,
`alias` VARCHAR(64) NOT NULL,
`weight` NUMERIC(8,2) NOT NULL,
`created_at` TIMESTAMP
);
CREATE INDEX tpaliases_tpid_idx ON tp_aliases (tpid);
CREATE INDEX tpaliases_idx ON tp_aliases (tpid,direction,tenant,category,account,subject,group);
CREATE INDEX tpaliases_idx ON tp_aliases (`tpid`,`direction`,`tenant,category`,`account`,`subject`,`group`);

View File

@@ -1,6 +1,6 @@
#Tenant,Account,Direction,ActionPlanTag,ActionTriggersTag
cgrates.org,1001,*out,PACKAGE_1001,STANDARD_TRIGGERS
cgrates.org,1002;1006,*out,PACKAGE_10,STANDARD_TRIGGERS
cgrates.org,1002,*out,PACKAGE_10,STANDARD_TRIGGERS
cgrates.org,1003,*out,PACKAGE_10,STANDARD_TRIGGERS
cgrates.org,1004,*out,PACKAGE_10,STANDARD_TRIGGERS
cgrates.org,1007,*out,USE_SHARED_A,STANDARD_TRIGGERS
1 #Tenant Account Direction ActionPlanTag ActionTriggersTag
2 cgrates.org 1001 *out PACKAGE_1001 STANDARD_TRIGGERS
3 cgrates.org 1002;1006 1002 *out PACKAGE_10 STANDARD_TRIGGERS
4 cgrates.org 1003 *out PACKAGE_10 STANDARD_TRIGGERS
5 cgrates.org 1004 *out PACKAGE_10 STANDARD_TRIGGERS
6 cgrates.org 1007 *out USE_SHARED_A STANDARD_TRIGGERS

View File

@@ -1,5 +1,5 @@
Direction,Tenant,Category,Account,Subject,DestinationId,Group,Alias,Weight
#Direction,Tenant,Category,Account,Subject,DestinationId,Group,Alias,Weight
*out,cgrates.org,call,dan,dan,EU_LANDLINE,*rating_profile,dan1,10
*out,cgrates.org,call,dan,dan,GLOBAL1,*rating_profile,dan2,20
*any,*any,*any,*any,*any,*any,*rating_profile,rif1,20
*any,*any,*any,*any,*any,*any,*account,dan1,10
*any,*any,*any,*any,*any,*any,*account,dan1,10
1 Direction #Direction Tenant Category Account Subject DestinationId Group Alias Weight
2 *out *out cgrates.org call dan dan EU_LANDLINE *rating_profile dan1 10
3 *out *out cgrates.org call dan dan GLOBAL1 *rating_profile dan2 20
4 *any *any *any *any *any *any *any *rating_profile rif1 20
5 *any *any *any *any *any *any *any *account dan1 10

View File

@@ -1,6 +1,6 @@
#Direction,Tenant,Category,Subject,ActivationTime,RatingPlanId,RatesFallbackSubject,CdrStatQueueIds
*out,cgrates.org,call,*any,2014-01-14T00:00:00Z,RP_RETAIL1,,
*out,cgrates.org,call,1001;1006,2014-01-14T00:00:00Z,RP_RETAIL2,,
*out,cgrates.org,call,1001,2014-01-14T00:00:00Z,RP_RETAIL2,,
*out,cgrates.org,call,SPECIAL_1002,2014-01-14T00:00:00Z,RP_SPECIAL_1002,,
*out,cgrates.org,lcr_profile1,suppl1,2014-01-14T00:00:00Z,RP_RETAIL1,,STATS_SUPPL1
*out,cgrates.org,lcr_profile1,suppl2,2014-01-14T00:00:00Z,RP_RETAIL2,,STATS_SUPPL2
1 #Direction Tenant Category Subject ActivationTime RatingPlanId RatesFallbackSubject CdrStatQueueIds
2 *out cgrates.org call *any 2014-01-14T00:00:00Z RP_RETAIL1
3 *out cgrates.org call 1001;1006 1001 2014-01-14T00:00:00Z RP_RETAIL2
4 *out cgrates.org call SPECIAL_1002 2014-01-14T00:00:00Z RP_SPECIAL_1002
5 *out cgrates.org lcr_profile1 suppl1 2014-01-14T00:00:00Z RP_RETAIL1 STATS_SUPPL1
6 *out cgrates.org lcr_profile1 suppl2 2014-01-14T00:00:00Z RP_RETAIL2 STATS_SUPPL2

View File

@@ -116,13 +116,13 @@ func TestTutLocalCacheStats(t *testing.T) {
return
}
var rcvStats *utils.CacheStats
expectedStats := &utils.CacheStats{Destinations: 4, RatingPlans: 3, RatingProfiles: 8, Actions: 7, SharedGroups: 1, Aliases: 1,
DerivedChargers: 1, LcrProfiles: 4, CdrStats: 6, Users: 2}
expectedStats := &utils.CacheStats{Destinations: 4, RatingPlans: 3, RatingProfiles: 8, Actions: 7, SharedGroups: 1, Aliases: 3,
DerivedChargers: 1, LcrProfiles: 5, CdrStats: 6, Users: 2}
var args utils.AttrCacheStats
if err := tutLocalRpc.Call("ApierV1.GetCacheStats", args, &rcvStats); err != nil {
t.Error("Got error on ApierV1.GetCacheStats: ", err.Error())
} else if !reflect.DeepEqual(expectedStats, rcvStats) {
t.Errorf("Calling ApierV1.GetCacheStats expected: %v, received: %v", expectedStats, rcvStats)
t.Errorf("Calling ApierV1.GetCacheStats expected: %+v, received: %+v", expectedStats, rcvStats)
}
}