Include examples and clarify usage

This commit is contained in:
mboelen 2015-07-22 14:57:57 +02:00
parent 8f9a616854
commit 17c44ced52
1 changed files with 16 additions and 11 deletions

View File

@ -33,22 +33,27 @@
# Description : Check for something interesting - template
# Notes : This test first checks if OpenSSL binary was found
# * Prerequisites check
# * Prerequisites Check
# -----------------------
#
# We check first if a variable is defined (OPENSSLBINARY).
# Other good options to check for:
# -f /etc/file
# -d /var/run/mydirectory
# ${MYVARIABLE} -eq 1
if [ ! -z "${OPENSSLBINARY}" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
# Check first if any dependency. If it doesn't meet, the test will be skipped after registration (SKIPTEST == 1)
#
# Examples:
# -f /etc/file = Test if file exists
# -d /var/run/mydirectory = Test if directory exists
# ${MYVARIABLE} -eq 1 = Test if variable is set to 1
# "${MYVARIABLE}" = "Value" = Test if variable is equal to specific value
# * Test registration
if [ -f /etc/myfile ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
# * Registration of Test
# ------------------------
#
# Register the test, with custom ID CUST-0010, and only execute it when the prerequisites were met
Register --test-no CUST-0010 --preqs-met ${PREQS_MET} --weight L --network NO --description "My description of what this test does"
Register --test-no CUST-0010 --preqs-met ${PREQS_MET} --weight L --network NO --description "Description of what this test does"
# Or you could use this one without any dependencies
# Register --test-no CUST-0010 --weight L --network NO --description "My description"
# Or we could use this test without any dependencies
# Register --test-no CUST-0010 --weight L --network NO --description "Description of what this test does"
# If everything is fine, perform test
if [ ${SKIPTEST} -eq 0 ]; then