mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated gob integration tests
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
|
||||
"cdrs": {
|
||||
"enabled": true, // start the CDR Server service: <true|false>
|
||||
"chargers_conns":["*conn1"],
|
||||
"chargers_conns":["conn1"],
|
||||
},
|
||||
|
||||
"chargers": {
|
||||
|
||||
73
data/conf/samples/dispatchers/dispatchers_gob/cgrates.json
Executable file
73
data/conf/samples/dispatchers/dispatchers_gob/cgrates.json
Executable file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
|
||||
// Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
|
||||
// Copyright (C) ITsysCOM GmbH
|
||||
//
|
||||
// This file contains the default configuration hardcoded into CGRateS.
|
||||
// This is what you get when you load CGRateS with an empty configuration file.
|
||||
|
||||
"general": {
|
||||
"node_id": "DispatcherS1",
|
||||
"log_level": 7,
|
||||
"reconnects": 1,
|
||||
},
|
||||
|
||||
|
||||
"listen": {
|
||||
"rpc_json": ":2012",
|
||||
"rpc_gob": ":2013",
|
||||
"http": ":2080",
|
||||
},
|
||||
|
||||
"stor_db": {
|
||||
"db_type":"*internal",
|
||||
},
|
||||
|
||||
"cache":{
|
||||
"*dispatcher_routes": {"limit": -1, "ttl": "2s"}
|
||||
},
|
||||
|
||||
|
||||
"attributes": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"scheduler": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"chargers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
"strategy": "*first",
|
||||
"conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}],
|
||||
},
|
||||
},
|
||||
|
||||
"sessions": {
|
||||
"enabled": true,
|
||||
"attributes_conns": ["conn1"],
|
||||
"rals_conns": ["conn1"],
|
||||
"resources_conns": ["conn1"],
|
||||
"chargers_conns": ["conn1"],
|
||||
"listen_bijson": ":3014",
|
||||
},
|
||||
|
||||
"dispatchers":{
|
||||
"enabled": true,
|
||||
"attributes_conns": [
|
||||
{"address": "*internal"},
|
||||
],
|
||||
},
|
||||
|
||||
"apier": {
|
||||
"scheduler_conns": ["*internal"],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
|
||||
// Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
|
||||
// Copyright (C) ITsysCOM GmbH
|
||||
//
|
||||
// This file contains the default configuration hardcoded into CGRateS.
|
||||
// This is what you get when you load CGRateS with an empty configuration file.
|
||||
|
||||
"general": {
|
||||
"node_id": "DispatcherS1",
|
||||
"log_level": 7,
|
||||
"reconnects": 1,
|
||||
},
|
||||
|
||||
|
||||
"listen": {
|
||||
"rpc_json": ":2012",
|
||||
"rpc_gob": ":2013",
|
||||
"http": ":2080",
|
||||
},
|
||||
|
||||
"data_db": {
|
||||
"db_type": "mongo",
|
||||
"db_name": "10",
|
||||
"db_port": 27017,
|
||||
},
|
||||
|
||||
|
||||
"stor_db": {
|
||||
"db_type": "mongo",
|
||||
"db_name": "cgrates",
|
||||
"db_port": 27017,
|
||||
},
|
||||
|
||||
"cache":{
|
||||
"*dispatcher_routes": {"limit": -1, "ttl": "2s"}
|
||||
},
|
||||
|
||||
"scheduler": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"attributes": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
|
||||
"chargers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
"strategy": "*first",
|
||||
"conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}],
|
||||
},
|
||||
},
|
||||
|
||||
"sessions": {
|
||||
"enabled": true,
|
||||
"attributes_conns": ["conn1"],
|
||||
"rals_conns": ["conn1"],
|
||||
"resources_conns": ["conn1"],
|
||||
"chargers_conns": ["conn1"],
|
||||
"listen_bijson": ":3014",
|
||||
},
|
||||
|
||||
|
||||
"dispatchers":{
|
||||
"enabled": true,
|
||||
"attributes_conns": [
|
||||
{"address": "*internal"},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
"apier": {
|
||||
"scheduler_conns": ["*internal"],
|
||||
},
|
||||
}
|
||||
@@ -14,6 +14,13 @@
|
||||
"http": ":2080", // HTTP listening address
|
||||
},
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
"strategy": "*first",
|
||||
"conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}],
|
||||
},
|
||||
},
|
||||
|
||||
"stor_db": { // database used to store offline tariff plans and CDRs
|
||||
"db_password": "CGRateS.org", // password to use when connecting to stordb
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ cgrates.org,ATTR_API_RSP_AUTH,*auth,*string:~*req.APIKey:rsp12345,,,APIMethods,*
|
||||
cgrates.org,ATTR_API_CHC_AUTH,*auth,*string:~*req.APIKey:chc12345,,,APIMethods,*constant,CacheSv1.Ping&CacheSv1.GetCacheStats&CacheSv1.LoadCache&CacheSv1.PrecacheStatus&CacheSv1.GetItemIDs&CacheSv1.HasItem&CacheSv1.GetItemExpiryTime&CacheSv1.ReloadCache&CacheSv1.RemoveItem&CacheSv1.FlushCache&CacheSv1.Clear,false,20
|
||||
cgrates.org,ATTR_API_GRD_AUTH,*auth,*string:~*req.APIKey:grd12345,,,APIMethods,*constant,GuardianSv1.Ping&GuardianSv1.RemoteLock&GuardianSv1.RemoteUnlock,false,20
|
||||
cgrates.org,ATTR_API_SCHD_AUTH,*auth,*string:~*req.APIKey:sched12345,,,APIMethods,*constant,SchedulerSv1.Ping,false,20
|
||||
cgrates.org,ATTR_API_CDRS_AUTH,*auth,*string:~*req.APIKey:cdrs12345,,,APIMethods,*constant,CDRsV1.Ping&CDRsV1.ProcessEvent&CDRsV1.GetCDRs&CDRsV1.CountCDRs&CDRsV1.ProcessCDR&CDRsV1.ProcessExternalCDR,false,20
|
||||
cgrates.org,ATTR_API_CDRS_AUTH,*auth,*string:~*req.APIKey:cdrs12345,,,APIMethods,*constant,CDRsV1.Ping&CDRsV1.ProcessEvent&CDRsV1.GetCDRs&CDRsV1.GetCDRsCount&CDRsV1.ProcessCDR&CDRsV1.ProcessExternalCDR,false,20
|
||||
cgrates.org,ATTR_API_DSP_AUTH,*auth,*string:~*req.APIKey:dsp12345,,,APIMethods,*constant,DispatcherSv1.Ping&DispatcherSv1.GetProfileForEvent,false,20
|
||||
cgrates.org,ATTR_API_PSE_AUTH,*auth,*string:~*req.APIKey:pse12345,,,APIMethods,*constant,SessionSv1.Ping&SessionSv1.AuthorizeEvent&SessionSv1.AuthorizeEventWithDigest&SessionSv1.InitiateSession&SessionSv1.InitiateSessionWithDigest&SessionSv1.UpdateSession&SessionSv1.SyncSessions&SessionSv1.TerminateSession&SessionSv1.ProcessCDR&SessionSv1.ProcessMessage&SessionSv1.GetActiveSessions&SessionSv1.GetActiveSessionsCount&SessionSv1.ForceDisconnect&SessionSv1.GetPassiveSessions&SessionSv1.GetPassiveSessionsCount&SessionSv1.ReplicateSessions&SessionSv1.SetPassiveSession&AttributeSv1.ProcessEvent&Responder.Debit&ResourceSv1.AllocateResources&ChargerSv1.ProcessEvent&Responder.MaxDebit,false,20
|
||||
cgrates.org,ATTR_API_CFG_AUTH,*auth,*string:~*req.APIKey:cfg12345,,,APIMethods,*constant,ConfigSv1.GetJSONSection&ConfigSv1.ReloadConfig,false,20
|
||||
|
||||
|
@@ -60,7 +60,7 @@ var sTestsDspSession = []func(t *testing.T){
|
||||
//Test start here
|
||||
func TestDspSessionSTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers", "testit", "tutorial", "dispatchers_gob")
|
||||
testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_gob", "testit", "tutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers", "testit", "tutorial", "dispatchers")
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func TestDspSessionSTMySQL(t *testing.T) {
|
||||
|
||||
func TestDspSessionSMongo(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_mongo", "testit", "tutorial", "dispatchers_gob")
|
||||
testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_mongo_gob", "testit", "tutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_mongo", "testit", "tutorial", "dispatchers")
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ func (cM *ConnManager) getConn(connID string, biRPCClient rpcclient.ClientConnec
|
||||
func (cM *ConnManager) Call(connIDs []string, biRPCClient rpcclient.ClientConnector,
|
||||
method string, arg, reply interface{}) (err error) {
|
||||
if len(connIDs) == 0 {
|
||||
return utils.ErrMandatoryIeMissing
|
||||
return utils.NewErrMandatoryIeMissing("connIDs")
|
||||
}
|
||||
var conn rpcclient.ClientConnector
|
||||
for _, connID := range connIDs {
|
||||
|
||||
@@ -68,7 +68,7 @@ func testbrodcastItLoadConfig(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
brodcastInternalCfgPath = path.Join(*dataDir, "conf", "samples", "tutinternal")
|
||||
if brodcastInternalCfg, err = config.NewCGRConfigFromPath(brodcastCfgPath); err != nil {
|
||||
if brodcastInternalCfg, err = config.NewCGRConfigFromPath(brodcastInternalCfgPath); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,6 @@ func testV1CDRsProcessEventAttrS(t *testing.T) {
|
||||
}
|
||||
|
||||
func testV1CDRsProcessEventChrgS(t *testing.T) {
|
||||
|
||||
argsEv := &engine.ArgV1ProcessEvent{
|
||||
Flags: []string{utils.MetaChargers, "*attributes:false"},
|
||||
CGREvent: utils.CGREvent{
|
||||
|
||||
Reference in New Issue
Block a user