NAME
Zonemaster::Test - module to find, load and execute all test modules
SYNOPSIS
my @results = Zonemaster::Test->run_all_for($zone);
METHODS
- modules()
-
Returns a list with the names of all available test modules except Zonemaster::Test::Basic (since that one is a bit special).
- run_all_for($zone)
-
Runs all (default) tests in all test modules found, and returns a list of the log entry objects they returned.
The order in which the test modules found will be executed is not defined, except that Zonemaster::Test::Basic is always executed first. If the Basic tests fail to indicate a very basic level of function (it must have a parent domain, and it must have at least one nameserver) for the zone, no further tests will be executed.
Test modules are defined as modules with names starting with "Zonemaster::Test::". They are expected to provide at least to class methods,
all
andversion
.all
will be given a zone object as its only argument, and is epected to return a list of Zonemaster::Logger::Entry objects.version
is called without arguments, and is expected to return a single value indicating the version of the test module. A log entry with this version will be included in the global log entry list, but not in the list returned fromrun_all_for
. - run_module($module, $zone)
-
Runs all default tests in the named module for the given zone.
- run_one($module, $method, @arguments)
-
Run one particular test method in one particular module. The requested module must be in the list of active loaded modules (that is, not the Basic module and not a module disabled by the current policy), and the method must be listed in the metadata the module exports. If those requirements are fulfilled, the method will be called with the provided arguments.