Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormboelen <michael@cisofy.com>2015-07-22 15:26:25 +0300
committermboelen <michael@cisofy.com>2015-07-22 15:26:25 +0300
commit8f9a61685457c92bbce9eb095b01cb0ddbfc1033 (patch)
tree89400164d25b712b17e47d828f982d88b2aa0529 /include/tests_custom.template
parent2b1061ef14687d1c1d24c38a73c14bf4f6973d19 (diff)
Add more descriptive text to the template
Diffstat (limited to 'include/tests_custom.template')
-rw-r--r--include/tests_custom.template37
1 files changed, 29 insertions, 8 deletions
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 <e-mail address>
# 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
+
#
#################################################################################
#