- What is Test Driven Infrastructure?
- See also
- COPYRIGHT AND LICENSE
Test::BDD::Infrastructure - a collection of step file definitions for Test Driven Infrastructure
This is a collection of generic step definitions for infrastructure testing with Test::BDD::Cucumber.
TDI takes the concept of Test Driven Development used for software development and applies it to infrastructure.
Instead of software it is used to test infrastructure. Instead of function and classes it is used to test daemons and configuration.
Checks for testing existence, attributes, size, mode and content of files and directories.
Checks for constructing DNS queries and checking response and records.
Checks for testing the process table.
Checks for testing a HTTP server.
Checks for testing configuration variables.
Checks for testing file system usage.
Check for testing swap space usage.
Checks for tcp/udp/unix-socket based checks.
Checks for executing commands and checking their output.
Checks for watching log files.
Checks for system user/groups.
First include the steps from a step_file:
# features/step_files/00use_steps.pl use Test::BDD::Infrastructure;
Or just include individual steps:
# features/step_files/00use_steps.pl use Test::BDD::Infrastructure::File; use Test::BDD::Infrastructure::HTTP; use Test::BDD::Infrastructure::Process; ...
Then define features of your infrastructure:
# features/webserver.feature Feature: Example application is running on a webserver For the example application to work it is necessary that the webserver is configured and running. Scenario: The webserver process must be running Given a parent process like ^/usr/sbin/apache2.prefork is running Then the uid of the process must be root And the gid of the process must be root And the RSS size of the process must be smaller than 32 megabyte When there are at least 5 child processes like ^/usr/sbin/apache2.prefork Then the uid of the child processes must be www-data And the gid of the child processes must be www-data And the RSS size of the child processes must be smaller than 64 megabyte Scenario: The start page of the webserver must be accessible Given the http URL http://www.example.mydomain.de/ When the http request is sent Then the http response must be successfull And the http response header Content-Type must be like text/html And the http response content must be like Welcome to Example Scenario: The webserver must log access Given the file /var/log/apache2/access.log exists Then the file mode must be 0640 And the file must be owned by user root And the file must be owned by group adm And the file must contain at least 1 line And the file mtime must be newer than 5 minutes
The perl cucumber implementation.
Report your test results to nagios for monitoring.
Generate HTML reports for your documentation, meetings etc.
Markus Benning <email@example.com>
This software is copyright (c) 2015 by Markus Benning.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.