Before a deployment probably you want to make sure your systems and configuration files are ready to go. Also you probably want to make sure that if you needed to apply patches to your configuration files, they really got applied (even in a development server or verify directly on production servers). So here Test::System can help you verifying this in the form of a test case. Of course, you write the test case :-)

What about if you have many servers and although you have nagios to verify the speed of the CPU sometimes you need to verify it "on-demand" (perhaps when you get new servers in your datacenter). Here Test::System can help you to verify that these servers are ready to go before even they get connected to nagios or your favorite monitoring tool.

One of the things you need to keep in mind is that Test::System is NOT a monitoring system. It will let you verify things on demand, things that are repetitive and perhaps you want them to be automated.

YAML filename that has a list of available tests. This is not required but can be useful if you want to group tests (like hardware.yaml, net.yaml, etc). Comes also handy when user does not provide a list of tests to execute, so all the tests listed in this file are executed.

An example of a YAML file:

ping:
description: Test the ping and do foo and make bar
code: test/foo.pl
cpu:
description: Test the CPU of nodes
code: test/cpu.pl

Is an attribute that can be represented as a string (like a hostname) or as a list (where each item will be a node/hostname). This attribute has write access and is where the tests are going to be executed to.

Another way of setting this value is when runtests() is called, a test plan (in the form of a YAML file) can be provided and it can contain the list of nodes to use.

A write access string that has the format of how the tests should be presented, please refer to the modules available under Test::System::Output or in your custom factory (format_factory_class attribute) class if this is the case.

An attribute with write access permission. This attribute will transform all the items of this hash to environment variables.

The use of this attribute is very handy if you want to provide some additional data for your tests and since the tests are run in separate forks with Test::Harness then the only possible way to keep them is to make them available through the environment (%ENV hash).

Please be warned that only scalars are stored in environment variables, those that are an array will be converted to CSV values while the rest of the data types will be lost.

In your tests if you want to use any of these parameters they will be available through the environment variables with a prefix of: TEST_SYSTEM_ or you can use Test::System::Helper to get their values.

Does some verification before the tests are executed. This method gets called by runtests.

The parameters it accepts are the same parameters passed to runtests with the main difference the tests are already filtered (eg, if a test plan in YAML was provided we will use it or we will use all the tests listed inside the test_groups.

Similar to setup_parser, this should never be called since it will be triggered by TAP::Parser after each (sub)tests gets executed.

By default we check the reason of why the test failed so later we provide a simple hash to parse with all the tests and the reasons of why they failed (if this could be the case). And because we need to know what TAP::Parser instance we are processing we need to ask for it as a first parameter.

Reads the given tests yaml file ($yaml_file). This YAML file should have at least a list of tests and optionally can also have parameters the tests should contain.

Although this method is used mostly internally there's the option to call it as any other method Test::System offers.

By default it will fill the parameters of your Test::System instance but by passing $do_not_fill_parameters (second parameter) as true or something that Perl understands as true then it will skip the part. This should be presented as a hash in YAML syntax.

The above apply also to $do_not_fill_nodes (third parameter). This should be presented as an array in YAML syntax.

Once the file is read an array with all the tests will be returned.

All the tests should be contained inside a hash named 'tests'. All the tests should be represented in the form of a list, each item of the list is the test you want to execute. At least it should have a 'code' item, this is the filepath of the test (or the ID from a test_groups). Optionally you can also provide the description of the test (cause otherwise the filename will be used and it can make ugly your summary report).

An example of a YAML test plan file can be found inside the examples directory or: