1ct_slave(3)                Erlang Module Definition                ct_slave(3)
2
3
4

NAME

6       ct_slave - Common Test framework functions for starting and stopping
7           nodes for Large-Scale Testing.
8

DESCRIPTION

10       Common  Test  framework  functions  for starting and stopping nodes for
11       Large-Scale Testing.
12
13       This module exports functions used by the Common Test Master  to  start
14       and  stop  "slave"  nodes.  It  is  the default callback module for the
15       {init, node_start} term in the Test Specification.
16

EXPORTS

18       start(Node) -> Result
19
20              Types:
21
22                 Node = atom()
23                 Result = {ok, NodeName} | {error, Reason, NodeName}
24                 Reason = already_started | started_not_connected | boot_time‐
25                 out | init_timeout | startup_timeout | not_alive
26                 NodeName = atom()
27
28              Starts an Erlang node with name Node on the local host.
29
30              See also ct_slave:start/3.
31
32       start(HostOrNode, NodeOrOpts) -> Result
33
34              Types:
35
36                 HostOrNode = atom()
37                 NodeOrOpts = atom() | list()
38                 Result = {ok, NodeName} | {error, Reason, NodeName}
39                 Reason = already_started | started_not_connected | boot_time‐
40                 out | init_timeout | startup_timeout | not_alive
41                 NodeName = atom()
42
43              Starts an Erlang node with default options on a specified  host,
44              or  on  the local host with specified options. That is, the call
45              is interpreted as start(Host, Node) when the second argument  is
46              atom-valued and start(Node, Opts) when it is list-valued.
47
48              See also ct_slave:start/3.
49
50       start(Host, Node, Opts) -> Result
51
52              Types:
53
54                 Node = atom()
55                 Host = atom()
56                 Opts = [OptTuples]
57                 OptTuples  =  {username,  Username}  | {password, Password} |
58                 {boot_timeout, BootTimeout} | {init_timeout,  InitTimeout}  |
59                 {startup_timeout, StartupTimeout} | {startup_functions, Star‐
60                 tupFunctions} | {monitor_master,  Monitor}  |  {kill_if_fail,
61                 KillIfFail}  |  {erl_flags,  ErlangFlags}  |  {env, [{EnvVar,
62                 Value}]}
63                 Username = string()
64                 Password = string()
65                 BootTimeout = integer()
66                 InitTimeout = integer()
67                 StartupTimeout = integer()
68                 StartupFunctions = [StartupFunctionSpec]
69                 StartupFunctionSpec = {Module, Function, Arguments}
70                 Module = atom()
71                 Function = atom()
72                 Arguments = [term]
73                 Monitor = bool()
74                 KillIfFail = bool()
75                 ErlangFlags = string()
76                 EnvVar = string()
77                 Value = string()
78                 Result = {ok, NodeName} | {error, Reason, NodeName}
79                 Reason = already_started | started_not_connected | boot_time‐
80                 out | init_timeout | startup_timeout | not_alive
81                 NodeName = atom()
82
83              Starts  an  Erlang node with name Node on host Host as specified
84              by the combination of options in Opts.
85
86              Options Username and Password are used to log on to  the  remote
87              host  Host.  Username, if omitted, defaults to the current user‐
88              name. Password is empty by default.
89
90              A list of functions specified in  option  Startup  are  executed
91              after  startup  of the node. Notice that all used modules are to
92              be present in the code path on Host.
93
94              The time-outs are applied as follows:
95
96                BootTimeout:
97                  The time to start the Erlang node, in seconds. Defaults to 3
98                  seconds.  If  the node is not pingable within this time, the
99                  result {error, boot_timeout, NodeName} is returned.
100
101                InitTimeout:
102                  The time to wait for the node until it  calls  the  internal
103                  callback   function  informing  master  about  a  successful
104                  startup. Defaults to 1 second. In case of a timed  out  mes‐
105                  sage,   the   result   {error,  init_timeout,  NodeName}  is
106                  returned.
107
108                StartupTimeout:
109                  The time to wait until the node stops  to  run  StartupFunc‐
110                  tions.  Defaults  to  1 second. If this time-out occurs, the
111                  result {error, startup_timeout, NodeName} is returned.
112
113              Options:
114
115                monitor_master:
116                  Specifies if the slave node is to be stopped if  the  master
117                  node stops. Defaults to false.
118
119                kill_if_fail:
120                  Specifies  if  the  slave node is to be killed if a time-out
121                  occurs during initialization or startup. Defaults  to  true.
122                  Notice  that  the  node  can also be still alive it the boot
123                  time-out occurred, but it is not killed in this case.
124
125                erlang_flags:
126                  Specifies which flags are added to  the  parameters  of  the
127                  executable erl.
128
129                env:
130                  Specifies  a  list of environment variables that will extend
131                  the environment.
132
133              Special return values:
134
135                * {error, already_started, NodeName}  if  the  node  with  the
136                  specified name is already started on a specified host.
137
138                * {error,  started_not_connected,  NodeName}  if  the  node is
139                  started, but not connected to the master node.
140
141                * {error,  not_alive,  NodeName}  if   the   node   on   which
142                  ct_slave:start/3  is called, is not alive. Notice that Node‐
143                  Name is the name of the current node in this case.
144
145       stop(Node) -> Result
146
147              Types:
148
149                 Node = atom()
150                 Result = {ok, NodeName} | {error, Reason, NodeName}
151                 Reason = not_started | not_connected | stop_timeout
152
153              Stops the running Erlang node with name Node on the local host.
154
155       stop(Host, Node) -> Result
156
157              Types:
158
159                 Host = atom()
160                 Node = atom()
161                 Result = {ok, NodeName} | {error, Reason, NodeName}
162                 Reason = not_started | not_connected | stop_timeout
163                 NodeName = atom()
164
165              Stops the running Erlang node with name Node on host Host.
166
167
168
169Ericsson AB                    common_test 1.18                    ct_slave(3)
Impressum