feat: Rewrite test_isos function for one OS only

dirty
This commit is contained in:
zen0bit 2024-04-23 01:29:32 +02:00 committed by Martin Wimpress
parent 76521b9479
commit 113bc2a3c9
1 changed files with 35 additions and 39 deletions

View File

@ -430,11 +430,10 @@ function list_isos() {
} }
function test_isos() { function test_isos() {
local testIsoUrl=on
local DIR="/dev/null" local DIR="/dev/null"
local FUNC local FUNC
local OPTION local OPTION
local OS local OS="${1}"
check_it() { check_it() {
validate_release releases_"${OS}" validate_release releases_"${OS}"
@ -442,15 +441,13 @@ function test_isos() {
GOOD=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL') GOOD=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL')
} }
for OS in $(os_support); do if [[ "${OS}" == *ubuntu-server* ]]; then
local GOOD="" FUNC="ubuntu-server"
elif [[ "${OS}" == *ubuntu* ]]; then
case "${OS}" in FUNC="ubuntu"
*ubuntu-server*) FUNC="ubuntu-server";; else
*ubuntu*) FUNC="ubuntu";; FUNC="${OS}"
*) FUNC="${OS}";; fi
esac
for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases
if [[ $(type -t "editions_${OS}") == function ]]; then if [[ $(type -t "editions_${OS}") == function ]]; then
for OPTION in $(editions_"${OS}"); do for OPTION in $(editions_"${OS}"); do
@ -460,7 +457,7 @@ function test_isos() {
# skipping because of microsoft # skipping because of microsoft
"languages_${OS}" "languages_${OS}"
for OPTION in "${LANGS[@]}"; do for OPTION in "${LANGS[@]}"; do
GOOD='FAIL' GOOD='FAIL!'
done done
elif [[ "${OS}" == *"ubuntu"* ]]; then elif [[ "${OS}" == *"ubuntu"* ]]; then
URL=$(get_"${OS}" ) URL=$(get_"${OS}" )
@ -474,13 +471,12 @@ function test_isos() {
GOOD=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL') GOOD=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL')
fi fi
if [[ "${GOOD}" == "PASS" ]]; then if [[ "${GOOD}" == "OK" ]]; then
echo "PASS - ${OS} ${RELEASE} ${OPTION} ${URL}" echo "OK - ${OS} ${RELEASE} ${OPTION} ${URL}"
else else
echo "FAIL - ${OS} ${RELEASE} ${OPTION} ${URL}" echo "ERROR - ${OS} ${RELEASE} ${OPTION} ${URL}"
fi fi
done done
done
exit 0 exit 0
} }