mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated IT tests in dispatchers
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
"db_name": "11", // data_db database name to connect to
|
||||
},
|
||||
|
||||
"stor_db": {
|
||||
"db_password": "CGRateS.org",
|
||||
},
|
||||
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
@@ -33,11 +37,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"stor_db": {
|
||||
"db_password": "CGRateS.org",
|
||||
},
|
||||
|
||||
"attributes": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
"db_name": "12", // data_db database name to connect to
|
||||
},
|
||||
|
||||
"stor_db": {
|
||||
"db_type":"*internal",
|
||||
},
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
@@ -29,11 +32,6 @@
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
"stor_db": {
|
||||
"db_type":"*internal",
|
||||
},
|
||||
|
||||
"attributes": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
95
data/conf/samples/dispatchers/all2_mongo/cgrates.json
Normal file
95
data/conf/samples/dispatchers/all2_mongo/cgrates.json
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
// CGRateS Configuration file
|
||||
//
|
||||
|
||||
|
||||
"general": {
|
||||
"node_id": "ALL2",
|
||||
"log_level": 7
|
||||
},
|
||||
|
||||
|
||||
"listen": {
|
||||
"rpc_json": ":7012",
|
||||
"rpc_gob": ":7013",
|
||||
"http": ":7080",
|
||||
},
|
||||
|
||||
"data_db": {
|
||||
"db_type": "mongo",
|
||||
"db_name": "10",
|
||||
"db_port": 27017,
|
||||
},
|
||||
|
||||
|
||||
"stor_db": {
|
||||
"db_type": "mongo",
|
||||
"db_name": "cgrates",
|
||||
"db_port": 27017,
|
||||
},
|
||||
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
"strategy": "*first",
|
||||
"conns": [{"address": "127.0.0.1:7012", "transport":"*json"}],
|
||||
},
|
||||
},
|
||||
|
||||
"attributes": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"schedulers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"chargers": {
|
||||
"enabled": true,
|
||||
"attributes_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"thresholds": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"suppliers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"stats": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"resources": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"cdrs": {
|
||||
"enabled": true,
|
||||
"chargers_conns":["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"sessions": {
|
||||
"enabled": true,
|
||||
"listen_bijson": ":7014",
|
||||
"suppliers_conns": ["*internal"],
|
||||
"resources_conns": ["*internal"],
|
||||
"attributes_conns": ["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
"cdrs_conns": ["*internal"],
|
||||
"chargers_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"apier": {
|
||||
"caches_conns":["conn1"],
|
||||
"scheduler_conns": ["*internal"],
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
92
data/conf/samples/dispatchers/all2_mysql/cgrates.json
Normal file
92
data/conf/samples/dispatchers/all2_mysql/cgrates.json
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
// CGRateS Configuration file
|
||||
//
|
||||
|
||||
|
||||
"general": {
|
||||
"node_id": "ALL2",
|
||||
"log_level": 7
|
||||
},
|
||||
|
||||
|
||||
"listen": {
|
||||
"rpc_json": ":7012",
|
||||
"rpc_gob": ":7013",
|
||||
"http": ":7080",
|
||||
},
|
||||
|
||||
"data_db": { // database used to store runtime data (eg: accounts, cdr stats)
|
||||
"db_type": "redis", // data_db type: <redis|mongo>
|
||||
"db_port": 6379, // data_db port to reach the database
|
||||
"db_name": "12", // data_db database name to connect to
|
||||
},
|
||||
|
||||
"stor_db": {
|
||||
"db_type":"*internal",
|
||||
},
|
||||
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
"strategy": "*first",
|
||||
"conns": [{"address": "127.0.0.1:7012", "transport":"*json"}],
|
||||
},
|
||||
},
|
||||
|
||||
"attributes": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"schedulers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"chargers": {
|
||||
"enabled": true,
|
||||
"attributes_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"thresholds": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"suppliers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"stats": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"resources": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"cdrs": {
|
||||
"enabled": true,
|
||||
"chargers_conns":["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"sessions": {
|
||||
"enabled": true,
|
||||
"listen_bijson": ":7014",
|
||||
"suppliers_conns": ["*internal"],
|
||||
"resources_conns": ["*internal"],
|
||||
"attributes_conns": ["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
"cdrs_conns": ["*internal"],
|
||||
"chargers_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"apier": {
|
||||
"caches_conns":["conn1"],
|
||||
"scheduler_conns": ["*internal"],
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
98
data/conf/samples/dispatchers/all_mongo/cgrates.json
Normal file
98
data/conf/samples/dispatchers/all_mongo/cgrates.json
Normal file
@@ -0,0 +1,98 @@
|
||||
{
|
||||
// CGRateS Configuration file
|
||||
//
|
||||
|
||||
|
||||
"general": {
|
||||
"node_id": "ALL",
|
||||
"log_level": 7
|
||||
},
|
||||
|
||||
|
||||
"listen": {
|
||||
"rpc_json": ":6012",
|
||||
"rpc_gob": ":6013",
|
||||
"http": ":6080",
|
||||
},
|
||||
|
||||
"data_db": {
|
||||
"db_type": "mongo",
|
||||
"db_name": "11",
|
||||
"db_port": 27017,
|
||||
},
|
||||
|
||||
|
||||
"stor_db": {
|
||||
"db_type": "mongo",
|
||||
"db_name": "cgrates",
|
||||
"db_port": 27017,
|
||||
},
|
||||
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
"strategy": "*first",
|
||||
"conns": [{"address": "127.0.0.1:6012", "transport":"*json"}],
|
||||
},
|
||||
"rplConn": {
|
||||
"strategy": "*broadcast_sync",
|
||||
"conns": [{"address": "127.0.0.1:7012", "transport":"*json"}],
|
||||
}
|
||||
},
|
||||
|
||||
"attributes": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"schedulers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"chargers": {
|
||||
"enabled": true,
|
||||
"attributes_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"thresholds": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"suppliers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"stats": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"resources": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"cdrs": {
|
||||
"enabled": true,
|
||||
"chargers_conns":["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"sessions": {
|
||||
"enabled": true,
|
||||
"listen_bijson": ":6014",
|
||||
"suppliers_conns": ["*internal"],
|
||||
"resources_conns": ["*internal"],
|
||||
"attributes_conns": ["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
"chargers_conns": ["*internal"],
|
||||
"cdrs_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"apier": {
|
||||
"caches_conns":["conn1"],
|
||||
"scheduler_conns": ["*internal"],
|
||||
},
|
||||
|
||||
}
|
||||
99
data/conf/samples/dispatchers/all_mysql/cgrates.json
Normal file
99
data/conf/samples/dispatchers/all_mysql/cgrates.json
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
// CGRateS Configuration file
|
||||
//
|
||||
|
||||
|
||||
"general": {
|
||||
"node_id": "ALL",
|
||||
"log_level": 7
|
||||
},
|
||||
|
||||
|
||||
"listen": {
|
||||
"rpc_json": ":6012",
|
||||
"rpc_gob": ":6013",
|
||||
"http": ":6080",
|
||||
},
|
||||
|
||||
"data_db": { // database used to store runtime data (eg: accounts, cdr stats)
|
||||
"db_type": "redis", // data_db type: <redis|mongo>
|
||||
"db_port": 6379, // data_db port to reach the database
|
||||
"db_name": "11", // data_db database name to connect to
|
||||
},
|
||||
|
||||
"stor_db": {
|
||||
"db_password": "CGRateS.org",
|
||||
},
|
||||
|
||||
|
||||
"rpc_conns": {
|
||||
"conn1": {
|
||||
"strategy": "*first",
|
||||
"conns": [{"address": "127.0.0.1:6012", "transport":"*json"}],
|
||||
},
|
||||
"rplConn": {
|
||||
"strategy": "*broadcast_sync",
|
||||
"conns": [{"address": "127.0.0.1:7012", "transport":"*json"}],
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
"attributes": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"schedulers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"chargers": {
|
||||
"enabled": true,
|
||||
"attributes_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"thresholds": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"suppliers": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"stats": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"resources": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
"cdrs": {
|
||||
"enabled": true,
|
||||
"chargers_conns":["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"sessions": {
|
||||
"enabled": true,
|
||||
"listen_bijson": ":6014",
|
||||
"suppliers_conns": ["*internal"],
|
||||
"resources_conns": ["*internal"],
|
||||
"attributes_conns": ["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
"chargers_conns": ["*internal"],
|
||||
"cdrs_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"apier": {
|
||||
"caches_conns":["conn1"],
|
||||
"scheduler_conns": ["*internal"],
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -46,28 +46,41 @@ var sTestsDspAttr = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspAttributeSTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspAttr, "TestDspAttributeS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspAttr, "TestDspAttributeS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspAttributeS(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspAttributeSMongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspAttr, "TestDspAttributeS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspAttr, "TestDspAttributeS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspAttr, "TestDspAttributeS", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func TestDspAttributeSNoConn(t *testing.T) {
|
||||
if *dbType != utils.MetaSQL {
|
||||
t.SkipNow()
|
||||
}
|
||||
testDsp(t, []func(t *testing.T){
|
||||
testDspAttrPingFailover,
|
||||
testDspAttrPing,
|
||||
testDspAttrPingNoArgDispatcher,
|
||||
}, "TestDspAttributeS", "all", "all2", "dispatchers_no_attributes", "tutorial", "oldtutorial", "dispatchers")
|
||||
}, "TestDspAttributeS", "all_mysql", "all2_mysql", "dispatchers_no_attributes", "tutorial", "oldtutorial", "dispatchers")
|
||||
}
|
||||
|
||||
func testDspAttrPingFailover(t *testing.T) {
|
||||
|
||||
@@ -45,20 +45,30 @@ var sTestsDspChc = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspCacheSv1TMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspChc, "TestDspCacheSv1", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspChc, "TestDspCacheSv1", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspCacheSv1(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspCacheSv1Mongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspChc, "TestDspCacheSv1", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspChc, "TestDspCacheSv1", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspChc, "TestDspCacheSv1", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspChcPing(t *testing.T) {
|
||||
|
||||
@@ -28,52 +28,67 @@ import (
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
var sTestsDspCDRs = []func(t *testing.T){
|
||||
testDspCDRsPing,
|
||||
testDspCDRsProcessEvent,
|
||||
testDspCDRsCountCDR,
|
||||
testDspCDRsGetCDR,
|
||||
testDspCDRsGetCDRWithoutTenant,
|
||||
testDspCDRsProcessCDR,
|
||||
testDspCDRsGetCDR2,
|
||||
testDspCDRsProcessExternalCDR,
|
||||
testDspCDRsGetCDR3,
|
||||
}
|
||||
var (
|
||||
sTestsDspCDRs = []func(t *testing.T){
|
||||
testDspCDRsPing,
|
||||
testDspCDRsProcessEvent,
|
||||
testDspCDRsCountCDR,
|
||||
testDspCDRsGetCDR,
|
||||
testDspCDRsGetCDRWithoutTenant,
|
||||
testDspCDRsProcessCDR,
|
||||
testDspCDRsGetCDR2,
|
||||
testDspCDRsProcessExternalCDR,
|
||||
testDspCDRsGetCDR3,
|
||||
}
|
||||
|
||||
var sTestsDspCDRsWithoutAuth = []func(t *testing.T){
|
||||
testDspCDRsPingNoAuth,
|
||||
testDspCDRsProcessEventNoAuth,
|
||||
testDspCDRsCountCDRNoAuth,
|
||||
testDspCDRsGetCDRNoAuth,
|
||||
testDspCDRsGetCDRNoAuthWithoutTenant,
|
||||
testDspCDRsProcessCDRNoAuth,
|
||||
testDspCDRsGetCDR2NoAuth,
|
||||
testDspCDRsProcessExternalCDRNoAuth,
|
||||
testDspCDRsGetCDR3NoAuth,
|
||||
}
|
||||
sTestsDspCDRsWithoutAuth = []func(t *testing.T){
|
||||
testDspCDRsPingNoAuth,
|
||||
testDspCDRsProcessEventNoAuth,
|
||||
testDspCDRsCountCDRNoAuth,
|
||||
testDspCDRsGetCDRNoAuth,
|
||||
testDspCDRsGetCDRNoAuthWithoutTenant,
|
||||
testDspCDRsProcessCDRNoAuth,
|
||||
testDspCDRsGetCDR2NoAuth,
|
||||
testDspCDRsProcessExternalCDRNoAuth,
|
||||
testDspCDRsGetCDR3NoAuth,
|
||||
}
|
||||
)
|
||||
|
||||
//Test start here
|
||||
func TestDspCDRsITMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspCDRs, "TestDspCDRs", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspCDRs, "TestDspCDRs", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspCDRsIT(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspCDRs, "TestDspCDRs", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func TestDspCDRsITMySQLWithoutAuth(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspCDRsWithoutAuth, "TestDspCDRsWithoutAuth", "all", "all2", "dispatchers_no_attributes", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspCDRsWithoutAuth, "TestDspCDRsWithoutAuth", "all", "all2", "dispatchers_no_attributes", "tutorial", "oldtutorial", "dispatchers")
|
||||
if *dbType != utils.MetaSQL {
|
||||
t.SkipNow()
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspCDRsITMongo(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspCDRs, "TestDspCDRs", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
testDsp(t, sTestsDspCDRsWithoutAuth, "TestDspCDRsWithoutAuth", "all_mysql", "all2_mysql", "dispatchers_no_attributes", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspCDRs, "TestDspCDRs", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
testDsp(t, sTestsDspCDRsWithoutAuth, "TestDspCDRsWithoutAuth", "all_mysql", "all2_mysql", "dispatchers_no_attributes", "tutorial", "oldtutorial", "dispatchers")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,20 +41,30 @@ var sTestsDspCpp = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspChargerSTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspCpp, "TestDspChargerS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspCpp, "TestDspChargerS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspChargerST(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspChargerSMongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspCpp, "TestDspChargerS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspCpp, "TestDspChargerS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspCpp, "TestDspChargerS", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspCppPingFailover(t *testing.T) {
|
||||
|
||||
@@ -33,12 +33,30 @@ var sTestsDspConfig = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspConfigITMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspConfig, "TestDspConfigITMySQL", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspConfig, "TestDspConfigITMySQL", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspConfigIT(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspConfig, "TestDspConfigIT", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspConfigSv1GetJSONSection(t *testing.T) {
|
||||
|
||||
@@ -34,12 +34,30 @@ var sTestsDspGrd = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspGuardianSTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspGrd, "TestDspGuardianS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspGrd, "TestDspGuardianS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspGuardianST(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspGrd, "TestDspGuardianS", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspGrdPing(t *testing.T) {
|
||||
|
||||
@@ -40,7 +40,10 @@ var (
|
||||
allEngine2 *testDispatcher
|
||||
)
|
||||
var (
|
||||
encoding = flag.String("rpc", utils.MetaJSON, "what encoding whould be uused for rpc comunication")
|
||||
waitRater = flag.Int("wait_rater", 100, "Number of miliseconds to wait for rater to start and cache")
|
||||
dataDir = flag.String("data_dir", "/usr/share/cgrates", "CGR data dir path here")
|
||||
encoding = flag.String("rpc", utils.MetaJSON, "what encoding whould be used for rpc comunication")
|
||||
dbType = flag.String("dbtype", utils.MetaInternal, "The type of DataBase (Internal/Mongo/mySql)")
|
||||
)
|
||||
|
||||
func newRPCClient(cfg *config.ListenCfg) (c *rpc.Client, err error) {
|
||||
|
||||
@@ -33,12 +33,30 @@ var sTestsDspRALs = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspRALsITMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspRALs, "TestDspRALsITMySQL", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspRALs, "TestDspRALsITMySQL", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspRALsIT(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspRALs, "TestDspRALsITMySQL", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspRALsPing(t *testing.T) {
|
||||
|
||||
@@ -38,20 +38,30 @@ var sTestsDspRes = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspResourceSITMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspRes, "TestDspResourceS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspRes, "TestDspResourceS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspResourceSIT(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspResourceSITMongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspRes, "TestDspResourceS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspRes, "TestDspResourceS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspRes, "TestDspResourceS", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspResPingFailover(t *testing.T) {
|
||||
|
||||
@@ -37,20 +37,30 @@ var sTestsDspRsp = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspResponderTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspRsp, "TestDspResponder", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspRsp, "TestDspResponder", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspResponder(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspResponderMongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspRsp, "TestDspResponder", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspRsp, "TestDspResponder", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspRsp, "TestDspResponder", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspResponderStatus(t *testing.T) {
|
||||
|
||||
@@ -31,12 +31,31 @@ var sTestsDspSched = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspSchedulerSTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspSched, "TestDspSchedulerSTMySQL", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspSched, "TestDspSchedulerSTMySQL", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
|
||||
func TestDspSchedulerS(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspSched, "TestDspSchedulerSTMySQL", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspSchedPing(t *testing.T) {
|
||||
|
||||
@@ -57,20 +57,31 @@ 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_mysql_gob", "testit", "tutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_mysql", "testit", "tutorial", "dispatchers")
|
||||
func TestDspSessionS(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspSessionSMongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
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")
|
||||
dispDIR += "_gob"
|
||||
config3 += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspSession, "TestDspSessionS", config1, config2, config3, "testit", "tutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspSessionAddBalacne(t *testing.T) {
|
||||
|
||||
@@ -41,20 +41,30 @@ var sTestsDspSts = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspStatSTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspSts, "TestDspStatS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspSts, "TestDspStatS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspStatS(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspStatSMongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspSts, "TestDspStatS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspSts, "TestDspStatS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspSts, "TestDspStatS", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspStsPingFailover(t *testing.T) {
|
||||
|
||||
@@ -42,20 +42,30 @@ var sTestsDspSup = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspSupplierSTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspSup, "TestDspSupplierS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspSup, "TestDspSupplierS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspSupplierS(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspSupplierSMongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspSup, "TestDspSupplierS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspSup, "TestDspSupplierS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspSup, "TestDspSupplierS", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspSupPing(t *testing.T) {
|
||||
|
||||
@@ -41,20 +41,30 @@ var sTestsDspTh = []func(t *testing.T){
|
||||
}
|
||||
|
||||
//Test start here
|
||||
func TestDspThresholdSTMySQL(t *testing.T) {
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspTh, "TestDspThresholdS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspTh, "TestDspThresholdS", "all", "all2", "dispatchers_mysql", "tutorial", "oldtutorial", "dispatchers")
|
||||
func TestDspThresholdS(t *testing.T) {
|
||||
var config1, config2, config3 string
|
||||
switch *dbType {
|
||||
case utils.MetaInternal:
|
||||
t.SkipNow()
|
||||
case utils.MetaSQL:
|
||||
config1 = "all_mysql"
|
||||
config2 = "all2_mysql"
|
||||
config3 = "dispatchers_mysql"
|
||||
case utils.MetaMongo:
|
||||
config1 = "all_mongo"
|
||||
config2 = "all2_mongo"
|
||||
config3 = "dispatchers_mongo"
|
||||
case utils.MetaPostgres:
|
||||
t.SkipNow()
|
||||
default:
|
||||
t.Fatal("Unknown Database type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDspThresholdSMongo(t *testing.T) {
|
||||
dispDIR := "dispatchers"
|
||||
if *encoding == utils.MetaGOB {
|
||||
testDsp(t, sTestsDspTh, "TestDspThresholdS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers_gob")
|
||||
} else {
|
||||
testDsp(t, sTestsDspTh, "TestDspThresholdS", "all", "all2", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
|
||||
dispDIR += "_gob"
|
||||
}
|
||||
testDsp(t, sTestsDspTh, "TestDspThresholdS", config1, config2, config3, "tutorial", "oldtutorial", dispDIR)
|
||||
}
|
||||
|
||||
func testDspThPingFailover(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user