From 17c44ced52c7d503e78ab52034d20dcfa010b8d4 Mon Sep 17 00:00:00 2001 From: mboelen Date: Wed, 22 Jul 2015 14:57:57 +0200 Subject: Include examples and clarify usage --- include/tests_custom.template | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/include/tests_custom.template b/include/tests_custom.template index 900d7711..73cbc9ff 100644 --- a/include/tests_custom.template +++ b/include/tests_custom.template @@ -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 + + if [ -f /etc/myfile ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi - # * Test registration + # * 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 -- cgit v1.2.3