diff --git a/apier/v1/dispatcher_it_test.go b/apier/v1/dispatcher_it_test.go index 9015ad043..4d90c17af 100644 --- a/apier/v1/dispatcher_it_test.go +++ b/apier/v1/dispatcher_it_test.go @@ -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) diff --git a/apier/v1/filters_it_test.go b/apier/v1/filters_it_test.go index e4ca0a414..41e5236af 100644 --- a/apier/v1/filters_it_test.go +++ b/apier/v1/filters_it_test.go @@ -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) } } diff --git a/apier/v1/resourcesv1_it_test.go b/apier/v1/resourcesv1_it_test.go index 0155b5f5d..7b26375b0 100644 --- a/apier/v1/resourcesv1_it_test.go +++ b/apier/v1/resourcesv1_it_test.go @@ -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) diff --git a/apier/v1/thresholds_it_test.go b/apier/v1/thresholds_it_test.go index e2e02707d..105877c5c 100644 --- a/apier/v1/thresholds_it_test.go +++ b/apier/v1/thresholds_it_test.go @@ -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)