mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added fixes for alias migration
This commit is contained in:
committed by
Dan Christian Bogos
parent
4aa45461af
commit
6e0e9cf3e3
@@ -173,8 +173,8 @@ func NewFilterRule(rfType, fieldName string, vals []string) (*FilterRule, error)
|
||||
return nil, fmt.Errorf("FieldName is mandatory for Type: %s", rfType)
|
||||
}
|
||||
if len(vals) == 0 && utils.IsSliceMember([]string{MetaString, MetaPrefix, MetaSuffix,
|
||||
MetaTimings, MetaRSR, MetaDestinations, MetaDestinations, MetaLessThan,
|
||||
MetaLessOrEqual, MetaGreaterThan, MetaGreaterOrEqual}, rfType) {
|
||||
MetaTimings, MetaRSR, MetaDestinations, MetaLessThan, MetaLessOrEqual,
|
||||
MetaGreaterThan, MetaGreaterOrEqual}, rfType) {
|
||||
return nil, fmt.Errorf("Values is mandatory for Type: %s", rfType)
|
||||
}
|
||||
rf := &FilterRule{
|
||||
|
||||
@@ -106,7 +106,7 @@ func alias2AtttributeProfile(alias *v1Alias, defaultTenant string) *engine.Attri
|
||||
}
|
||||
}
|
||||
if len(destination) != 0 && destination != utils.META_ANY {
|
||||
out.FilterIDs = append(out.FilterIDs, "*string:Destination:"+destination)
|
||||
out.FilterIDs = append(out.FilterIDs, "*destination:Destination:"+destination)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ func testAlsITMigrateAndMove(t *testing.T) {
|
||||
Context: "*rated",
|
||||
Values: v1AliasValues{
|
||||
&v1AliasValue{
|
||||
DestinationId: "1003",
|
||||
DestinationId: "DST_1003",
|
||||
Pairs: map[string]map[string]string{
|
||||
"Account": map[string]string{
|
||||
"1001": "1002",
|
||||
@@ -158,7 +158,7 @@ func testAlsITMigrateAndMove(t *testing.T) {
|
||||
FilterIDs: []string{
|
||||
"*string:Account:1001",
|
||||
"*string:Subject:call_1001",
|
||||
"*string:Destination:1003",
|
||||
"*destination:Destination:DST_1003",
|
||||
},
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
|
||||
@@ -109,7 +109,7 @@ func TestAlias2AtttributeProfile(t *testing.T) {
|
||||
Context: "*rated",
|
||||
Values: v1AliasValues{
|
||||
&v1AliasValue{
|
||||
DestinationId: "1003",
|
||||
DestinationId: "DST_1003",
|
||||
Pairs: map[string]map[string]string{
|
||||
"Account": map[string]string{
|
||||
"1001": "1002",
|
||||
@@ -131,7 +131,7 @@ func TestAlias2AtttributeProfile(t *testing.T) {
|
||||
Context: "*rated",
|
||||
Values: v1AliasValues{
|
||||
&v1AliasValue{
|
||||
DestinationId: "1003",
|
||||
DestinationId: "DST_1003",
|
||||
Pairs: map[string]map[string]string{
|
||||
"Account": map[string]string{
|
||||
"1001": "1002",
|
||||
@@ -226,7 +226,7 @@ func TestAlias2AtttributeProfile(t *testing.T) {
|
||||
FilterIDs: []string{
|
||||
"*string:Category:*voice",
|
||||
"*string:Account:1001",
|
||||
"*string:Destination:1003",
|
||||
"*destination:Destination:DST_1003",
|
||||
},
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
@@ -253,7 +253,7 @@ func TestAlias2AtttributeProfile(t *testing.T) {
|
||||
FilterIDs: []string{
|
||||
"*string:Account:1001",
|
||||
"*string:Subject:call_1001",
|
||||
"*string:Destination:1003",
|
||||
"*destination:Destination:DST_1003",
|
||||
},
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
|
||||
@@ -153,6 +153,9 @@ func testDspITFlush(t *testing.T) {
|
||||
} else if isEmpty != true {
|
||||
t.Errorf("\nExpecting: true got :%+v", isEmpty)
|
||||
}
|
||||
if err := engine.SetDBVersions(dspMigrator.dmOut.DataManager().DataDB()); err != nil {
|
||||
t.Error("Error ", err.Error())
|
||||
}
|
||||
if err := dspMigrator.dmIN.DataManager().DataDB().Flush(""); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -161,6 +164,9 @@ func testDspITFlush(t *testing.T) {
|
||||
} else if isEmpty != true {
|
||||
t.Errorf("\nExpecting: true got :%+v", isEmpty)
|
||||
}
|
||||
if err := engine.SetDBVersions(dspMigrator.dmIN.DataManager().DataDB()); err != nil {
|
||||
t.Error("Error ", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func testDspITMigrateAndMove(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user