---
name: "ct_rpc"
section: "3erl"
platform: "linux"
package: "erlang-manpages"
version: "1:25.2.3+dfsg-1+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/ct_rpc"
---

# ct\_rpc(3erl)

Common Test specific layer on Erlang/OTP rpc.

## NAME

ct\_rpc - Common Test specific layer on Erlang/OTP rpc.

## DESCRIPTION

*Common Test* specific layer on Erlang/OTP *rpc*.

## EXPORTS

**app\_node(App, Candidates) -\> NodeName**\

Types:

App = atom()\
 Candidates = \[NodeName\]\
 NodeName = atom()\

From a set of candidate nodes determines which of them is running the application *App*. If none of the candidate nodes is running *App*, the function makes the test case calling this function to fail. This function is the same as calling *app\_node(App, Candidates, true)*.

**app\_node(App, Candidates, FailOnBadRPC) -\> NodeName**\

Types:

App = atom()\
 Candidates = \[NodeName\]\
 NodeName = atom()\
 FailOnBadRPC = true \| false\

Same as *ct\_rpc:app\_node/2*, except that argument *FailOnBadRPC* determines if the search for a candidate node is to stop if *badrpc* is received at some point.

**app\_node(App, Candidates, FailOnBadRPC, Cookie) -\> NodeName**\

Types:

App = atom()\
 Candidates = \[NodeName\]\
 NodeName = atom()\
 FailOnBadRPC = true \| false\
 Cookie = atom()\

Same as *ct\_rpc:app\_node/2*, except that argument *FailOnBadRPC* determines if the search for a candidate node is to stop if *badrpc* is received at some point.

The cookie on the client node is set to *Cookie* for this *rpc* operation (used to match the server node cookie).

**call(Node, Module, Function, Args) -\> term() \| {badrpc, Reason}**\

Same as *call(Node, Module, Function, Args, infinity)*.

**call(Node, Module, Function, Args, TimeOut) -\> term() \| {badrpc, Reason}**\

Types:

Node = NodeName \| {Fun, FunArgs}\
 Fun = function()\
 FunArgs = term()\
 NodeName = atom()\
 Module = atom()\
 Function = atom()\
 Args = \[term()\]\
 Reason = timeout \| term()\

Evaluates *apply(Module, Function, Args)* on the node *Node*. Returns either whatever *Function* returns, or *{badrpc, Reason}* if the remote procedure call fails. If *Node* is *{Fun, FunArgs}*, applying *Fun* to *FunArgs* is to return a node name.

**call(Node, Module, Function, Args, TimeOut, Cookie) -\> term() \| {badrpc, Reason}**\

Types:

Node = NodeName \| {Fun, FunArgs}\
 Fun = function()\
 FunArgs = term()\
 NodeName = atom()\
 Module = atom()\
 Function = atom()\
 Args = \[term()\]\
 Reason = timeout \| term()\
 Cookie = atom()\

Evaluates *apply(Module, Function, Args)* on the node *Node*. Returns either whatever *Function* returns, or *{badrpc, Reason}* if the remote procedure call fails. If *Node* is *{Fun, FunArgs}*, applying *Fun* to *FunArgs* is to return a node name.

The cookie on the client node is set to *Cookie* for this *rpc* operation (used to match the server node cookie).

**cast(Node, Module, Function, Args) -\> ok**\

Types:

Node = NodeName \| {Fun, FunArgs}\
 Fun = function()\
 FunArgs = term()\
 NodeName = atom()\
 Module = atom()\
 Function = atom()\
 Args = \[term()\]\
 Reason = timeout \| term()\

Evaluates *apply(Module, Function, Args)* on the node *Node*. No response is delivered and the process that makes the call is not suspended until the evaluation is completed as in the case of *call/3,4*. If *Node* is *{Fun, FunArgs}*, applying *Fun* to *FunArgs* is to return a node name.

**cast(Node, Module, Function, Args, Cookie) -\> ok**\

Types:

Node = NodeName \| {Fun, FunArgs}\
 Fun = function()\
 FunArgs = term()\
 NodeName = atom()\
 Module = atom()\
 Function = atom()\
 Args = \[term()\]\
 Reason = timeout \| term()\
 Cookie = atom()\

Evaluates *apply(Module, Function, Args)* on the node *Node*. No response is delivered and the process that makes the call is not suspended until the evaluation is completed as in the case of *call/3,4*. If *Node* is *{Fun, FunArgs}*, applying *Fun* to *FunArgs* is to return a node name.

The cookie on the client node is set to *Cookie* for this *rpc* operation (used to match the server node cookie).
