mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fixed integration tests in apier
This commit is contained in:
committed by
Dan Christian Bogos
parent
7b1c42ebaa
commit
7a954d2733
@@ -147,7 +147,9 @@ func testDispatcherSRPCConn(t *testing.T) {
|
||||
}
|
||||
|
||||
func testDispatcherStartCPUProfiling(t *testing.T) {
|
||||
argPath := "/tmp/cpu.prof"
|
||||
argPath := utils.DirectoryArgs{
|
||||
DirPath: "/tmp",
|
||||
}
|
||||
var reply string
|
||||
if err := dispatcherRPC.Call(utils.CoreSv1StartCPUProfiling,
|
||||
argPath, &reply); err != nil {
|
||||
@@ -401,7 +403,7 @@ func testV1DispatcherStopCPUProfiling(t *testing.T) {
|
||||
argPath := "/tmp/cpu.prof"
|
||||
var reply string
|
||||
if err := dispatcherRPC.Call(utils.CoreSv1StopCPUProfiling,
|
||||
utils.EmptyString, &reply); err != nil {
|
||||
new(utils.DirectoryArgs), &reply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
file, err := os.Open(argPath)
|
||||
|
||||
@@ -113,7 +113,9 @@ func testFilterRpcConn(t *testing.T) {
|
||||
}
|
||||
|
||||
func testFilterStartCPUProfiling(t *testing.T) {
|
||||
argPath := "/tmp/cpu.prof"
|
||||
argPath := &utils.DirectoryArgs{
|
||||
DirPath: "/tmp",
|
||||
}
|
||||
var reply string
|
||||
if err := filterRPC.Call(utils.CoreSv1StartCPUProfiling,
|
||||
argPath, &reply); err != nil {
|
||||
@@ -288,13 +290,12 @@ func testFilterRemoveFilterWithoutTenant(t *testing.T) {
|
||||
}
|
||||
|
||||
func testFilterStopCPUProfiling(t *testing.T) {
|
||||
argPath := "/tmp/cpu.prof"
|
||||
var reply string
|
||||
if err := filterRPC.Call(utils.CoreSv1StopCPUProfiling,
|
||||
utils.EmptyString, &reply); err != nil {
|
||||
new(utils.DirectoryArgs), &reply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
file, err := os.Open(argPath)
|
||||
file, err := os.Open("/tmp/cpu.prof")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -308,7 +309,7 @@ func testFilterStopCPUProfiling(t *testing.T) {
|
||||
t.Errorf("Size of CPUProfile %v is lower that expected", size.Size())
|
||||
}
|
||||
//after we checked that CPUProfile was made successfully, can delete it
|
||||
if err := os.Remove(argPath); err != nil {
|
||||
if err := os.Remove("/tmp/cpu.prof"); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,9 @@ func testV1RsRpcConn(t *testing.T) {
|
||||
}
|
||||
|
||||
func testV1ResourceStartCPUProfiling(t *testing.T) {
|
||||
argPath := "/tmp/cpu.prof"
|
||||
argPath := &utils.DirectoryArgs{
|
||||
DirPath: "/tmp",
|
||||
}
|
||||
var reply string
|
||||
if err := rlsV1Rpc.Call(utils.CoreSv1StartCPUProfiling,
|
||||
argPath, &reply); err != nil {
|
||||
@@ -1107,7 +1109,7 @@ func testV1ResourceStopCPUProfiling(t *testing.T) {
|
||||
argPath := "/tmp/cpu.prof"
|
||||
var reply string
|
||||
if err := rlsV1Rpc.Call(utils.CoreSv1StopCPUProfiling,
|
||||
utils.EmptyString, &reply); err != nil {
|
||||
new(utils.DirectoryArgs), &reply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
file, err := os.Open(argPath)
|
||||
|
||||
@@ -307,7 +307,9 @@ func testV1TSRpcConn(t *testing.T) {
|
||||
}
|
||||
|
||||
func testV1ThresholdStartCPUProfiling(t *testing.T) {
|
||||
argPath := "/tmp/cpu.prof"
|
||||
argPath := &utils.DirectoryArgs{
|
||||
DirPath: "/tmp",
|
||||
}
|
||||
var reply string
|
||||
if err := tSv1Rpc.Call(utils.CoreSv1StartCPUProfiling,
|
||||
argPath, &reply); err != nil {
|
||||
@@ -1007,7 +1009,7 @@ func testV1ThresholdStopCPUProfiling(t *testing.T) {
|
||||
argPath := "/tmp/cpu.prof"
|
||||
var reply string
|
||||
if err := tSv1Rpc.Call(utils.CoreSv1StopCPUProfiling,
|
||||
utils.EmptyString, &reply); err != nil {
|
||||
new(utils.DirectoryArgs), &reply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
file, err := os.Open(argPath)
|
||||
|
||||
Reference in New Issue
Block a user