diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2026-10-13 21:13:04 +0200 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2026-10-13 22:45:44 +0200 |
| commit | 80a41b0c66d9101303c8eb6159c804976421f114 (patch) | |
| tree | 52071bd594608e80d12a2fd12bf0ca3072fef88e /tests/run-tests.sh | |
| parent | 41da7046bff15f1b1ad6d87e44fb037ef8c590ee (diff) | |
| download | hermes-80a41b0c66d9101303c8eb6159c804976421f114.tar.gz hermes-80a41b0c66d9101303c8eb6159c804976421f114.tar.bz2 hermes-80a41b0c66d9101303c8eb6159c804976421f114.tar.xz | |
Diffstat (limited to 'tests/run-tests.sh')
| -rwxr-xr-x | tests/run-tests.sh | 57 |
1 files changed, 28 insertions, 29 deletions
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." |
