ct_slave(3)
π ct_slave β Erlang Module Definition, section 3 of the manual π
okay bestie, gather round, because this one is literally the group chat's designated Node Wrangler β¨. It's an Erlang module, it lives in manual section 3, and it's about starting and stopping nodes. Let's get into it. π«Ά
πΈ NAME πΈ
ct_slave β Common Test framework functions for starting and stopping nodes for Large-Scale Testing.
Like. The name says "slave" and the whole job is yeeting nodes into existence and then lovingly shutting them down. Large-Scale Testing energy. π
π¦ DESCRIPTION π¦
So this module exports the functions that the Common Test Master uses to start and stop "slave" nodes. That's the whole vibe. π
It is the default callback module for the {init, node_start} term in the Test Specification. Iconic default behaviour, no notes. π
π DATA TYPES π
start_options()
start_options() ::
[{username, string()} |
{password, string()} |
{boot_timeout, non_neg_integer()} |
{init_timeout, non_neg_integer()} |
{startup_timeout, non_neg_integer()} |
{startup_functions, [mfa()]} |
{monitor_master, boolean()} |
{kill_if_fail, boolean()} |
{erl_flags, string()} |
{env,
[{Name :: os:env_var_name(),
Val :: os:env_var_value() | false}]} |
{ssh_port, inet:port_number()} |
{ssh_opts, ssh:client_options()}].
Options used for starting a ct_slave node. That's your starter pack, bestie. β¨
stop_options()
stop_options() :: [{stop_timeout, non_neg_integer()}].
Options used for stopping a ct_slave node. Short and sweet. Farewell options. π₯Ί
β¨ FUNCTIONS β¨
start(Node) -> ok | {error, Reason, Node}
start(Node) -> ok | {error, Reason, Node}
when Node :: node(), Reason :: atom().
π¨ Deprecated:ct_slave:start/1is deprecated; use?CT_PEER(), or the'peer'module instead
Starts an Erlang node with name Node on the local host. Just the one node, right here at home. π
See also ct_slave:start/3.
start(HostOrNode, NodeOrOpts) -> ok | {error, Reason, Node}
start(HostOrNode, NodeOrOpts) -> ok | {error, Reason, Node}
when
HostOrNode :: atom() | node(),
NodeOrOpts :: node() | start_options(),
Reason :: atom(),
Node :: node().
π¨ Deprecated:ct_slave:start/2is deprecated; use?CT_PEER(), or the'peer'module instead
Starts an Erlang node with default options on a specified host, or on the local host with specified options. The way this works is a lil shape-shifter situation: the call is interpreted as start(Host, Node) when the second argument is atom-valued, and as start(Node, Opts) when it is list-valued. π Atom? node on that host. List? options, right here. It's giving duality. π¦
See also ct_slave:start/3.
start(Host, Node, Opts) -> ok | {error, Reason, Node}
start(Host, Node, Opts) -> ok | {error, Reason, Node}
when
Host :: atom(),
Node :: node(),
Opts :: start_options(),
Reason :: atom().
π¨ Deprecated:ct_slave:start/3is deprecated; use?CT_PEER(), or the'peer'module instead
Starts an Erlang node with name Node on host Host, exactly as specified by whatever combination of options you dropped into Opts. The full send. π
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. π
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. π Like, actually present. Don't be surprised.
The time-outs are applied as follows:
BootTimeoutβ the time to start the Erlang node, in seconds. Defaults to 3 seconds. 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 to 1 second. 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 to 1 second. 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, the node can just. be out there. alive. unkilled. living its truth.)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. It's already up bestie, sit down. π{error, started_not_connected, NodeName}if the node is started, but not connected to the master node. Started but not connected β we've all been there. π{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) -> {ok, Node} | {error, Reason, Node}
stop(Node) -> {ok, Node} | {error, Reason, Node}
when Node :: node(), Reason :: atom().
π¨ Deprecated:ct_slave:stop/1is deprecated; use?CT_PEER(), or the'peer'module instead
Stops the running Erlang node with name Node on the local host. Bye babe, thanks for the nodes. π
stop(HostOrNode, NodeOrOpts) -> {ok, Node} | {error, Reason, Node}
stop(HostOrNode, NodeOrOpts) -> {ok, Node} | {error, Reason, Node}
when
HostOrNode :: atom() | Node,
Node :: node(),
NodeOrOpts :: Node | stop_options(),
Reason :: atom().
π¨ Deprecated:ct_slave:stop/2is deprecated; use?CT_PEER(), or the'peer'module instead
Stops the running Erlang node with name Node on host Host. Remote shutdown, respectfully executed. π
that's the whole page, bestie, you ate it. π This one comes to us from Ericsson AB, version common_test 1.31.1, ct_slave(3) β section 3, Erlang Module Definition, and that's on periodt. πβ¨π
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms