Analyzer it test

This commit is contained in:
porosnicuadrian
2022-04-19 17:04:26 +03:00
committed by Dan Christian Bogos
parent 9568a45f68
commit 540dead69c
2 changed files with 6 additions and 28 deletions

View File

@@ -24,6 +24,7 @@ package analyzers
import (
"errors"
"flag"
"fmt"
"net"
"net/rpc"
"net/rpc/jsonrpc"
@@ -69,7 +70,7 @@ var (
var (
dataDir = flag.String("data_dir", "/usr/share/cgrates", "CGR data dir path here")
waitRater = flag.Int("wait_rater", 100, "Number of miliseconds to wait for rater to start and cache")
encoding = flag.String("rpc", utils.MetaJSON, "what encoding whould be uused for rpc comunication")
encoding = flag.String("rpc", utils.MetaJSON, "what encoding whould be used for rpc comunication")
)
func newRPCClient(cfg *config.ListenCfg) (c *rpc.Client, err error) {
@@ -138,13 +139,7 @@ func testAnalyzerSRPCConn(t *testing.T) {
func testAnalyzerSLoadTarrifPlans(t *testing.T) {
var reply string
// attrs := &utils.AttrLoadTpFromFolder{FolderPath: path.Join(*dataDir, "tariffplans", "tutorial")}
// if err := anzRPC.Call(utils.APIerSv1LoadTariffPlanFromFolder, attrs, &reply); err != nil {
// t.Error(err)
// } else if reply != utils.OK {
// t.Error("Unexpected reply returned", reply)
// }
// time.Sleep(100 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
if err := anzRPC.Call(utils.LoaderSv1Run, &loaders.ArgsProcessFolder{
APIOpts: map[string]interface{}{utils.MetaCache: utils.MetaReload},
}, &reply); err != nil {
@@ -244,7 +239,7 @@ func testAnalyzerSV1Search(t *testing.T) {
} else if len(result) != 1 {
t.Errorf("Unexpected result: %s", utils.ToJSON(result))
}
// fmt.Println(utils.ToJSON(result))
fmt.Println(utils.ToJSON(result))
}
func testAnalyzerSV1Search2(t *testing.T) {

View File

@@ -21,22 +21,6 @@
"db_port": 27017,
},
"rals": {
"enabled": true,
"thresholds_conns": ["*internal"],
"max_increments":3000000,
},
"schedulers": {
"enabled": true,
"cdrs_conns": ["*localhost"],
},
"cdrs": {
"enabled": true,
},
@@ -72,7 +56,7 @@
"enabled": true,
"stats_conns": ["*localhost"],
"resources_conns": ["*localhost"],
"rals_conns": ["*internal"],
"rates_conns": ["*internal"],
},
@@ -86,7 +70,7 @@
"sessions": {
"enabled": true,
"rals_conns": ["*internal"],
"rates_conns": ["*internal"],
"cdrs_conns": ["*internal"],
"chargers_conns": ["*internal"],
},
@@ -103,7 +87,6 @@
"admins": {
"enabled": true,
"scheduler_conns": ["*internal"],
},