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 From 1327bd8956b2d0f6b5a9201ce9ecf361f94733aa Mon Sep 17 00:00:00 2001 From: Andrey Pampukha Date: Mon, 19 Apr 2010 17:28:07 +0200 Subject: Move 'node_start' and 'eval' terms into new 'init' term node_start+eval -> init(node_start, eval) Also include some documentation updates. --- lib/common_test/doc/src/ct_master_chapter.xml | 49 ++++++++++++++++++--------- 1 file changed, 33 insertions(+), 16 deletions(-) (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 1622b5b29c..4ab891edee 100644 --- a/lib/common_test/doc/src/ct_master_chapter.xml +++ b/lib/common_test/doc/src/ct_master_chapter.xml @@ -102,7 +102,7 @@

ct_master:abort() (stop all) or ct_master:abort(Nodes)

For detailed information about the ct_master API, please see the - manual page for this module.

+ manual page for this module.

Test Specifications @@ -197,32 +197,49 @@
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 From 5cf552a62742c6ddc974ba5491188576d512254e Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Mon, 24 May 2010 17:38:19 +0200 Subject: Add run_test program for Common Test Common Test may now be started with the program run_test instead of the legacy shell script with the same name. Minor updates have also been made to the Webtool application. --- lib/common_test/doc/src/ct_master_chapter.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 4ab891edee..14f318759e 100644 --- a/lib/common_test/doc/src/ct_master_chapter.xml +++ b/lib/common_test/doc/src/ct_master_chapter.xml @@ -186,7 +186,7 @@ Running Test Suites chapter). The result is that any test specified to run on a node with the same name as the Common Test node in question (typically ct@somehost if started - with the run_test script), will be performed. Tests without explicit + with the run_test program), will be performed. Tests without explicit node association will always be performed too of course!

It is recommended that absolute paths are used for log directories, -- cgit v1.2.3 From 7b33aa92bb2558ba04a6436203638fd46592b8d2 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Thu, 27 May 2010 00:46:37 +0200 Subject: Improve documentation and fix minor problems General documentation and code updates. --- lib/common_test/doc/src/ct_master_chapter.xml | 52 ++++++++++++++------------- 1 file changed, 28 insertions(+), 24 deletions(-) (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 14f318759e..bc51957aee 100644 --- a/lib/common_test/doc/src/ct_master_chapter.xml +++ b/lib/common_test/doc/src/ct_master_chapter.xml @@ -30,6 +30,7 @@

+ General

Large scale automated testing requires running multiple independent test sessions in parallel. This is accomplished by running @@ -105,6 +106,7 @@ manual page for this module.

+ Test Specifications

The test specifications used as input to CT Master are fully compatible with the specifications used as input to the regular CT server. The syntax is described in the @@ -195,11 +197,12 @@

- Automatic startup of the test target nodes + Automatic startup of test target nodes -

Is is possible to perform initial actions on test target nodes - automatically using a new term in the test specification, init.

+

Is is possible to automatically start, and perform initial actions, on + test target nodes by using the test specification term init.

Currently, two sub-terms are supported, node_start and eval.

+

Example:

      {node, node1, node1@host1}.
      {node, node2, node1@host2}.
@@ -207,38 +210,39 @@
      {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, []}}}.
-    
+ {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. - 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: + the user callback function callback_module:my_slave_callback/0, and nodes + node1@host2 and node2@host2 will be started with the default callback + module ct_slave. The given user name and password is used to log into remote + host host2. Also, the function module:function/0 will be evaluated on + node1@host3, and the result of this call will be printed to the log.

+ +

The default ct_slave callback module, + which is part of the Common Test application, has the following features: - Starting the Erlang nodes or local or remote hosts - (ssh is used for remote ones); + Starting Erlang target nodes on local or remote hosts + (ssh is used for communication). - Ability to start Erlang emulator with the additional flags - (any flags supported by erl are supported); + Ability to start an Erlang emulator with 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; + Supervision of a node being started by means of internal callback + functions. Used to prevent hanging nodes. (Configurable). - Monitoring of the master node by the slaves. Slave node may be - stopped in case of master node termination. Configurable; + Monitoring of the master node by the slaves. A slave node may be + stopped in case the master node terminates. (Configurable). - Execution of the user's functions after slave node is started. + Execution of user functions after a slave node is started. Functions can be given as a list of {Module, Function, Arguments} tuples.

-

Note that it is possible to specify eval term for the node as well +

Note that it is possible to specify an 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. + case first the node will be started, then the startup_functions are + executed, and finally functions specified with eval are called.

-- cgit v1.2.3