Fix Adminer tests

This commit is contained in:
cytopia 2019-12-08 11:11:37 +01:00
parent e2930d2b4e
commit 4ac8eb17d2
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
3 changed files with 42 additions and 19 deletions

File diff suppressed because one or more lines are too long

View File

@ -81,19 +81,42 @@ fi
###
### Test Adminer MongoDB login
### Test Adminer Mongo login
###
printf "[TEST] Adminer Mongo login"
if ! run "\
curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}${URL}?mongo=mongo&username=' \
curl -sS --fail -c cookie.txt -b cookie.txt \
-L \
--data 'auth[driver]=mongo' \
--data 'auth[server]=mongo' \
--data 'auth[username]=' \
--data 'auth[password]=' \
--data 'auth[db]=' \
'http://localhost:${HOST_PORT_HTTPD}${URL}?mongo=mongo&username=' \
| tac \
| tac \
| grep -Ei 'Database.+Collation.+Tables' >/dev/null" \
"${RETRIES}" "" "0"; then
printf "\\r[FAIL] Adminer Mongo login\\n"
run "curl -sS 'http://localhost:${HOST_PORT_HTTPD}${URL}?mongo=mongo&username=' || true"
run "curl -sS -I 'http://localhost:${HOST_PORT_HTTPD}${URL}?mongo=mongo&username=' || true"
printf "\\r[FAIL] Adminer MySQL login\\n"
run "curl -sS -c cookie.txt -b cookie.txt \
-L \
--data 'auth[driver]=mongo' \
--data 'auth[server]=mongo' \
--data 'auth[username]=' \
--data 'auth[password]=' \
--data 'auth[db]=' \
'http://localhost:${HOST_PORT_HTTPD}${URL}?server=mysql&username=root|| true'" "1"
run "curl -sS -I -c cookie.txt -b cookie.txt \
-L \
--data 'auth[driver]=mongo' \
--data 'auth[server]=mongo' \
--data 'auth[username]=' \
--data 'auth[password]=' \
--data 'auth[db]=' \
'http://localhost:${HOST_PORT_HTTPD}${URL}?server=mysql&username=root|| true'" "1"
rm -f cookie.txt
exit 1
else
printf "\\r[OK] Adminer Mongo login\\n"
printf "\\r[OK] Adminer MySQL login\\n"
fi
rm -f cookie.txt

View File

@ -107,7 +107,7 @@ if ! run "\
--data 'auth[username]=root' \
--data 'auth[password]=${MYSQL_ROOT_PASSWORD}' \
--data 'auth[db]=' \
'http://localhost:${HOST_PORT_HTTPD}${URL}?server=mysql&username=root|| true'" "1"
'http://localhost:${HOST_PORT_HTTPD}${URL}?server=mysql&username=root || true'" "1"
run "curl -sS -I -c cookie.txt -b cookie.txt \
-L \
--data 'auth[driver]=server' \
@ -115,7 +115,7 @@ if ! run "\
--data 'auth[username]=root' \
--data 'auth[password]=${MYSQL_ROOT_PASSWORD}' \
--data 'auth[db]=' \
'http://localhost:${HOST_PORT_HTTPD}${URL}?server=mysql&username=root|| true'" "1"
'http://localhost:${HOST_PORT_HTTPD}${URL}?server=mysql&username=root || true'" "1"
rm -f cookie.txt
exit 1
else