diff options
author | mboelen <michael@cisofy.com> | 2015-07-22 15:57:57 +0300 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2015-07-22 15:57:57 +0300 |
commit | 17c44ced52c7d503e78ab52034d20dcfa010b8d4 (patch) | |
tree | 9c10bdb606d719fd8a20ae86ba253d77ac07ccdc /include/tests_custom.template | |
parent | 8f9a61685457c92bbce9eb095b01cb0ddbfc1033 (diff) |
Include examples and clarify usage
Diffstat (limited to 'include/tests_custom.template')
-rw-r--r-- | include/tests_custom.template | 27 |
1 files 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 |