From 1c4211612d5f0a00df3339c84e9053414487e94f Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 29 Jan 2020 18:20:05 +0200 Subject: [PATCH] Updated config tests --- config/config_defaults.go | 1 + config/config_it_test.go | 48 ++++++++++++++++++---------------- config/config_json_test.go | 1 + config/config_test.go | 1 + config/erscfg_test.go | 2 ++ data/conf/cgrates/cgrates.json | 1 + 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/config/config_defaults.go b/config/config_defaults.go index 55621e7b4..fc1621f0f 100755 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -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 }, ], diff --git a/config/config_it_test.go b/config/config_it_test.go index 8755d7e24..e773c26bd 100644 --- a/config/config_it_test.go +++ b/config/config_it_test.go @@ -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, diff --git a/config/config_json_test.go b/config/config_json_test.go index 4aa919f14..2539cf8c3 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -1665,6 +1665,7 @@ func TestDfEventReaderCfg(t *testing.T) { Filters: &[]string{}, Flags: &[]string{}, Fields: &cdrFields, + Cache_dump_fields: &[]*FcTemplateJsonCfg{}, }, }, } diff --git a/config/config_test.go b/config/config_test.go index 9b978a185..29069054a 100755 --- a/config/config_test.go +++ b/config/config_test.go @@ -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{}, }, }, } diff --git a/config/erscfg_test.go b/config/erscfg_test.go index b53b6bdd1..e049fc472 100644 --- a/config/erscfg_test.go +++ b/config/erscfg_test.go @@ -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": [], }, ], } diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index c39a21cf9..792a992b0 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -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 // }, // ],