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:
authorMichael Boelen <michael.boelen@cisofy.com>2016-07-24 18:22:00 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-07-24 18:22:00 +0300
commit2f4c854ba7790d1c8fb8c664daea6c971f18aa72 (patch)
treec3eed34233a165d56df1173b3f08e047b47ae47e /include/functions
parent0b5af4ed387ea0582181e56a56609c4a633cb91f (diff)
Rename of categories, introduction of groups
Diffstat (limited to 'include/functions')
-rw-r--r--include/functions32
1 files changed, 29 insertions, 3 deletions
diff --git a/include/functions b/include/functions
index 9d0526be..f40997d9 100644
--- a/include/functions
+++ b/include/functions
@@ -83,7 +83,8 @@
# ShowSymlinkPath Show a path behind a symlink
# SkipAtomicTest Test if a subtest needs to be skipped
# TestValue Evaluate a value in a string or key
-# ViewCategories Display tests categories
+# ViewCategories Show available category of tests
+# ViewGroups Display test groups
# WaitForKeyPress Wait for user to press a key to continue
#
#################################################################################
@@ -1743,10 +1744,14 @@
# Do not insert a log break, if previous test was not logged
if [ ${SKIPLOGTEST} -eq 0 ]; then LogTextBreak; fi
ROOT_ONLY=0; SKIPTEST=0; SKIPLOGTEST=0; TEST_NEED_OS=""; PREQS_MET=""
- TEST_NEED_NETWORK=""; TEST_NEED_PLATFORM=""
+ TEST_CATEGORY=""; TEST_NEED_NETWORK=""; TEST_NEED_PLATFORM=""
TOTAL_TESTS=$((TOTAL_TESTS + 1))
while [ $# -ge 1 ]; do
case $1 in
+ --category)
+ shift
+ TEST_CATEGORY=$1
+ ;;
--description)
shift
TEST_DESCRIPTION=$1
@@ -1837,6 +1842,11 @@
fi
fi
+ # Skip test when it belongs to another category (default is 'all')
+ if [ ${SKIPTEST} -eq 0 -a ! -z "${TEST_CATEGORY_TO_CHECK}" -a ! "${TEST_CATEGORY_TO_CHECK}" = "all" -a ! "${TEST_CATEGORY}" = "${TEST_CATEGORY_TO_CHECK}" ]; then
+ SKIPTEST=1; SKIPREASON="Incorrect category (${TEST_CATEGORY_TO_CHECK} only)"
+ fi
+
# Check for correct hardware platform
if [ ${SKIPTEST} -eq 0 -a ! -z "${TEST_NEED_PLATFORM}" -a ! "${HARDWARE}" = "${TEST_NEED_PLATFORM}" ]; then SKIPTEST=1; SKIPREASON="Incorrect hardware platform"; fi
@@ -2529,8 +2539,24 @@
################################################################################
ViewCategories() {
+ for CATEGORY in ${TEST_AVAILABLE_CATEGORIES}; do echo "${CATEGORY}"; done
+ echo ""
+ ExitClean
+ }
+
+
+ ################################################################################
+ # Name : ViewGroups()
+ # Description : Show what group of tests are available
+ #
+ # Input : <nothing>
+ # Returns : <nothing>
+ # Usage : ViewGroups
+ ################################################################################
+
+ ViewGroups() {
if [ ! "${INCLUDEDIR}" = "" ]; then
- InsertSection "Available test categories"
+ InsertSection "Available test groups"
for I in `ls ${INCLUDEDIR}/tests_* | xargs -n 1 basename | sed 's/tests_//' | grep -v "custom.template"`; do
echo "${I}"
done