From ff81e6b897b4d7eb139d9cb1c8440638a6183a54 Mon Sep 17 00:00:00 2001 From: cytopia Date: Mon, 4 Feb 2019 11:22:17 +0100 Subject: [PATCH] Use correct hostnames in check instead of 127.0.0.1 --- .tests/intra-tests/vendor-adminer.sh | 35 ++++++++++++++++------------ 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.tests/intra-tests/vendor-adminer.sh b/.tests/intra-tests/vendor-adminer.sh index 0dd6cfe1..888be607 100755 --- a/.tests/intra-tests/vendor-adminer.sh +++ b/.tests/intra-tests/vendor-adminer.sh @@ -72,16 +72,16 @@ fi printf "[TEST] Adminer MySQL login" # 1st Try -if ! curl -sS "localhost${URL}?server=127.0.0.1&username=root" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then +if ! curl -sS "localhost${URL}?server=mysql&username=root" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then # 2nd Try sleep 1 - if ! curl -sS "localhost${URL}?server=127.0.0.1&username=root" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then + if ! curl -sS "localhost${URL}?server=mysql&username=root" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then # 3rd Try sleep 1 - if ! curl -sS "localhost${URL}?server=127.0.0.1&username=root" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then + if ! curl -sS "localhost${URL}?server=mysql&username=root" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then printf "\r[FAIL] Adminer MySQL login\n" - curl -sS "localhost${URL}?server=127.0.0.1&username=root" || true - curl -sSI "localhost${URL}?server=127.0.0.1&username=root" || true + curl -sS "localhost${URL}?server=mysql&username=root" || true + curl -sSI "localhost${URL}?server=mysql&username=root" || true exit 1 else printf "\r[OK] Adminer MySQL login (3 rounds)\n" @@ -100,16 +100,16 @@ fi printf "[TEST] Adminer PgSQL login" # 1st Try -if ! curl -sS "localhost${URL}?pgsql=127.0.0.1&username=postgres" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then +if ! curl -sS "localhost${URL}?pgsql=pgsql&username=postgres" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then # 2nd Try sleep 1 - if ! curl -sS "localhost${URL}?pgsql=127.0.0.1&username=postgres" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then + if ! curl -sS "localhost${URL}?pgsql=pgsql&username=postgres" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then # 3rd Try sleep 1 - if ! curl -sS "localhost${URL}?pgsql=127.0.0.1&username=postgres" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then + if ! curl -sS "localhost${URL}?pgsql=pgsql&username=postgres" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then printf "\r[FAIL] Adminer PgSQL login\n" - curl -sS "localhost${URL}?pgsql=127.0.0.1&username=postgres" || true - curl -sSI "localhost${URL}?pgsql=127.0.0.1&username=postgres" || true + curl -sS "localhost${URL}?pgsql=pgsql&username=postgres" || true + curl -sSI "localhost${URL}?pgsql=pgsql&username=postgres" || true exit 1 else printf "\r[OK] Adminer PgSQL login (3 rounds)\n" @@ -125,19 +125,24 @@ fi ### ### Test Adminer MongoDB login ### +DISABLED_VERSIONS=("7.3") +if [[ ${DISABLED_VERSIONS[*]} =~ ${PHP_VERSION} ]]; then + echo "Skipping Adminer Mongo login test for PHP 7.3" + exit 0 +fi printf "[TEST] Adminer Mongo login" # 1st Try -if ! curl -sS "localhost${URL}?mongo=127.0.0.1&username=" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then +if ! curl -sS "localhost${URL}?mongo=mongo&username=" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then # 2nd Try sleep 1 - if ! curl -sS "localhost${URL}?mongo=127.0.0.1&username=" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then + if ! curl -sS "localhost${URL}?mongo=mongo&username=" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then # 3rd Try sleep 1 - if ! curl -sS "localhost${URL}?mongo=127.0.0.1&username=" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then + if ! curl -sS "localhost${URL}?mongo=mongo&username=" | tac | tac | grep -Eiq "Database.+Collation.+Tables"; then printf "\r[FAIL] Adminer Mongo login\n" - curl -sS "localhost${URL}?mongo=127.0.0.1&username=" || true - curl -sSI "localhost${URL}?mongo=127.0.0.1&username=" || true + curl -sS "localhost${URL}?mongo=mongo&username=" || true + curl -sSI "localhost${URL}?mongo=mongo&username=" || true exit 1 else printf "\r[OK] Adminer Mongo login (3 rounds)\n"