Automatic startup of the test target nodes
- Is is possible to start nodes acting like a test targets automatically
- using a new term in the test specification, node_start:
+ Is is possible to perform initial actions on test target nodes
+ automatically using a new term in the test specification, init.
+ Currently, two sub-terms are supported, node_start and eval.
{node, node1, node1@host1}.
{node, node2, node1@host2}.
{node, node3, node2@host2}.
- {node_start, node1, [{callback_module, my_slave_callback}]}.
- {node_start, [node2, node3], [{username, "ct_user"}, {password, "ct_password"}]}.
+ {node, node4, node1@host3}.
+ {init, node1, [{node_start, [{callback_module, my_slave_callback}]}]}.
+ {init, [node2, node3], {node_start, [{username, "ct_user"}, {password, "ct_password"}]}}.
+ {init, node4, {eval, {module, function, []}}}.
This test specification declares that node1@host1 is to be started using
user's callback my_slave_callback with no parameters, and nodes node1@host2 and
node2@host2 will be started with the default callback module ct_slave,
- using the given user name and password to log into remote host host2.
- Default ct_slave callback module delivered with the Common Test has the following features:
+ using the given user name and password to log into remote host host2.
+ Also, there will be function module:function/0 evaluated on the
+ node1@host3, and result of this call will be printed to the log.
+ Default ct_slave callback module
+ delivered with the Common Test has the following features:
- - Starting the Erlang nodes or local or remote hosts (ssh is used for remote ones);
- - Ability to start Erlang emulator with the additional flags (any flags supported by erl are supported);
- - Supervision of the node being start using internal callback functions. Used to prevent hanging of started nodes. Configurable;
- - Monitoring of the master node by the slaves. Slave node may be stopped in case of master node termination. Configurable;
- - Execution of the user's functions after slave node is started. Functions can be given as a list of {Module, Function, Arguments} tuples.
+ - Starting the Erlang nodes or local or remote hosts
+ (ssh is used for remote ones);
+
+ - Ability to start Erlang emulator with the additional flags
+ (any flags supported by erl are supported);
+
+ - Supervision of the node being start using internal callback
+ functions. Used to prevent hanging of started nodes. Configurable;
+
+ - Monitoring of the master node by the slaves. Slave node may be
+ stopped in case of master node termination. Configurable;
+
+ - Execution of the user's functions after slave node is started.
+ Functions can be given as a list of {Module, Function, Arguments} tuples.
+
- If any eval term is specified for a node which has node_start term
- defined for it, the evaluation of the functions will be deferred until the node is started.
- The functions to be evaluated are simply added to the end of the startup_functions list
- (see ct_slave chapter in the Reference Manual).
+ Note that it is possible to specify eval term for the node as well
+ as startup_functions in the node_start options list. In this
+ case first node will be started, then the startup_functions are
+ executed, and finally functions specified with eval will be called.
+
--
cgit v1.2.3