Verified Commit c4ba1fb8 authored by Dmytro Bogatov's avatar Dmytro Bogatov 💕

Test new domains.

parent 0a266ec9
......@@ -43,6 +43,9 @@ declare -A DOMAINS
AVALUE="dolores-workers.digital-ocean.dbogatov.org"
DOMAINS["dbogatov.org"]=$AVALUE
DOMAINS["dmytro.app"]=$AVALUE
DOMAINS["bogatov.app"]=$AVALUE
DOMAINS["bogatov.kiev.ua"]=$AVALUE
DOMAINS["darinagulley.com"]=$AVALUE
DOMAINS["moon-travel.com.ua"]=$AVALUE
......
......@@ -6,51 +6,94 @@ shopt -s globstar
declare -A DOMAINS
# Have not decided what the value should mean...
# Value means expected code
DOMAINS["dbogatov.org"]=true
DOMAINS["status.dbogatov.org"]=false
DOMAINS["blog.dbogatov.org"]=false
DOMAINS["legacy.dbogatov.org"]=false
DOMAINS["push.dbogatov.org"]=false
DOMAINS["socialimps.dbogatov.org"]=false
DOMAINS["mail.dbogatov.org"]=false
DOMAINS["dns.dbogatov.org"]=false
DOMAINS["dashboard.dbogatov.org"]=false
SUCCESS="200"
PERMANENT_REDIRECT="301"
FOUND="302"
SERVICE_UNABAILBALE="503"
DOMAINS["bogatov.kiev.ua"]=true
DOMAINS["blog.bogatov.kiev.ua"]=false
MAIN=("dbogatov.org" "dmytro.app" "bogatov.app")
DOMAINS["visasupport.com.ua"]=true
DOMAINS["zima.visasupport.com.ua"]=false
DOMAINS["__MAIN__"]=$SUCCESS
DOMAINS["status.__MAIN__"]=$SERVICE_UNABAILBALE
DOMAINS["blog.__MAIN__"]=$SUCCESS
DOMAINS["legacy.__MAIN__"]=$SUCCESS
DOMAINS["push.__MAIN__"]=$SUCCESS
DOMAINS["socialimps.__MAIN__"]=$SUCCESS
DOMAINS["mail.__MAIN__"]=$SUCCESS
DOMAINS["dns.__MAIN__"]=$SUCCESS
DOMAINS["visasupport.kiev.ua"]=true
DOMAINS["eu.visasupport.kiev.ua"]=false
DOMAINS["lp.visasupport.kiev.ua"]=false
DOMAINS["darinagulley.com"]=true
DOMAINS["dashboard.dbogatov.org"]=$FOUND
DOMAINS["moon-travel.com.ua"]=true
DOMAINS["bogatov.kiev.ua"]=$SUCCESS
DOMAINS["blog.bogatov.kiev.ua"]=$SUCCESS
DOMAINS["nigmatullina.org"]=true
DOMAINS["visasupport.com.ua"]=$SUCCESS
DOMAINS["zima.visasupport.com.ua"]=$SUCCESS
DOMAINS["photobarrat.com"]=true
DOMAINS["visasupport.kiev.ua"]=$SUCCESS
DOMAINS["eu.visasupport.kiev.ua"]=$SUCCESS
DOMAINS["lp.visasupport.kiev.ua"]=$SUCCESS
DOMAINS["shevastream.com/home"]=true
DOMAINS["darinagulley.com"]=$SUCCESS
DOMAINS["travelus.com.ua"]=true
DOMAINS["moon-travel.com.ua"]=$PERMANENT_REDIRECT
DOMAINS["veles-russia.com"]=true
DOMAINS["nigmatullina.org"]=$SUCCESS
DOMAINS["visajapan.com.ua"]=true
DOMAINS["photobarrat.com"]=$SUCCESS
DOMAINS["vleskniga.com"]=true
DOMAINS["shevastream.com/home"]=$SUCCESS
DOMAINS["travelus.com.ua"]=$SUCCESS
DOMAINS["veles-russia.com"]=$SUCCESS
DOMAINS["visajapan.com.ua"]=$SUCCESS
DOMAINS["vleskniga.com"]=$SUCCESS
PASSED=true
for domain in "${!DOMAINS[@]}"
do
code=$(curl -s -o /dev/null -I -w "%{http_code}" https://$domain)
echo "$code : $domain"
URLS=()
if [[ $domain = *"__MAIN__"* ]]
then
for main in ${MAIN[@]}
do
URLS+=(${domain/__MAIN__/$main})
done
else
URLS+=($domain)
fi
for url in ${URLS[@]}
do
code=$(curl -s -o /dev/null -I -w "%{http_code}" https://$url)
if [ $code == "${DOMAINS[${domain}]}" ]
then
RESULT="PASS"
else
RESULT="FAIL"
PASSED=false
fi
echo "$RESULT ($code) : $url"
done
done
echo "Done!"
echo "Tests complete."
if [ $PASSED == true ]
then
echo "All tests passed!"
exit 0
else
echo "Some tests failed..."
exit 1
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment