mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Finish integration test for Attribute V3
This commit is contained in:
committed by
Dan Christian Bogos
parent
a5ee8e8398
commit
9214301de3
@@ -168,12 +168,10 @@ func testAttributeSGetAttributeForEvent(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Account,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -220,7 +218,6 @@ func testAttributeSGetAttributeForEventNotFound(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Account,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -271,7 +268,6 @@ func testAttributeSGetAttributeForEventWithMetaAnyContext(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Account,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -417,13 +413,12 @@ func testAttributeSProcessEventWithNoneSubstitute(t *testing.T) {
|
||||
},
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FilterIDs: []string{"*string:Account:1008"},
|
||||
FieldName: utils.Account,
|
||||
Initial: "1008",
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile(utils.META_NONE, true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -438,7 +433,7 @@ func testAttributeSProcessEventWithNoneSubstitute(t *testing.T) {
|
||||
}
|
||||
eRply := &engine.AttrSProcessEventReply{
|
||||
MatchedProfiles: []string{"AttributeWithNonSubstitute"},
|
||||
AlteredFields: []string{utils.Account},
|
||||
AlteredFields: []string{utils.Account, utils.Subject},
|
||||
CGREvent: &utils.CGREvent{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "testAttributeSWithNoneSubstitute",
|
||||
@@ -483,13 +478,12 @@ func testAttributeSProcessEventWithNoneSubstitute2(t *testing.T) {
|
||||
},
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FilterIDs: []string{"*string:Account:1008"},
|
||||
FieldName: utils.Account,
|
||||
Initial: "1008",
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile(utils.META_NONE, true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -560,13 +554,13 @@ func testAttributeSProcessEventWithNoneSubstitute3(t *testing.T) {
|
||||
},
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FilterIDs: []string{"*string:Account:1008"},
|
||||
FieldName: utils.Account,
|
||||
Initial: "1008",
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
{
|
||||
FilterIDs: []string{"*string:Subject:1008"},
|
||||
FieldName: utils.Subject,
|
||||
Initial: "1008",
|
||||
Substitute: config.NewRSRParsersMustCompile(utils.META_NONE, true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -613,7 +607,6 @@ func testAttributeSProcessEventWithHeader(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: "Field2",
|
||||
Initial: utils.META_ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("~Field1", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -686,7 +679,6 @@ func testAttributeSSetAlsPrf(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: "FL1",
|
||||
Initial: "In1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Al1", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -714,12 +706,10 @@ func testAttributeSUpdateAlsPrf(t *testing.T) {
|
||||
alsPrf.Attributes = []*engine.Attribute{
|
||||
{
|
||||
FieldName: "FL1",
|
||||
Initial: "In1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Al1", true, utils.INFIELD_SEP),
|
||||
},
|
||||
{
|
||||
FieldName: "FL2",
|
||||
Initial: "In2",
|
||||
Substitute: config.NewRSRParsersMustCompile("Al2", true, utils.INFIELD_SEP),
|
||||
},
|
||||
}
|
||||
@@ -776,7 +766,6 @@ func testAttributeSSetAlsPrf2(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.RSRParsers{
|
||||
&config.RSRParser{
|
||||
Rules: "roam",
|
||||
@@ -819,7 +808,6 @@ func testAttributeSSetAlsPrf3(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.RSRParsers{
|
||||
&config.RSRParser{
|
||||
Rules: "",
|
||||
@@ -849,7 +837,6 @@ func testAttributeSSetAlsPrf4(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.RSRParsers{
|
||||
&config.RSRParser{},
|
||||
},
|
||||
@@ -885,7 +872,6 @@ func testAttributeSProcessEventWithSearchAndReplace(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: "Category",
|
||||
Initial: utils.META_ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("~Category:s/(.*)/${1}_suffix/", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -156,7 +156,6 @@ func testChargerSLoadAddCharger(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: "Password",
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.RSRParsers{
|
||||
&config.RSRParser{
|
||||
Rules: "CGRateS.org",
|
||||
|
||||
@@ -1193,8 +1193,8 @@ func testV1FIdxSetAttributeProfileIndexes(t *testing.T) {
|
||||
},
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FilterIDs: []string{"*string:FL1:In1"},
|
||||
FieldName: "FL1",
|
||||
Initial: "In1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Al1", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -1302,8 +1302,8 @@ func testV1FIdxSetSecondAttributeProfileIndexes(t *testing.T) {
|
||||
ExpiryTime: time.Date(2014, 7, 14, 14, 35, 0, 0, time.UTC),
|
||||
},
|
||||
Attributes: []*engine.Attribute{{
|
||||
FilterIDs: []string{"*string:FL1:In1"},
|
||||
FieldName: "FL1",
|
||||
Initial: "In1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Al1", true, utils.INFIELD_SEP),
|
||||
}},
|
||||
Weight: 20,
|
||||
|
||||
@@ -843,12 +843,10 @@ func testV1FIdxCaSetAttributeProfile(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Account,
|
||||
Initial: utils.META_ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.META_ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -934,12 +932,10 @@ func testV1FIdxCaUpdateAttributeProfile(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Account,
|
||||
Initial: utils.META_ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: "*any",
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -105,7 +105,7 @@ func testVrsRpcConn(t *testing.T) {
|
||||
func testVrsDataDB(t *testing.T) {
|
||||
var result engine.Versions
|
||||
expectedVrs := engine.Versions{"ActionTriggers": 2,
|
||||
"Actions": 2, "RQF": 1, "ReverseDestinations": 1, "Attributes": 2, "RatingPlan": 1,
|
||||
"Actions": 2, "RQF": 1, "ReverseDestinations": 1, "Attributes": 3, "RatingPlan": 1,
|
||||
"RatingProfile": 1, "User": 1, "Accounts": 3, "ActionPlans": 2, "Chargers": 1,
|
||||
"Destinations": 1, "SharedGroups": 2, "Stats": 2, "Resource": 1,
|
||||
"Subscribers": 1, "Suppliers": 1, "Thresholds": 3, "Timing": 1}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,FieldName,Initial,Substitute,Blocker,Weight
|
||||
cgrates.org,LRN_Dst3125650565,lrn,*string:Destination:3125650565,,Destination,*any,13128543000,false,10
|
||||
cgrates.org,LRN_Dst3125650565,,,,OriginalDestination,*any,3125650565,false,10
|
||||
cgrates.org,LRN_LATA_Dst13128543000,lrn,*string:Destination:13128543000;*rsr::~OriginalDestination(!^$),,DestinationLATA,*any,358,false,20
|
||||
cgrates.org,LRN_LATA_Cli9174269000,lrn,*string:Account:9174269000;*rsr::~DestinationLATA(!^$),,CallerLATA,*any,132,false,30
|
||||
cgrates.org,LRN_JURISDICTION_NY,lrn,FLTR_INTRALATA_NEWYORK,,LRNJurisdiction,*any,INTRA,false,50
|
||||
cgrates.org,LRN_JURISDICTION_IL,lrn,FLTR_INTRALATA_ILLINOIS,,LRNJurisdiction,*any,INTRA,false,50
|
||||
cgrates.org,LRN_JURISDICTION_INTER,lrn,*string:Destination:13128543000;*rsr::~CallerLATA(!^$),,LRNJurisdiction,*any,INTER,false,40
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Substitute,Blocker,Weight
|
||||
cgrates.org,LRN_Dst3125650565,lrn,*string:Destination:3125650565,,,Destination,13128543000,false,10
|
||||
cgrates.org,LRN_Dst3125650565,,,,,OriginalDestination,3125650565,false,10
|
||||
cgrates.org,LRN_LATA_Dst13128543000,lrn,*string:Destination:13128543000;*rsr::~OriginalDestination(!^$),,,DestinationLATA,358,false,20
|
||||
cgrates.org,LRN_LATA_Cli9174269000,lrn,*string:Account:9174269000;*rsr::~DestinationLATA(!^$),,,CallerLATA,132,false,30
|
||||
cgrates.org,LRN_JURISDICTION_NY,lrn,FLTR_INTRALATA_NEWYORK,,,LRNJurisdiction,INTRA,false,50
|
||||
cgrates.org,LRN_JURISDICTION_IL,lrn,FLTR_INTRALATA_ILLINOIS,,,LRNJurisdiction,INTRA,false,50
|
||||
cgrates.org,LRN_JURISDICTION_INTER,lrn,*string:Destination:13128543000;*rsr::~CallerLATA(!^$),,,LRNJurisdiction,INTER,false,40
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,FieldName,Initial,Substitute,Blocker,Weight
|
||||
cgrates.org,ATTR_1001_SIMPLEAUTH,simpleauth,*string:Account:1001,,Password,*any,CGRateS.org,false,20
|
||||
cgrates.org,ATTR_API_ATTR_FAKE_AUTH,*auth,*string:APIKey:12345,,APIMethods,*any,,false,20
|
||||
cgrates.org,ATTR_API_ATTR_AUTH,*auth,*string:APIKey:attr12345,,APIMethods,*any,AttributeSv1.Ping&AttributeSv1.GetAttributeForEvent&AttributeSv1.ProcessEvent,false,20
|
||||
cgrates.org,ATTR_API_CHRG_AUTH,*auth,*string:APIKey:chrg12345,,APIMethods,*any,ChargerSv1.Ping&ChargerSv1.GetChargersForEvent&ChargerSv1.ProcessEvent,false,20
|
||||
cgrates.org,ATTR_API_THR_AUTH,*auth,*string:APIKey:thr12345,,APIMethods,*any,ThresholdSv1.Ping&ThresholdSv1.GetThresholdsForEvent&ThresholdSv1.ProcessEvent&ThresholdSv1.GetThreshold&ThresholdSv1.GetThresholdIDs,false,20
|
||||
cgrates.org,ATTR_API_SUP_AUTH,*auth,*string:APIKey:sup12345,,APIMethods,*any,SupplierSv1.Ping&SupplierSv1.GetSuppliers,false,20
|
||||
cgrates.org,ATTR_API_STAT_AUTH,*auth,*string:APIKey:stat12345,,APIMethods,*any,StatSv1.Ping&StatSv1.GetStatQueuesForEvent&StatSv1.GetQueueStringMetrics&StatSv1.ProcessEvent&StatSv1.GetQueueIDs&StatSv1.GetQueueFloatMetrics,false,20
|
||||
cgrates.org,ATTR_API_RES_AUTH,*auth,*string:APIKey:res12345,,APIMethods,*any,ResourceSv1.Ping&ResourceSv1.GetResourcesForEvent&ResourceSv1.AuthorizeResources&ResourceSv1.AllocateResources&ResourceSv1.ReleaseResources,false,20
|
||||
cgrates.org,ATTR_API_SES_AUTH,*auth,*string:APIKey:ses12345,,APIMethods,*any,SessionSv1.Ping&SessionSv1.AuthorizeEventWithDigest&SessionSv1.InitiateSessionWithDigest&SessionSv1.UpdateSession&SessionSv1.TerminateSession&SessionSv1.ProcessCDR&SessionSv1.ProcessEvent&SessionSv1.GetActiveSessions&SessionSv1.GetActiveSessionsCount&SessionSv1.ForceDisconnect&SessionSv1.GetPassiveSessions&SessionSv1.GetPassiveSessionsCount&SessionSv1.SetPassiveSession&SessionSv1.ReplicateSessions,false,20
|
||||
cgrates.org,ATTR_API_RSP_AUTH,*auth,*string:APIKey:rsp12345,,APIMethods,*any,Responder.Status,false,20
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Substitute,Blocker,Weight
|
||||
cgrates.org,ATTR_1001_SIMPLEAUTH,simpleauth,*string:Account:1001,,,Password,CGRateS.org,false,20
|
||||
cgrates.org,ATTR_API_ATTR_FAKE_AUTH,*auth,*string:APIKey:12345,,,APIMethods,,false,20
|
||||
cgrates.org,ATTR_API_ATTR_AUTH,*auth,*string:APIKey:attr12345,,,APIMethods,AttributeSv1.Ping&AttributeSv1.GetAttributeForEvent&AttributeSv1.ProcessEvent,false,20
|
||||
cgrates.org,ATTR_API_CHRG_AUTH,*auth,*string:APIKey:chrg12345,,,APIMethods,ChargerSv1.Ping&ChargerSv1.GetChargersForEvent&ChargerSv1.ProcessEvent,false,20
|
||||
cgrates.org,ATTR_API_THR_AUTH,*auth,*string:APIKey:thr12345,,,APIMethods,ThresholdSv1.Ping&ThresholdSv1.GetThresholdsForEvent&ThresholdSv1.ProcessEvent&ThresholdSv1.GetThreshold&ThresholdSv1.GetThresholdIDs,false,20
|
||||
cgrates.org,ATTR_API_SUP_AUTH,*auth,*string:APIKey:sup12345,,,APIMethods,SupplierSv1.Ping&SupplierSv1.GetSuppliers,false,20
|
||||
cgrates.org,ATTR_API_STAT_AUTH,*auth,*string:APIKey:stat12345,,,APIMethods,StatSv1.Ping&StatSv1.GetStatQueuesForEvent&StatSv1.GetQueueStringMetrics&StatSv1.ProcessEvent&StatSv1.GetQueueIDs&StatSv1.GetQueueFloatMetrics,false,20
|
||||
cgrates.org,ATTR_API_RES_AUTH,*auth,*string:APIKey:res12345,,,APIMethods,ResourceSv1.Ping&ResourceSv1.GetResourcesForEvent&ResourceSv1.AuthorizeResources&ResourceSv1.AllocateResources&ResourceSv1.ReleaseResources,false,20
|
||||
cgrates.org,ATTR_API_SES_AUTH,*auth,*string:APIKey:ses12345,,,APIMethods,SessionSv1.Ping&SessionSv1.AuthorizeEventWithDigest&SessionSv1.InitiateSessionWithDigest&SessionSv1.UpdateSession&SessionSv1.TerminateSession&SessionSv1.ProcessCDR&SessionSv1.ProcessEvent&SessionSv1.GetActiveSessions&SessionSv1.GetActiveSessionsCount&SessionSv1.ForceDisconnect&SessionSv1.GetPassiveSessions&SessionSv1.GetPassiveSessionsCount&SessionSv1.SetPassiveSession&SessionSv1.ReplicateSessions,false,20
|
||||
cgrates.org,ATTR_API_RSP_AUTH,*auth,*string:APIKey:rsp12345,,,APIMethods,Responder.Status,false,20
|
||||
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,FieldName,Initial,Substitute,Blocker,Weight
|
||||
cgrates.org,ATTR_1,*sessions;*cdrs,*string:Account:1007,2014-01-14T00:00:00Z,Account,*any,1001,false,10
|
||||
cgrates.org,ATTR_1,,,,Subject,*any,1001,,
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Substitute,Blocker,Weight
|
||||
cgrates.org,ATTR_1,*sessions;*cdrs,*string:Account:1007,2014-01-14T00:00:00Z,,Account,1001,false,10
|
||||
cgrates.org,ATTR_1,,,,,Subject,1001,,
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#Tenant,ID,Context,FilterIDs,ActivationInterval,FieldName,Initial,Substitute,Blocker,Weight
|
||||
cgrates.org,ATTR_ACNT_1001,*sessions,FLTR_ACCOUNT_1001,,OfficeGroup,*any,Marketing,false,10
|
||||
cgrates.org,ATTR_SUPPLIER1,*chargers,,,Subject,*any,SUPPLIER1,false,10
|
||||
cgrates.org,ATTR_PAYPAL,*cdrs,*string:Subject:ANY2CNT,,PayPalAccount,*any,paypal@cgrates.org,false,10
|
||||
#Tenant,ID,Context,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Substitute,Blocker,Weight
|
||||
cgrates.org,ATTR_ACNT_1001,*sessions,FLTR_ACCOUNT_1001,,,OfficeGroup,Marketing,false,10
|
||||
cgrates.org,ATTR_SUPPLIER1,*chargers,,,,Subject,SUPPLIER1,false,10
|
||||
cgrates.org,ATTR_PAYPAL,*cdrs,*string:Subject:ANY2CNT,,,PayPalAccount,paypal@cgrates.org,false,10
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,FieldName,Initial,Substitute,Blocker,Weight
|
||||
cgrates.org,ALS1,con1,FLTR_1,2014-07-29T15:00:00Z,Field1,Initial1,Sub1,false,20
|
||||
cgrates.org,ALS1,,,,Field2,Initial2,Sub2,,
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Substitute,Blocker,Weight
|
||||
cgrates.org,ALS1,con1,FLTR_1,2014-07-29T15:00:00Z,*string:Field1:Initial1,Field1,Sub1,false,20
|
||||
cgrates.org,ALS1,,,,*string:Field1:Initial2,Field2,Sub2,,
|
||||
|
||||
|
@@ -1,22 +1,22 @@
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,FieldName,Initial,Substitute,Blocker,Weight
|
||||
cgrates.org,ATTR_1001_SIMPLEAUTH,simpleauth,*string:Account:1001,,Password,*any,CGRateS.org,false,20
|
||||
cgrates.org,ATTR_1002_SIMPLEAUTH,simpleauth,*string:Account:1002,,Password,*any,CGRateS.org,false,20
|
||||
cgrates.org,ATTR_1003_SIMPLEAUTH,simpleauth,*string:Account:1003,,Password,*any,CGRateS.org,false,20
|
||||
cgrates.org,ATTR_1001_SESSIONAUTH,*sessions,*string:Account:1001,,Password,*any,CGRateS.org,false,10
|
||||
cgrates.org,ATTR_1001_SESSIONAUTH,,,,RequestType,*any,*prepaid,,
|
||||
cgrates.org,ATTR_1001_SESSIONAUTH,,,,PaypalAccount,*any,cgrates@paypal.com,,
|
||||
cgrates.org,ATTR_1001_SESSIONAUTH,,,,LCRProfile,*any,premium_cli,,
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,*sessions,*string:Account:1002,,Password,*any,CGRateS.org,false,10
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,,,,RequestType,*any,*postpaid,,
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,,,,PaypalAccount,*any,cgrates@paypal.com,,
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,,,,LCRProfile,*any,premium_cli,,
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,,,,ResourceAllocation,*any,"ResGroup1",,
|
||||
cgrates.org,ATTR_1003_SESSIONAUTH,*sessions,*string:Account:1003,,Password,*any,CGRateS.org,false,10
|
||||
cgrates.org,ATTR_1003_SESSIONAUTH,,,,RequestType,*any,*prepaid,,
|
||||
cgrates.org,ATTR_1003_SESSIONAUTH,,,,PaypalAccount,*any,cgrates@paypal.com,,
|
||||
cgrates.org,ATTR_1003_SESSIONAUTH,,,,LCRProfile,*any,premium_cli,,
|
||||
cgrates.com,ATTR_TNT_ALIAS,*any,*string:SubscriberId:1006,,Account,*any,1001,false,10
|
||||
cgrates.com,ATTR_TNT_ALIAS,*any,,,RequestType,*any,*prepaid,,
|
||||
cgrates.com,ATTR_TNT_ALIAS,*any,,,*tenant,*any,cgrates.org,,
|
||||
cgrates.com,ATTR_TNT_1001,*any,*string:Account:1001,,*tenant,*any,cgrates.org,,
|
||||
cgrates.com,ATTR_TNT_DISC,*any,*string:Account:testDiamInitWithSessionDisconnect,,*tenant,*any,cgrates.org,,
|
||||
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Substitute,Blocker,Weight
|
||||
cgrates.org,ATTR_1001_SIMPLEAUTH,simpleauth,*string:Account:1001,,,Password,CGRateS.org,false,20
|
||||
cgrates.org,ATTR_1002_SIMPLEAUTH,simpleauth,*string:Account:1002,,,Password,CGRateS.org,false,20
|
||||
cgrates.org,ATTR_1003_SIMPLEAUTH,simpleauth,*string:Account:1003,,,Password,CGRateS.org,false,20
|
||||
cgrates.org,ATTR_1001_SESSIONAUTH,*sessions,*string:Account:1001,,,Password,CGRateS.org,false,10
|
||||
cgrates.org,ATTR_1001_SESSIONAUTH,,,,,RequestType,*prepaid,,
|
||||
cgrates.org,ATTR_1001_SESSIONAUTH,,,,,PaypalAccount,cgrates@paypal.com,,
|
||||
cgrates.org,ATTR_1001_SESSIONAUTH,,,,,LCRProfile,premium_cli,,
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,*sessions,*string:Account:1002,,,Password,CGRateS.org,false,10
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,,,,,RequestType,*postpaid,,
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,,,,,PaypalAccount,cgrates@paypal.com,,
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,,,,,LCRProfile,premium_cli,,
|
||||
cgrates.org,ATTR_1002_SESSIONAUTH,,,,,ResourceAllocation,"ResGroup1",,
|
||||
cgrates.org,ATTR_1003_SESSIONAUTH,*sessions,*string:Account:1003,,,Password,CGRateS.org,false,10
|
||||
cgrates.org,ATTR_1003_SESSIONAUTH,,,,,RequestType,*prepaid,,
|
||||
cgrates.org,ATTR_1003_SESSIONAUTH,,,,,PaypalAccount,cgrates@paypal.com,,
|
||||
cgrates.org,ATTR_1003_SESSIONAUTH,,,,,LCRProfile,premium_cli,,
|
||||
cgrates.com,ATTR_TNT_ALIAS,*any,*string:SubscriberId:1006,,,Account,1001,false,10
|
||||
cgrates.com,ATTR_TNT_ALIAS,*any,,,,RequestType,*prepaid,,
|
||||
cgrates.com,ATTR_TNT_ALIAS,*any,,,,*tenant,cgrates.org,,
|
||||
cgrates.com,ATTR_TNT_1001,*any,*string:Account:1001,,,*tenant,cgrates.org,,
|
||||
cgrates.com,ATTR_TNT_DISC,*any,*string:Account:testDiamInitWithSessionDisconnect,,,*tenant,cgrates.org,,
|
||||
|
||||
|
@@ -118,8 +118,8 @@ func testDspAttrGetAttrFailover(t *testing.T) {
|
||||
Contexts: []string{"simpleauth"},
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FilterIDs: []string{},
|
||||
FieldName: "Password",
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("CGRateS.org", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -293,8 +293,8 @@ func testDspAttrTestAuthKey2(t *testing.T) {
|
||||
Contexts: []string{"simpleauth"},
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FilterIDs: []string{},
|
||||
FieldName: "Password",
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("CGRateS.org", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -384,8 +384,8 @@ func testDspAttrGetAttrRoundRobin(t *testing.T) {
|
||||
Contexts: []string{"simpleauth"},
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FilterIDs: []string{},
|
||||
FieldName: "Password",
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("CGRateS.org", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -430,7 +430,6 @@ func testITTestAttributeProfileFilterIndexes(t *testing.T) {
|
||||
Attributes: []*Attribute{
|
||||
{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Val1", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1963,13 +1963,6 @@ func testOnStorITSupplierProfile(t *testing.T) {
|
||||
}
|
||||
|
||||
func testOnStorITAttributeProfile(t *testing.T) {
|
||||
mapSubstitutes := make(map[string]map[interface{}]*Attribute)
|
||||
mapSubstitutes["FN1"] = make(map[interface{}]*Attribute)
|
||||
mapSubstitutes["FN1"]["Init1"] = &Attribute{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Al1", true, utils.INFIELD_SEP),
|
||||
}
|
||||
attrProfile := &AttributeProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "AttrPrf1",
|
||||
@@ -1981,12 +1974,10 @@ func testOnStorITAttributeProfile(t *testing.T) {
|
||||
Attributes: []*Attribute{
|
||||
{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Al1", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
Weight: 20,
|
||||
attributesIdx: mapSubstitutes,
|
||||
Weight: 20,
|
||||
}
|
||||
if _, rcvErr := onStor.GetAttributeProfile("cgrates.org", "AttrPrf1",
|
||||
true, false, utils.NonTransactional); rcvErr != nil && rcvErr != utils.ErrNotFound {
|
||||
@@ -2052,14 +2043,6 @@ func testOnStorITAttributeProfile(t *testing.T) {
|
||||
}
|
||||
|
||||
func testOnStorITTestAttributeSubstituteIface(t *testing.T) {
|
||||
//set Substitue with type string
|
||||
mapSubstitutes := make(map[string]map[interface{}]*Attribute)
|
||||
mapSubstitutes["FN1"] = make(map[interface{}]*Attribute)
|
||||
mapSubstitutes["FN1"]["Init1"] = &Attribute{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Val1", true, utils.INFIELD_SEP),
|
||||
}
|
||||
attrProfile := &AttributeProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "AttrPrf1",
|
||||
@@ -2071,12 +2054,10 @@ func testOnStorITTestAttributeSubstituteIface(t *testing.T) {
|
||||
Attributes: []*Attribute{
|
||||
{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("Val1", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
Weight: 20,
|
||||
attributesIdx: mapSubstitutes,
|
||||
Weight: 20,
|
||||
}
|
||||
if _, rcvErr := onStor.GetAttributeProfile("cgrates.org", "AttrPrf1",
|
||||
true, false, utils.NonTransactional); rcvErr != nil && rcvErr != utils.ErrNotFound {
|
||||
@@ -2099,23 +2080,15 @@ func testOnStorITTestAttributeSubstituteIface(t *testing.T) {
|
||||
} else if !(reflect.DeepEqual(attrProfile, rcv)) {
|
||||
t.Errorf("Expecting: %v, received: %v", attrProfile, rcv)
|
||||
}
|
||||
//set Substitue with type float
|
||||
mapSubstitutes["FN1"]["Init1"] = &Attribute{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("123.123", true, utils.INFIELD_SEP),
|
||||
}
|
||||
attrProfile.Attributes = []*Attribute{
|
||||
{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("123.123", true, utils.INFIELD_SEP),
|
||||
},
|
||||
}
|
||||
if err := onStor.SetAttributeProfile(attrProfile, false); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
attrProfile.attributesIdx = mapSubstitutes
|
||||
//check cache
|
||||
if rcv, err := onStor.GetAttributeProfile("cgrates.org", "AttrPrf1",
|
||||
true, false, utils.NonTransactional); err != nil {
|
||||
@@ -2130,23 +2103,15 @@ func testOnStorITTestAttributeSubstituteIface(t *testing.T) {
|
||||
} else if !(reflect.DeepEqual(attrProfile, rcv)) {
|
||||
t.Errorf("Expecting: %v, received: %v", utils.ToJSON(attrProfile), utils.ToJSON(rcv))
|
||||
}
|
||||
//set Substitue with type bool
|
||||
mapSubstitutes["FN1"]["Init1"] = &Attribute{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("true", true, utils.INFIELD_SEP),
|
||||
}
|
||||
attrProfile.Attributes = []*Attribute{
|
||||
{
|
||||
FieldName: "FN1",
|
||||
Initial: "Init1",
|
||||
Substitute: config.NewRSRParsersMustCompile("true", true, utils.INFIELD_SEP),
|
||||
},
|
||||
}
|
||||
if err := onStor.SetAttributeProfile(attrProfile, false); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
attrProfile.attributesIdx = mapSubstitutes
|
||||
//check cache
|
||||
if rcv, err := onStor.GetAttributeProfile("cgrates.org", "AttrPrf1",
|
||||
true, false, utils.NonTransactional); err != nil {
|
||||
|
||||
@@ -131,7 +131,6 @@ func testRedisSentinelSetGetAttribute(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -166,7 +165,6 @@ func testRedisSentinelInsertion(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
@@ -251,7 +249,6 @@ func testRedisSentinelGetAttrAfterFailover(t *testing.T) {
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
FieldName: utils.Subject,
|
||||
Initial: utils.ANY,
|
||||
Substitute: config.NewRSRParsersMustCompile("1001", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user