From ebcab814cabc74407f48aba1b41327df80586fcd Mon Sep 17 00:00:00 2001 From: Andrey Pampukha Date: Thu, 15 Apr 2010 12:57:04 +0200 Subject: Document ct_slave and 'eval' terms --- lib/common_test/doc/src/ct_master_chapter.xml | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'lib/common_test/doc/src/ct_master_chapter.xml') diff --git a/lib/common_test/doc/src/ct_master_chapter.xml b/lib/common_test/doc/src/ct_master_chapter.xml index 79288cfe4c..1622b5b29c 100644 --- a/lib/common_test/doc/src/ct_master_chapter.xml +++ b/lib/common_test/doc/src/ct_master_chapter.xml @@ -194,6 +194,37 @@ current working directory settings are not important.

+
+ 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:

+
+     {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"}]}.
+    
+

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: + + 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).

+
+ -- cgit v1.2.3