Test targets represent entities that QMTest uses to run tests. See Section 8, “Targets” for an overview of how QMTest uses targets.
Each target specification includes the following:
The name of the target. This is a name identifying the target, such as the host name of the computer which will run the tests. Target names should be unique in a single target file.
The target class. Similar to a test class, a target class is a Python class which implements a type of target. As with test classes, a target class is identified by its name, which includes the module name and the class name.
For example, thread_target.ThreadTarget
is the name of a target class, provided by QMTest,
which runs tests in multiple threads on the local computer.
QMTest includes several target class implementations. See Section 7.2, “Target Classes” for details.
A target group name. The test implementor may choose the syntax of target group names in a test implementation. Target groups may be used to encode information about target attributes, such as architecture and operating system, and capabilities.
Optionally, a target specification may include additional properties. Properties are named and have string values. Some target classes may use property information to control their configuration. For instance, a target class which executes tests on a remote computer would extract the network address of the remote computer from a target property.
QMTest includes these target class implementations.
The serial_target.SerialTarget
target
class runs tests one after the other on the machine running
QMTest. If you use a SerialTarget
, you
should not also use any other targets, including another
SerialTarget
at the same time.
The thread_target.ThreadTarget
target
class runs tests in one or more threads on the machine running
QMTest. The ThreadTarget
can be used to
run multiple tests at once.
ThreadTarget
uses the following
properties:
The concurrency specifies the number of threads to use. Larger numbers of threads will allow QMTest to run more tests in parallel. You can experiment with this value to find the setting that allows QMTest to run tests most quickly.
The process_target.ProcessTarget
target class run tests in one more processes on the machine running
QMTest. This target class is not available on Windows. Like
ThreadTarget
,
ProcessTarget
can be used to run multiple
tests simultaneously.
In general, you should use
ThreadTarget
instead of
ProcessTarget
to maximize QMTest
performance. However, on machines that do not have threads,
ProcessTarget
provides an alternative way
of running tests in parallel.
ProcessTarget
uses the following
properties:
The concurrency specifies the number of processes to use. Larger numbers of processes will allow QMTest to run more tests in parallel. You can experiment with this value to find the setting that allows QMTest to run tests most quickly.
QMTest uses the path given by the
qmtest property to create additional QMTest
instances. By default, the path
/usr/local/bin/qmtest
is used.
The rsh_target.RSHTarget
target class runs tests on a remote computer via a remote shell
invocation (rsh, ssh, or
similar). This target uses a remote shell to invoke a program
similar to the qmtest command on the remote computer. This
remote program accepts test commands and responds with results from
running these tests.
To use RSHTarget
, the remote
computer must have QMTest installed and must contain an identical
copy of the test database. QMTest does not transfer entire tests
over the remote shell connection; instead, it relies on the remote
test database for loading tests.
In addition, the remote shell program must be configured to
allow a remote login without additional intervention (such as typing
a password). If you use rsh, you can use an
.rhosts
file to set this up. If you use
ssh, you can use an SSH public key and the
ssh-agent program for this. See the
corresponding manual pages for details.
RSHTarget
uses all of the properties
given above for ProcessTarget
. In
addition, RSHTarget
uses the following
properties:
The remote_shell property specifies the path to the remote shell program. The default value is ssh. The remote shell program must accept the same command-line syntax as rsh.
The host property specifies the remote host name. If omitted, the target name is used.
The database_path property specifies the path to the test database on the remote computer. The test database must be identical to the local test database. If omitted, the local test database path is used.
The arguments property specifies additional command-line arguments for the remote shell program. The value of this property is split at space characters, and the arguments are added to the command line before the name of the remote host.
For example, if you are using the ssh
remote shell program and wish to log in to the remote computer
using a different user account, specify the -l
username
option using the arguments
property.