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