-
Notifications
You must be signed in to change notification settings - Fork 3
configuration
There are three primary types of configuration data in SysTest, each of which is supplied as using an Erlang Term based format that can be read by file:consult/1.
We use the term configuration element (or just element) to describe a tagged tuple stored in a configuration file. Consider the following configuration:
{name, "Tom"}.
{age, 61}.
{roles, [{person, active}, {employee, inactive}]}.
In this configuration (above), the top level entries name, age, roles are all configuration elements, but the person, employee tuples are usually referred to as sub-elements for clarity. Where complex nested structures are used, we also tend to refer to sub-elements as configuration sections, reflecting their use as containers for other sub-elements.
Configurations are normally grouped by the [[SysTest Config Server|systest_config]] and we refer to these groupings as a configuration set. This name reflects the fact that each configuration element’s key can occur only once.
Settings are the most basic form of configuration that SysTest handles, and are simply a means to externalise certain data you wish to make use of in your tests. There is no special format for this data, nor are there any allowed (or disallowed) elements.
Settings are sourced from ./resources/default.settings initially, if it
exists. Then the base directory is searched (recursively) for a file whose
name matches the pattern ./%{USER}.settings, where USER contains the content
of the USER
environment variable. These two files are then merged, with the
configuration elements from the latter file overwriting those from the
default.
Settings can be extracted at runtime using the
[[Configuration API|systest_config]], or accessed in and used in
string-expressions by referencing the settings
group. For example:
{web_auth_url, "${settings.base_url}/login.html"}.
These configuration files define the various Resources that can be made to participate in a test run. For more information about Resources in general, see the [[Concepts/Overview|concepts]] page.
Resources Configuration Files are sources from ./resources/*.resource by default, though like most config locations, this can be overridden by the current Profile (more on this later).
Each top level configuration element in a Resources Configuration File is accessible using the [[Configuration API|systest_config]]. SysTest uses these elements to resolve resources automatically and associate then with Test Scopes at runtime - see [[Concepts/Overview|concepts]] for more information about Test Scopes.
Each top level configuration element can describe either a Process or a SUT (see [[Concepts/Overview|concepts]]). The Process configuration contains quite a bit of nested data, so an example should serve best to explain how it’s put together:
{basic_node, [ {startup, [{handler, systest_slave}]} ]}.
In this basic configuration, we’ve given the Process a name basic_node
,
and provided the minimal information SysTest needs to start up an instance of
this process when a test scope or SUT requires it. The handler
element is
mandatory, and specifies the kind of process handler we wish to use for
instances of this type. See [[Concepts/Overview|concepts]] for more information
about process handlers.
The [[systest_slave
|systest_slave]] handler deals with starting slave (Erlang)
nodes, and it can be configured to pass startup arguments to the erl
program
it is starting. For this we use the flags.start
elements, which are provided
as a string and can contain string-expressions:
{basic_node, [
{startup, [{handler, systest_slave}]},
{flags, [
{start, "-boot start_sasl +W w "
"+K true +A30 +P 1048576 "
"-pa ebin "
"-sasl sasl_error_logger ${settings.errlog_on_off}"}
]}
]}.
The [[systest_slave
|systest_slave]] handler doesn’t use flags.stop
elements, though it is not an error to supply them (they’re simply ignored).
Some handlers provide more complex startup options, the most common of which is
[[systest_cli
|systest_cli]]. As with the slave handler, we configure a
Process resource to use this by settings the {handler, systest_cli}
option
sub element in the startup
configuration section.
The SUT configuration can contain any of the sub elements outlined in the following table.
SUT Sub-Element | Description | Example | Mandatory? |
---|---|---|---|
sut |
List of process names (by host) |
|
Yes |
processes |
Process stereotypes |
|
Yes (ALL) |
Processes residing on localhost
should always use the atom localhost
, whilst
other host names can be specified using a string. The Processes in a SUT
configuration must specify their stereotypes - the Process definitions which
should be applied to them.
Profiles, also called test profiles in this guide, provide a mechanism to control the SysTest runtime environment. Each element that the profile can contain is optional and unrecognised elements are ignored. When an element is not given in a profile, its default value is used instead.
Element | Description | Controls | Default |
---|---|---|---|
framework |
The testing framework (module) to use |
Test Execution |
systest_ct |
output_dir |
Directory for generated artefacts |
Logging, coverage reports |
see Temporary Files below |
log_dir |
Base directory for all log files |
Logging |
"{output_dir}/logs" |
settings_base |
Default/Base Settings file |
Settings |
"./resources/default.settings" |
resources |
List of paths or glob patterns used to find Resources. |
Resources |
[./resources/\*.resource] |
targets |
Paths to directories containing beam code, or module names |
Test Execution |
["ebin"] |
specifications |
Test Specification File |
Common Test (only) |
[] |
hooks |
Testing Framework Hooks |
Testing Framework(s) |
See Framework Configuration |
You select a profile when running SysTest by passing -P <profile name>
on
the command line. For more details, see the
[[Interfaces Documentation|interfaces]].