Database Testing
Database testing support was added in version 3.2
Additional Prerequisites
- DBI.pm and any DBD modules needed for your database
Configuring
You will need to specify various parameters:
Service DB {
dsn: dbi:mysql:database=mydatabase;host=dbhost
user: argus
pass: password
sql: SELECT COUNT(*) FROM mytable
}
- dsn - specify the dsn used to connect to the database. this should
be specified in perl DBI syntax. consult the documentation for DBI
and for your database for exact syntax.
- user - the username to use for connecting to the database
- pass - the password to use for connecting to the database,
depending on your database, this may be optional.
- sql - any arbitrary sql 'select' statement
The results of the select statement may be tested using any of the
normal tests described in extended testing, such
as 'expect', or 'minvalue'.
|