TEST: Skip tests when external commands are unavailable

When relying on external commands, such as getenforce, skip the test if
the required commands are unavailable.

This patch adds a function to the toolbox that allows tests to declare
their required commands at the top of the test script.

If which cannot locate the command, a message is written to the output
file, a marker is printed indicating which command is missing, and the
test script is terminated with a passing result.

Additionally, the patch adds require_command declarations for commands
required in the bz1031154 test.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: David Howells <dhowells@redhat.com>
2 files changed