From 80a41b0c66d9101303c8eb6159c804976421f114 Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Tue, 13 Oct 2026 21:13:04 +0200 Subject: searx: redirect to another instance that actually works --- tests/run-tests.sh | 57 +++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) (limited to 'tests/run-tests.sh') diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 77fabd6..ca931bc 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -32,12 +32,11 @@ do URL="http://$IP:${PORTS[$SERVICE]}/" echo Checking connection to container version of $SERVICE.aristote.fr ... RESULT=$(curl "$URL" $CURL_FLAGS --output /dev/null --write-out '%{http_code}\n') - if [[ ! "$RESULT" = 200 ]] - then - echo "Connection failed." - else - echo "Up and running at $URL !" - fi + case "$RESULT" in + 200) echo "Up and running at $URL !";; + 301) echo "Redirected.";; + *) echo "Connection failed.";; + esac done echo Checking connection to container version of mesh.aristote.fr ... URL="http://$IP:8084/health" @@ -88,29 +87,29 @@ done echo Done. -echo -echo Checking custom Searx engines: -declare -A QUERIES -QUERIES[alternativeto]=Searx -QUERIES[nlab]='Kan%20extension' -QUERIES[wfr]=Paris -QUERIES[wen]=Paris -for ENGINE in "${!QUERIES[@]}" -do - echo Checking engine $ENGINE ... - REQUEST_URL="http://$IP:${PORTS[searx]}/search?q=${QUERIES[$ENGINE]}+!$ENGINE&format=json" - JSON_RESULT=$(curl "$REQUEST_URL" $CURL_FLAGS) - RESULTS=$(echo $JSON_RESULT | jq '.results') - UNRESPONSIVE_ENGINES=$(echo $JSON_RESULT | jq '.unresponsive_engines') - if [[ ! "$UNRESPONSIVE_ENGINES" = '[]' ]] - then - echo "Engine not responsive." - elif [[ "$RESULTS" = [] ]] - then - echo "No results found." - fi -done -echo Done. +# echo +# echo Checking custom Searx engines: +# declare -A QUERIES +# QUERIES[alternativeto]=Searx +# QUERIES[nlab]='Kan%20extension' +# QUERIES[wfr]=Paris +# QUERIES[wen]=Paris +# for ENGINE in "${!QUERIES[@]}" +# do +# echo Checking engine $ENGINE ... +# REQUEST_URL="http://$IP:${PORTS[searx]}/search?q=${QUERIES[$ENGINE]}+!$ENGINE&format=json" +# JSON_RESULT=$(curl "$REQUEST_URL" $CURL_FLAGS) +# RESULTS=$(echo $JSON_RESULT | jq '.results') +# UNRESPONSIVE_ENGINES=$(echo $JSON_RESULT | jq '.unresponsive_engines') +# if [[ ! "$UNRESPONSIVE_ENGINES" = '[]' ]] +# then +# echo "Engine not responsive." +# elif [[ "$RESULTS" = [] ]] +# then +# echo "No results found." +# fi +# done +# echo Done. echo read -n1 -srp "Press any key to stop the server." -- cgit v1.3.1