From 4f382331b3d7d141c49a971050d3a9b61a94c511 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 10 Feb 2022 14:26:38 +0100 Subject: [PATCH] Renumbered new test PKGS-7346 to PKGS-7200 --- include/tests_ports_packages | 56 ++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/include/tests_ports_packages b/include/tests_ports_packages index 54d849e2..9ca1948d 100644 --- a/include/tests_ports_packages +++ b/include/tests_ports_packages @@ -34,6 +34,34 @@ Display --indent 2 --text "- Searching package managers" # ################################################################################# +# + # Test : PKGS-7200 + # Description : Check Alpine Package Keeper (apk) + if [ -x ${ROOTDIR}/sbin/apk ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi + Register --test-no PKGS-7200 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Querying apk" + if [ ${SKIPTEST} -eq 0 ]; then + COUNT=0 + Display --indent 4 --text "- Searching apk package manager" --result "${STATUS_FOUND}" --color GREEN + LogText "Result: Found apk binary" + Report "package_manager[]=apk" + PACKAGE_MGR_PKG=1 + LogText "Test: Querying apk info -v to get package list" + Display --indent 6 --text "- Querying package manager" + LogText "Output:" + SPACKAGES=$(apk info -v | ${SEDBINARY} -r -e 's/([a-z,A-Z,0-9,_,-,.]{1,250})-([a-z,A-Z,0-9,.]+-r[a-z,A-Z,0-9]+)/\1,\2/' | sort) + for J in ${SPACKAGES}; do + COUNT=$((COUNT + 1)) + PACKAGE_NAME=$(echo ${J} | ${CUTBINARY} -d ',' -f1) + PACKAGE_VERSION=$(echo ${J} | ${CUTBINARY} -d ',' -f2) + LogText "Found package: ${PACKAGE_NAME} (version: ${PACKAGE_VERSION})" + INSTALLED_PACKAGES="${INSTALLED_PACKAGES}|${PACKAGE_NAME},${PACKAGE_VERSION}" + done + Report "installed_packages=${COUNT}" + else + LogText "Result: apk "${STATUS_NOT_FOUND}", test skipped" + fi +# +################################################################################# # # Test : PKGS-7301 # Description : Query FreeBSD pkg @@ -466,34 +494,6 @@ fi # ################################################################################# -# - # Test : PKGS-7346 - # Description : Check Alpine Package Keeper (apk) - if [ -x ${ROOTDIR}/sbin/apk ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi - Register --test-no PKGS-7346 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Querying apk" - if [ ${SKIPTEST} -eq 0 ]; then - COUNT=0 - Display --indent 4 --text "- Searching apk package manager" --result "${STATUS_FOUND}" --color GREEN - LogText "Result: Found apk binary" - Report "package_manager[]=apk" - PACKAGE_MGR_PKG=1 - LogText "Test: Querying apk info -v to get package list" - Display --indent 6 --text "- Querying package manager" - LogText "Output:" - SPACKAGES=$(apk info -v | ${SEDBINARY} -r -e 's/([a-z,A-Z,0-9,_,-,.]{1,250})-([a-z,A-Z,0-9,.]+-r[a-z,A-Z,0-9]+)/\1,\2/' | sort) - for J in ${SPACKAGES}; do - COUNT=$((COUNT + 1)) - PACKAGE_NAME=$(echo ${J} | ${CUTBINARY} -d ',' -f1) - PACKAGE_VERSION=$(echo ${J} | ${CUTBINARY} -d ',' -f2) - LogText "Found package: ${PACKAGE_NAME} (version: ${PACKAGE_VERSION})" - INSTALLED_PACKAGES="${INSTALLED_PACKAGES}|${PACKAGE_NAME},${PACKAGE_VERSION}" - done - Report "installed_packages=${COUNT}" - else - LogText "Result: apk "${STATUS_NOT_FOUND}", test skipped" - fi -# -################################################################################# # # Test : PKGS-7346 # Description : Check packages which are removed, but still own configuration files, cron jobs etc