diff --git a/include/tests_custom.template b/include/tests_custom.template index 14c6ae75..900d7711 100644 --- a/include/tests_custom.template +++ b/include/tests_custom.template @@ -29,25 +29,46 @@ ################################################################################# # # Test : CUST-0010 + # Author : Your name # Description : Check for something interesting - template - # This test first checks if OpenSSL binary was found + # Notes : This test first checks if OpenSSL binary was found + + # * 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 - Register --test-no CUST-0010 --preqs-met ${PREQS_MET} --weight L --network NO --description "My description" + + # * Test registration + # + # 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" + # Or you could use this one without any dependencies # Register --test-no CUST-0010 --weight L --network NO --description "My description" + + # If everything is fine, perform test if [ ${SKIPTEST} -eq 0 ]; then FOUND=0 logtext "Test: checking something" - ReportWarning ${TEST_NO} "M" "Test warning" if [ ${FOUND} -eq 0 ]; then - Display --indent 4 --text "- Performing custom test 1" --result OK --color GREEN - logtext "Result: the test looks great!" + Display --indent 4 --text "- Performing custom test" --result OK --color GREEN + logtext "Result: the test result looks great!" + + # Optional: create a suggestion after a specific finding + #ReportSuggestion "${TEST_NO}" "This is my suggestion to improve the system even further." + else - Display --indent 4 --text "- Performing custom test 1" --result WARNING --color RED - logtext "Result: hmm bad result of this test :(" - ReportSuggestion ${TEST_NO} "This could be better!" + Display --indent 4 --text "- Performing custom test" --result WARNING --color RED + logtext "Result: this test had a bad result :(" + # Throw a warning to the screen and report + ReportWarning ${TEST_NO} "M" "This is a warning message" fi fi + # ################################################################################# #