From 8f4c25d17f327f013a3d44b67205fcbaf6c2b9b4 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Fri, 20 Aug 2010 17:15:18 +0200 Subject: Fix various test suite, makefile, and doc related problems --- lib/common_test/doc/src/ct_slave.xml | 139 +++++++++++++++++++++++++++++ lib/common_test/test/Makefile | 1 + lib/common_test/test/ct_repeat_1_SUITE.erl | 23 ++++- 3 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 lib/common_test/doc/src/ct_slave.xml (limited to 'lib') diff --git a/lib/common_test/doc/src/ct_slave.xml b/lib/common_test/doc/src/ct_slave.xml new file mode 100644 index 0000000000..4533de92f7 --- /dev/null +++ b/lib/common_test/doc/src/ct_slave.xml @@ -0,0 +1,139 @@ + + + +
+ct_slave + + +1 + + + +A +ct_slave.xml
+ct_slave +Common Test Framework functions for starting and stopping nodes for +Large Scale Testing. + +

Common Test Framework functions for starting and stopping nodes for +Large Scale Testing.

+ +

This module exports functions which are used by the Common Test Master + to start and stop "slave" nodes. It is the default callback module for the + {init, node_start} term of the Test Specification.

+ + +start(Node) -> Result +Starts an Erlang node with name Node on the local host. + +Node = atom()Result = {ok, NodeName} | {error, already_started, NodeName} | {error, started_not_connected, NodeName} | {error, boot_timeout, NodeName} | {error, init_timeout, NodeName} | {error, startup_timeout, NodeName} | {error, not_alive, NodeName}NodeName = atom() + + +

Starts an Erlang node with name Node on the local host.

+

See also: start/3.

+
+ +start(Host, Node) -> Result +Starts an Erlang node with name Node on host + Host with the default options. + +Node = atom()Host = atom()Result = {ok, NodeName} | {error, already_started, NodeName} | {error, started_not_connected, NodeName} | {error, boot_timeout, NodeName} | {error, init_timeout, NodeName} | {error, startup_timeout, NodeName} | {error, not_alive, NodeName}NodeName = atom() + + +

Starts an Erlang node with name Node on host + Host with the default options.

+

See also: start/3.

+
+ +start(Host, Node, Options::Opts) -> Result +Starts an Erlang node with name Node on host + Host as specified by the combination of options in + Opts. + +Node = atom()Host = atom()Opts = [OptTuples]OptTuples = {username, Username} | {password, Password} | {boot_timeout, BootTimeout} | {init_timeout, InitTimeout} | {startup_timeout, StartupTimeout} | {startup_functions, StartupFunctions} | {monitor_master, Monitor} | {kill_if_fail, KillIfFail} | {erl_flags, ErlangFlags}Username = string()Password = string()BootTimeout = integer()InitTimeout = integer()StartupTimeout = integer()StartupFunctions = [StartupFunctionSpec]StartupFunctionSpec = {Module, Function, Arguments}Module = atom()Function = atom()Arguments = [term]Monitor = bool()KillIfFail = bool()ErlangFlags = string()Result = {ok, NodeName} | {error, already_started, NodeName} | {error, started_not_connected, NodeName} | {error, boot_timeout, NodeName} | {error, init_timeout, NodeName} | {error, startup_timeout, NodeName} | {error, not_alive, NodeName}NodeName = atom() + + +

Starts an Erlang node with name Node on host + Host as specified by the combination of options in + Opts.

+ +

Options Username and Password will be used + to log in onto the remote host Host. + Username, if omitted, defaults to the current user name, + and password is empty by default.

+ +

A list of functions specified in the Startup option will be + executed after startup of the node. Note that all used modules should be + present in the code path on the Host.

+ +

The timeouts are applied as follows: + + + BootTimeout - time to start the Erlang node, in seconds. + Defaults to 3 seconds. If node does not become pingable within this time, + the result {error, boot_timeout, NodeName} is returned; + + + InitTimeout - time to wait for the node until it calls the + internal callback function informing master about successfull startup. + Defaults to one second. + In case of timed out message the result + {error, init_timeout, NodeName} is returned; + + + StartupTimeout - time to wait intil the node finishes to run + the StartupFunctions. Defaults to one second. + If this timeout occurs, the result + {error, startup_timeout, NodeName} is returned. + +

+ +

Option monitor_master specifies, if the slave node should be + stopped in case of master node stop. Defaults to false.

+ +

Option kill_if_fail specifies, if the slave node should be + killed in case of a timeout during initialization or startup. + Defaults to true. Note that node also may be still alive it the boot + timeout occurred, but it will not be killed in this case.

+ +

Option erlang_flags specifies, which flags will be added + to the parameters of the erl executable.

+ +

Special return values are: + + {error, already_started, NodeName} - if the node with + the given name is already started on a given host; + {error, started_not_connected, NodeName} - if node is + started, but not connected to the master node. + {error, not_alive, NodeName} - if node on which the + ct_slave:start/3 is called, is not alive. Note that + NodeName is the name of current node in this case. +

+ +
+ +stop(Node) -> Result +Stops the running Erlang node with name Node on + the localhost. + +Node = atom()Result = {ok, NodeName} | {error, not_started, NodeName} | {error, not_connected, NodeName} | {error, stop_timeout, NodeName}NodeName = atom() + + +

Stops the running Erlang node with name Node on + the localhost.

+
+ +stop(Host, Node) -> Result +Stops the running Erlang node with name Node on + host Host. + +Host = atom()Node = atom()Result = {ok, NodeName} | {error, not_started, NodeName} | {error, not_connected, NodeName} | {error, stop_timeout, NodeName}NodeName = atom() + + +

Stops the running Erlang node with name Node on + host Host.

+
+ + + +
\ No newline at end of file diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile index abb14c35d9..b96bdef5e0 100644 --- a/lib/common_test/test/Makefile +++ b/lib/common_test/test/Makefile @@ -33,6 +33,7 @@ MODULES= \ ct_groups_test_1_SUITE \ ct_groups_test_2_SUITE \ ct_sequence_1_SUITE \ + ct_repeat_1_SUITE \ ct_testspec_1_SUITE \ ct_skip_SUITE \ ct_error_SUITE \ diff --git a/lib/common_test/test/ct_repeat_1_SUITE.erl b/lib/common_test/test/ct_repeat_1_SUITE.erl index 2956f6a8ad..558cb731c9 100644 --- a/lib/common_test/test/ct_repeat_1_SUITE.erl +++ b/lib/common_test/test/ct_repeat_1_SUITE.erl @@ -182,5 +182,26 @@ events_to_check(_, 0) -> events_to_check(Test, N) -> test_events(Test) ++ events_to_check(Test, N-1). -test_events(_) -> +test_events(repeat_cs) -> + []; + +test_events(repeat_cs_and_grs) -> + []; + +test_events(repeat_seq_1) -> + []; + +test_events(repeat_seq_2) -> + []; + +test_events(repeat_cs_until_any_ok) -> + []; + +test_events(repeat_cs_until_any_fail) -> + []; + +test_events(repeat_cs_until_all_ok) -> + []; + +test_events(repeat_cs_until_all_fail) -> []. -- cgit v1.2.3