Updated config tests

This commit is contained in:
Trial97
2020-01-29 18:20:05 +02:00
committed by Dan Christian Bogos
parent c5e40efb9d
commit 1c4211612d
6 changed files with 31 additions and 23 deletions

View File

@@ -330,6 +330,7 @@ const CGRATES_CFG_JSON = `
{"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true},
{"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.13", "mandatory": true},
],
"cache_dump_fields": [],
"continue": false, // continue to the next template if executed
},
],

View File

@@ -446,29 +446,31 @@ func testCGRConfigReloadERs(t *testing.T) {
SessionSConns: []string{utils.MetaLocalHost},
Readers: []*EventReaderCfg{
&EventReaderCfg{
ID: utils.MetaDefault,
Type: utils.MetaFileCSV,
FieldSep: ",",
RunDelay: 0,
ConcurrentReqs: 1024,
SourcePath: "/var/spool/cgrates/cdrc/in",
ProcessedPath: "/var/spool/cgrates/cdrc/out",
Filters: []string{},
Flags: flagsDefault,
Fields: content,
XmlRootPath: utils.HierarchyPath{utils.EmptyString},
ID: utils.MetaDefault,
Type: utils.MetaFileCSV,
FieldSep: ",",
RunDelay: 0,
ConcurrentReqs: 1024,
SourcePath: "/var/spool/cgrates/cdrc/in",
ProcessedPath: "/var/spool/cgrates/cdrc/out",
Filters: []string{},
Flags: flagsDefault,
Fields: content,
CacheDumpFields: []*FCTemplate{},
XmlRootPath: utils.HierarchyPath{utils.EmptyString},
},
&EventReaderCfg{
ID: "file_reader1",
Type: utils.MetaFileCSV,
FieldSep: ",",
RunDelay: -1,
ConcurrentReqs: 1024,
SourcePath: "/tmp/ers/in",
ProcessedPath: "/tmp/ers/out",
Flags: flags,
Fields: content,
XmlRootPath: utils.HierarchyPath{utils.EmptyString},
ID: "file_reader1",
Type: utils.MetaFileCSV,
FieldSep: ",",
RunDelay: -1,
ConcurrentReqs: 1024,
SourcePath: "/tmp/ers/in",
ProcessedPath: "/tmp/ers/out",
Flags: flags,
Fields: content,
CacheDumpFields: []*FCTemplate{},
XmlRootPath: utils.HierarchyPath{utils.EmptyString},
},
},
}
@@ -832,7 +834,7 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) {
map[string]interface{}{
"PartialCacheExpiryAction": "",
"PartialRecordCache": 0,
"CacheDumpFields": nil,
"CacheDumpFields": []interface{}{},
"ConcurrentReqs": 1024,
"Fields": content,
"FieldSep": ",",
@@ -849,7 +851,7 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) {
"XmlRootPath": []interface{}{utils.EmptyString},
},
map[string]interface{}{
"CacheDumpFields": nil,
"CacheDumpFields": []interface{}{},
"ConcurrentReqs": 1024,
"FieldSep": ",",
"Filters": nil,

View File

@@ -1665,6 +1665,7 @@ func TestDfEventReaderCfg(t *testing.T) {
Filters: &[]string{},
Flags: &[]string{},
Fields: &cdrFields,
Cache_dump_fields: &[]*FcTemplateJsonCfg{},
},
},
}

View File

@@ -1705,6 +1705,7 @@ func TestCgrCdfEventReader(t *testing.T) {
{Tag: "Usage", Path: "Usage", Type: utils.MetaVariable,
Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP), Mandatory: true},
},
CacheDumpFields: []*FCTemplate{},
},
},
}

View File

@@ -135,6 +135,7 @@ func TestEventReaderLoadFromJSON(t *testing.T) {
{Tag: "Usage", Path: "Usage", Type: utils.MetaVariable,
Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP), Mandatory: true},
},
CacheDumpFields: make([]*FCTemplate, 0),
},
&EventReaderCfg{
ID: "file_reader1",
@@ -189,6 +190,7 @@ func TestEventReaderLoadFromJSON(t *testing.T) {
"type": "*file_csv",
"source_path": "/tmp/ers/in",
"processed_path": "/tmp/ers/out",
"cache_dump_fields": [],
},
],
}

View File

@@ -310,6 +310,7 @@
// {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true},
// {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.13", "mandatory": true},
// ],
// "cache_dump_fields": [],
// "continue": false, // continue to the next template if executed
// },
// ],