diff options
Diffstat (limited to 'include/tests_ports_packages')
-rw-r--r-- | include/tests_ports_packages | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/include/tests_ports_packages b/include/tests_ports_packages index 7693a0e6..f4d2680c 100644 --- a/include/tests_ports_packages +++ b/include/tests_ports_packages @@ -24,7 +24,7 @@ # ################################################################################# # - Display --indent 2 --text "- Searching package managers..." + Display --indent 2 --text "- Searching package managers" # Test : PKGS-7301 # Description : Query FreeBSD pkg @@ -33,12 +33,12 @@ if [ ${SKIPTEST} -eq 0 ]; then FIND=`pkg -N 2>&1; echo $?` if [ "${FIND}" = "0" ]; then - Display --indent 4 --text "- Searching packages with pkg..." --result FOUND --color GREEN + Display --indent 4 --text "- Searching packages with pkg" --result FOUND --color GREEN report "package_manager[]=pkg" PACKAGE_MGR_PKG=1 #logtext "Result: Found pkg" - #logtext "Test: Querying pkg to get package list..." - #Display --indent 6 --text "- Querying pkg for installed packages..." + #logtext "Test: Querying pkg to get package list" + #Display --indent 6 --text "- Querying pkg for installed packages" #logtext "Output:"; logtext "-----" #SPACKAGES=`/usr/sbin/pkg_info 2>&1 | sort | tr -s ' ' | cut -d ' ' -f1 | sed -e 's/^\(.*\)-\([0-9].*\)$/\1,\2/g'` #for J in ${SPACKAGES}; do @@ -48,7 +48,7 @@ # report "installed_package[]=${sPKG_NAME}|${sPKG_VERSION}|" #done else - Display --indent 4 --text "- Searching pkg..." --result "NOT INSTALLED" --color YELLOW + Display --indent 4 --text "- Searching pkg" --result "NOT INSTALLED" --color YELLOW fi fi # @@ -60,11 +60,11 @@ Register --test-no PKGS-7302 --preqs-met ${PREQS_MET} --weight L --network NO --description "Query FreeBSD/NetBSD pkg_info" if [ ${SKIPTEST} -eq 0 ]; then N=0 - Display --indent 4 --text "- Checking pkg_info..." --result FOUND --color GREEN + Display --indent 4 --text "- Checking pkg_info" --result FOUND --color GREEN logtext "Result: Found pkg_info" report "package_manager[]=pkg_info" - logtext "Test: Querying pkg_info to get package list..." - Display --indent 6 --text "- Querying pkg_info for installed packages..." + logtext "Test: Querying pkg_info to get package list" + Display --indent 6 --text "- Querying pkg_info for installed packages" logtext "Output:"; logtext "-----" SPACKAGES=`/usr/sbin/pkg_info 2>&1 | sort | tr -s ' ' | cut -d ' ' -f1 | sed -e 's/^\(.*\)-\([0-9].*\)$/\1,\2/g'` for J in ${SPACKAGES}; do @@ -88,10 +88,10 @@ # if [ ${SKIPTEST} -eq 0 ]; then # SDOUBLEINSTALLED=`pkg_info | sort | sed -e 's/-[0-9].*$//' | uniq -c | grep -v '^[[:space:]]*1' | tr -s ' ' | cut -d ' ' -f3` # if [ "${SDOUBLEINSTALLED}" = "" ]; then -# Display --indent 6 --text "- Querying pkg_info for double installed packages..." --result OK --color GREEN +# Display --indent 6 --text "- Querying pkg_info for double installed packages" --result OK --color GREEN # logtext "Ok, no packages show up twice or more in the package listing." # else -# Display --indent 6 --text "- Querying pkg_info for double installed packages..." --result WARNING --color RED +# Display --indent 6 --text "- Querying pkg_info for double installed packages" --result WARNING --color RED # for J in ${SDOUBLEINSTALLED}; do # ReportWarning ${TEST_NO} "M" "Found probably incorrect installed package (${J})" # logtext "This package ${J} is visible twice or more in the pkg_info listing." @@ -102,7 +102,7 @@ # done # fi # else -# Display --indent 4 --text "- Searching pkg_info..." --result "NOT FOUND" --color WHITE +# Display --indent 4 --text "- Searching pkg_info" --result "NOT FOUND" --color WHITE # logtext "Result: pkg_info can NOT be found on this system" # fi # @@ -113,11 +113,11 @@ if [ -x /usr/bin/pkginfo ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi Register --test-no PKGS-7306 --os Solaris --preqs-met ${PREQS_MET} --weight L --network NO --description "Querying Solaris packages" if [ ${SKIPTEST} -eq 0 ]; then - Display --indent 4 --text "- Searching pkginfo..." --result FOUND --color GREEN + Display --indent 4 --text "- Searching pkginfo" --result FOUND --color GREEN logtext "Result: Found Solaris pkginfo" report "package_manager[]=pkginfo" logtext "Test: Querying pkginfo to get package list" - Display --indent 4 --text "- Querying pkginfo for installed packages..." + Display --indent 4 --text "- Querying pkginfo for installed packages" logtext "Output:"; logtext "-----" # Strip SUNW from strings SPACKAGES=`/usr/bin/pkginfo -i | tr -s ' ' | cut -d ' ' -f2 | sed "s#^SUNW##"` @@ -138,11 +138,11 @@ Register --test-no PKGS-7308 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking package list with RPM" if [ ${SKIPTEST} -eq 0 ]; then N=0 - Display --indent 4 --text "- Searching RPM package manager..." --result FOUND --color GREEN + Display --indent 4 --text "- Searching RPM package manager" --result FOUND --color GREEN logtext "Result: Found rpm binary (${RPMBINARY})" report "package_manager[]=rpm" logtext "Test: Querying 'rpm -qa' to get package list" - Display --indent 6 --text "- Querying RPM package manager..." + Display --indent 6 --text "- Querying RPM package manager" logtext "Output:"; logtext "--------" SPACKAGES=`${RPMBINARY} -qa | sort` if [ "${SPACKAGES}" = "" ]; then @@ -169,11 +169,11 @@ Register --test-no PKGS-7310 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking package list with pacman" if [ ${SKIPTEST} -eq 0 ]; then N=0 - Display --indent 4 --text "- Searching pacman package manager..." --result FOUND --color GREEN + Display --indent 4 --text "- Searching pacman package manager" --result FOUND --color GREEN logtext "Result: Found pacman binary (${PACMANBINARY})" report "package_manager[]=pacman" logtext "Test: Querying 'pacman -Q' to get package list" - Display --indent 6 --text "- Querying pacman package manager..." + Display --indent 6 --text "- Querying pacman package manager" logtext "Output:"; logtext "--------" SPACKAGES=`${PACMANBINARY} -Q | sort | sed 's/ /,/g'` if [ "${SPACKAGES}" = "" ]; then @@ -266,7 +266,7 @@ logtext "Result: Found dpkg binary" report "package_manager[]=dpkg" logtext "Test: Querying dpkg -l to get package list" - Display --indent 6 --text "- Querying package manager..." + Display --indent 6 --text "- Querying package manager" logtext "Output:" SPACKAGES=`dpkg -l 2>/dev/null | grep "^ii" | tr -s ' ' | tr ' ' '#' | sort` for J in ${SPACKAGES}; do @@ -403,7 +403,7 @@ # Don't check yet, output of found vulnerable packages unclear (YYY) else logtext "Result: ${FIND}" - #Display --indent 2 --text "- Checking pkg audit to obtain vulnerable packages..." --result WARNING --color RED + #Display --indent 2 --text "- Checking pkg audit to obtain vulnerable packages" --result WARNING --color RED #logtext "Result: pkg audit found one or more installed packages which are vulnerable." #ReportWarning ${TEST_NO} "M" "Found one or more vulnerable packages." #ReportSuggestion ${TEST_NO} "Update your system with portupgrade or other tools" @@ -593,7 +593,7 @@ # Test : PKGS-7388 # Description : Check security repository in Debian/ubuntu apt sources.list file if [ -f /etc/apt/sources.list -a -d /etc/apt/sources.list.d ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi - Register --test-no PKGS-7388 --os preqs-met ${PREQS_MET} --weight L --network NO --description "Check security repository in Debian/ubuntu apt sources.list file" + Register --test-no PKGS-7388 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check security repository in Debian/ubuntu apt sources.list file" if [ $SKIPTEST -eq 0 ]; then FOUND=0 if [ ! "${OPTION_DEBIAN_SKIP_SECURITY_REPOSITORY}" = "yes" ]; then @@ -646,11 +646,11 @@ logtext "Test: Package database consistency by running apt-get check" FIND=`/usr/bin/apt-get -q=2 check 2> /dev/null; echo $?` if [ "${FIND}" = "0" ]; then - Display --indent 2 --text "- Checking APT package database..." --result OK --color GREEN + Display --indent 2 --text "- Checking APT package database" --result OK --color GREEN logtext "Result: package database seems to be consistent." else logtext "Result: package database is most likely NOT consistent" - Display --indent 2 --text "- Checking APT package database..." --result WARNING --color RED + Display --indent 2 --text "- Checking APT package database" --result WARNING --color RED ReportWarning ${TEST_NO} "M" "apt-get check returned a non successful exit code." ReportSuggestion ${TEST_NO} "Run apt-get to perform a manual package database consistency check." fi @@ -701,7 +701,7 @@ # Show packages which would be upgraded and match 'security' in repository name FIND=`/usr/bin/apt-get --dry-run --show-upgraded upgrade 2> /dev/null | grep '-security' | grep "^Inst" | cut -d ' ' -f2 | sort | uniq` if [ ! "${FIND}" = "" ]; then - #Display --indent 2 --text "- Checking vulnerable packages..." --result WARNING --color RED + #Display --indent 2 --text "- Checking vulnerable packages" --result WARNING --color RED VULNERABLE_PACKAGES_FOUND=1 SCAN_PERFORMED=1 logtext "Result: found vulnerable package(s) via apt-get (-security channel)" @@ -716,13 +716,13 @@ if [ ${VULNERABLE_PACKAGES_FOUND} -eq 1 ]; then ReportWarning ${TEST_NO} "M" "Found one or more vulnerable packages." ReportSuggestion ${TEST_NO} "Update your system with apt-get update, apt-get upgrade, apt-get dist-upgrade and/or unattended-upgrades" - Display --indent 2 --text "- Checking vulnerable packages..." --result WARNING --color RED + Display --indent 2 --text "- Checking vulnerable packages" --result WARNING --color RED else - Display --indent 2 --text "- Checking vulnerable packages..." --result OK --color GREEN + Display --indent 2 --text "- Checking vulnerable packages" --result OK --color GREEN logtext "Result: no vulnerable packages found" fi else - Display --indent 2 --text "- Checking vulnerable packages (apt-get only)..." --result DONE --color GREEN + Display --indent 2 --text "- Checking vulnerable packages (apt-get only)" --result DONE --color GREEN logtext "Result: test not fully executed (missing apt-check output)" fi fi @@ -741,11 +741,11 @@ FIND=`/usr/bin/apt-show-versions -u | sed 's/ /!space!/g'` if [ "${FIND}" = "" ]; then logtext "Result: no packages found which can be upgraded" - Display --indent 2 --text "- Checking upgradeable packages..." --result NONE --color GREEN + Display --indent 2 --text "- Checking upgradeable packages" --result NONE --color GREEN AddHP 3 3 else logtext "Result: found one or more packages which can be upgraded" - Display --indent 2 --text "- Checking upgradeable packages..." --result FOUND --color YELLOW + Display --indent 2 --text "- Checking upgradeable packages" --result FOUND --color YELLOW # output: program/repository upgradeable from version X to Y for I in ${FIND}; do I=`echo ${I} | sed 's/!space!/ /g'` @@ -754,7 +754,7 @@ fi else logtext "Result: /usr/bin/apt-show-versions not found" - Display --indent 2 --text "- Checking upgradeable packages..." --result SKIPPED --color WHITE + Display --indent 2 --text "- Checking upgradeable packages" --result SKIPPED --color WHITE ReportSuggestion ${TEST_NO} "Install package apt-show-versions for patch management purposes" fi fi @@ -768,11 +768,11 @@ if [ ${SKIPTEST} -eq 0 ]; then logtext "Test: checking for package audit tool" if [ ${PKG_AUDIT_TOOL_FOUND} -eq 0 ]; then - Display --indent 2 --text "- Checking package audit tool..." --result NONE --color RED + Display --indent 2 --text "- Checking package audit tool" --result NONE --color RED ReportSuggestion ${TEST_NO} "Install a package audit tool to determine vulnerable packages" logtext "Result: no package audit tool found" else - Display --indent 2 --text "- Checking package audit tool..." --result INSTALLED --color GREEN + Display --indent 2 --text "- Checking package audit tool" --result INSTALLED --color GREEN Display --indent 4 --text "Found: ${PKG_AUDIT_TOOL}" logtext "Result: found package audit tool: ${PKG_AUDIT_TOOL}" fi |