ct_slave(3erl)
π ct_slave β the Erlang module that's literally the blueprint for starting and stopping nodes π
okay so bestie, this is the manual page for ct_slave from the Erlang Module Definition collectionβit's part of the Common Test framework, and it's giving main character energy for Large-Scale Testing. no cap, this is the module that the Common Test Master uses to spin up and tear down those "slave" nodes. it's the default callback module for the {init, node_start} term in the Test Specification. periodt. π
β¨ NAME β¨
ct_slave β Common Test framework functions for starting and stopping nodes for Large-Scale Testing. that's the whole vibe. π¦
πΈ DESCRIPTION πΈ
so like, this is the Common Test framework's functions for starting and stopping nodes for Large-Scale Testing. yes, that's the same sentence twice, and yes, it's iconic. the module exports functions used by the Common Test Master to start and stop "slave" nodes. and it's the default callback module for the {init, node_start} term in the Test Specification. iykyk. π«Ά
π EXPORTS π
π start(Node) -> Result
Types:
Node = atom()
Result = {ok, NodeName} | {error, Reason, NodeName}
Reason = already_started | started_not_connected |
boot_timeout | init_timeout | startup_timeout | not_alive
NodeName = atom()
starts an Erlang node with the name Node on the local host. that's it, that's the function.
see also ct_slave:start/3. π
π¦ start(HostOrNode, NodeOrOpts) -> Result
Types:
HostOrNode = atom()
NodeOrOpts = atom() | list()
Result = {ok, NodeName} | {error, Reason, NodeName}
Reason = already_started | started_not_connected |
boot_timeout | init_timeout | startup_timeout | not_alive
NodeName = atom()
starts an Erlang node with default options on a specified host, or on the local host with specified options. that is, the call is interpreted as start(Host, Node) when the second argument is atom-valued and start(Node, Opts) when it is list-valued. it's like a vibe check on the second argument, and it slays either way. β¨
see also ct_slave:start/3. π
π start(Host, Node, Opts) -> Result
Types:
Node = atom()
Host = atom()
Opts = [OptTuples]
OptTuples = {username, Username} | {password, Password} |
{boot_timeout, BootTimeout} | {init_timeout, InitTimeout} |
{startup_timeout, StartupTimeout} | {startup_functions,
StartupFunctions} | {monitor_master, Monitor} | {kill_if_fail,
KillIfFail} | {erl_flags, ErlangFlags} | {env, [{EnvVar,
Value}]}
Username = string()
Password = string()
BootTimeout = integer()
InitTimeout = integer()
StartupTimeout = integer()
StartupFunctions = [StartupFunctionSpec]
StartupFunctionSpec = {Module, Function, Arguments}
Module = atom()
Function = atom()
Arguments = [term]
Monitor = bool()
KillIfFail = bool()
ErlangFlags = string()
EnvVar = string()
Value = string()
Result = {ok, NodeName} | {error, Reason, NodeName}
Reason = already_started | started_not_connected |
boot_timeout | init_timeout | startup_timeout | not_alive
NodeName = atom()
starts an Erlang node with name Node on host Host as specified by the combination of options in Opts. this is the big one, the main event, the moment. π
options Username and Password are used to log on to the remote host Host. Username, if omitted, defaults to the current username. Password is empty by default. no stress. π
a list of functions specified in option Startup are executed after startup of the node. notice that all used modules are to be present in the code path on Host. that's a real caveat, bestie, don't skip it. β
the time-outs are applied as follows:
BootTimeout: the time to start the Erlang node, in seconds. defaults to3seconds. if the node is not pingable within this time, the result{error, boot_timeout, NodeName}is returned. β°InitTimeout: the time to wait for the node until it calls the internal callback function informing master about a successful startup. defaults to1second. in case of a timed out message, the result{error, init_timeout, NodeName}is returned. πStartupTimeout: the time to wait until the node stops to runStartupFunctions. defaults to1second. if this time-out occurs, the result{error, startup_timeout, NodeName}is returned. π₯
Options:
monitor_masterβ specifies if the slave node is to be stopped if the master node stops. defaults tofalse. πkill_if_failβ specifies if the slave node is to be killed if a time-out occurs during initialization or startup. defaults totrue. notice that the node can also be still alive it the boot time-out occurred, but it is not killed in this case. (yes, "it the boot time-out" is in the original, we don't fix, we report. π)erl_flagsβ specifies which flags are added to the parameters of the executableerl. π οΈenvβ specifies a list of environment variables that will extend the environment. π
Special return values:
{error, already_started, NodeName}if the node with the specified name is already started on a specified host. π{error, started_not_connected, NodeName}if the node is started, but not connected to the master node. π{error, not_alive, NodeName}if the node on whichct_slave:start/3is called, is not alive. notice thatNodeNameis the name of the current node in this case. β οΈ
π stop(Node) -> Result
Types:
Node = atom()
Result = {ok, NodeName} | {error, Reason, NodeName}
Reason = not_started | not_connected | stop_timeout
stops the running Erlang node with name Node on the local host. bye bestie. π
πΈ stop(Host, Node) -> Result
Types:
Host = atom()
Node = atom()
Result = {ok, NodeName} | {error, Reason, NodeName}
Reason = not_started | not_connected | stop_timeout
NodeName = atom()
stops the running Erlang node with name Node on host Host. that's the whole thing, no cap. π
ngl, this module is lowkey iconic for anyone doing Large-Scale Testing with Common Test. the timeouts are short by default (3s, 1s, 1s) so likeβ¦ pay attention, bestie. andkill_if_faildefaults totrue, so the node gets killed on init/startup timeoutsβbut not on boot timeouts, and that's a real detail you should not skip. π₯
anyway, that's the whole page, bestie. this was Ericsson AB's common_test version 1.24.0.1, and the page itself is ct_slave(3erl). slay. π
β¨π
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms