Updated sessions integration tests

This commit is contained in:
Trial97
2019-12-03 13:46:59 +02:00
parent 0cce0e371b
commit ab8ac753cb
7 changed files with 226 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
{
// CGRateS Configuration file
//
// Used for cgradmin
// Starts rater, scheduler
"general": {
"log_level": 7,
},
"listen": {
"rpc_json": ":2012", // RPC JSON listening address
"rpc_gob": ":2013", // RPC GOB listening address
"http": ":2080", // HTTP listening address
},
"stor_db": { // database used to store offline tariff plans and CDRs
"db_password": "CGRateS.org", // password to use when connecting to stordb
},
"rals": {
"enabled": true, // enable Rater service: <true|false>
"max_computed_usage": { // do not compute usage higher than this, prevents memory overload
"*any": "189h",
"*voice": "72h",
"*data": "102400",
"*sms": "10000"
},
},
"scheduler": {
"enabled": true, // start Scheduler service: <true|false>
},
"cdrs": {
"enabled": true, // start the CDR Server service: <true|false>
},
"resources": {
"enabled": true,
},
"attributes": {
"enabled": true,
},
"suppliers": {
"enabled": true,
},
"chargers": {
"enabled": true,
"attributes_conns": [
{"address": "*internal"}
],
},
"sessions": {
"enabled": true,
"session_ttl": "50ms",
"rals_conns": [
{"address": "127.0.0.1:2013", "transport": "*gob"}
],
"cdrs_conns": [
{"address": "127.0.0.1:2013", "transport": "*gob"} // address where to reach CDR Server, empty to disable CDR capturing <*internal|x.y.z.y:1234>
],
"chargers_conns": [
{"address": "*internal"}
],
},
"apier": {
"scheduler_conns": [ // connections to SchedulerS for reloads
{"address": "*internal"},
],
},
}

View File

@@ -0,0 +1,65 @@
{
// Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
// Copyright (C) ITsysCOM GmbH
"general": {
"log_level": 7,
"node_id":"MasterReplication",
},
"listen": {
"rpc_json": "127.0.0.1:2012",
"rpc_gob": "127.0.0.1:2013",
"http": "127.0.0.1:2080",
},
"stor_db": { // database used to store offline tariff plans and CDRs
"db_password": "CGRateS.org", // password to use when connecting to stordb
},
"rals": {
"enabled": true,
},
"scheduler": {
"enabled": true,
},
"cdrs": {
"enabled": true,
},
"attributes": {
"enabled": true,
},
"chargers": {
"enabled": true,
"attributes_conns": [
{"address": "*internal"}
],
},
"sessions": {
"enabled": true,
"replication_conns": [
{"address": "127.0.0.1:22013", "transport": "*gob"},
],
"rals_conns": [
{"address": "*internal"}
],
"cdrs_conns": [
{"address": "*internal"}
],
"chargers_conns": [
{"address": "*internal"}
],
},
"apier": {
"scheduler_conns": [ // connections to SchedulerS for reloads
{"address": "*internal"},
],
},
}

View File

@@ -0,0 +1,66 @@
{
// Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
// Copyright (C) ITsysCOM GmbH
"general": {
"log_level": 7,
"node_id":"SlaveReplication",
},
"listen": {
"rpc_json": "127.0.0.1:22012", // RPC JSON listening address
"rpc_gob": "127.0.0.1:22013", // RPC GOB listening address
"http": "127.0.0.1:22080", // HTTP listening address
},
"stor_db": { // database used to store offline tariff plans and CDRs
"db_password": "CGRateS.org", // password to use when connecting to stordb
},
"rals": {
"enabled": true, // enable Rater service: <true|false>
},
"cdrs": {
"enabled": true, // start the CDR Server service: <true|false>
},
"scheduler": {
"enabled": true,
},
"attributes": {
"enabled": true,
},
"chargers": {
"enabled": true,
"attributes_conns": [
{"address": "*internal"}
],
},
"sessions": {
"enabled": true, // starts SessionManager service: <true|false>
"listen_bijson": "127.0.0.1:22014", // address where to listen for bidirectional JSON-RPC requests
"replication_conns": [
{"address": "127.0.0.1:2013", "transport": "*gob"},
],
"rals_conns": [
{"address": "127.0.0.1:22013", "transport": "*gob"},
],
"cdrs_conns": [
{"address": "*internal"}
],
"chargers_conns": [
{"address": "*internal"}
],
},
"apier": {
"scheduler_conns": [ // connections to SchedulerS for reloads
{"address": "*internal"},
],
},
}

View File

@@ -36,6 +36,9 @@ var sDataRPC *rpc.Client
func TestSessionsDataInitCfg(t *testing.T) {
dataCfgPath = path.Join(*dataDir, "conf", "samples", "smg")
if *encoding == utils.MetaGOB {
dataCfgPath = path.Join(*dataDir, "conf", "samples", "gob", "smg")
}
// Init config first
var err error
dataCfg, err = config.NewCGRConfigFromPath(dataCfgPath)

View File

@@ -37,6 +37,9 @@ var sItRPC *rpc.Client
func TestSessionsItInitCfg(t *testing.T) {
sItCfgPath = path.Join(*dataDir, "conf", "samples", "smg")
if *encoding == utils.MetaGOB {
dataCfgPath = path.Join(*dataDir, "conf", "samples", "gob", "smg")
}
// Init config first
var err error
sItCfg, err = config.NewCGRConfigFromPath(sItCfgPath)

View File

@@ -37,12 +37,18 @@ var smgRplcMstrRPC, smgRplcSlvRPC *rpc.Client
func TestSessionSRplInitCfg(t *testing.T) {
smgRplcMasterCfgPath = path.Join(*dataDir, "conf", "samples", "smgreplcmaster")
if *encoding == utils.MetaGOB {
smgRplcMasterCfgPath = path.Join(*dataDir, "conf", "samples", "gob", "smgreplcmaster")
}
if smgRplcMasterCfg, err = config.NewCGRConfigFromPath(smgRplcMasterCfgPath); err != nil {
t.Fatal(err)
}
smgRplcMasterCfg.DataFolderPath = *dataDir // Share DataFolderPath through config towards StoreDb for Flush()
config.SetCgrConfig(smgRplcMasterCfg)
smgRplcSlaveCfgPath = path.Join(*dataDir, "conf", "samples", "smgreplcslave")
if *encoding == utils.MetaGOB {
smgRplcSlaveCfgPath = path.Join(*dataDir, "conf", "samples", "gob", "smgreplcslave")
}
if smgRplcSlaveCfg, err = config.NewCGRConfigFromPath(smgRplcSlaveCfgPath); err != nil {
t.Fatal(err)
}

View File

@@ -57,6 +57,9 @@ func newRPCClient(cfg *config.ListenCfg) (c *rpc.Client, err error) {
func TestSessionsVoiceInitCfg(t *testing.T) {
voiceCfgPath = path.Join(*dataDir, "conf", "samples", "smg")
if *encoding == utils.MetaGOB {
dataCfgPath = path.Join(*dataDir, "conf", "samples", "gob", "smg")
}
// Init config first
var err error
voiceCfg, err = config.NewCGRConfigFromPath(voiceCfgPath)