phpmyadmin/tests/stop-local-server
Maurício Meneghini Fauth 1d1c55e250
Move test directory to tests
- Related to #18512

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-11-30 10:47:42 -03:00

45 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
set -e
set -x
if [ "$CI_MODE" != "selenium" ] ; then
echo "Not in CI_MODE=selenium"
exit 0
fi
SELENIUM_TEMPDIR="$(cat /tmp/last_temp_dir_phpMyAdminTests)"
if [ ! -z "$TESTSUITE_BROWSERSTACK_KEY" ] ; then
# Stop BrowserStack Local forwarder
~/browserstack/BrowserStackLocal --daemon stop
fi
if [ -f ~/selenium-standalone.pid~ ] ; then
# Stop selenium-standalone server
kill $(cat ~/selenium-standalone.pid~)
rm ~/selenium-standalone.pid~
fi
if [ ! -z "${SELENIUM_TEMPDIR}" ] && [ -f "${SELENIUM_TEMPDIR}/nginx.pid" ]; then
# Stop nginx server
kill $(cat "${SELENIUM_TEMPDIR}/nginx.pid")
fi
if [ ! -z "${SELENIUM_TEMPDIR}" ] && [ -f "${SELENIUM_TEMPDIR}/php-fpm.pid" ]; then
# Stop php-fpm server
kill $(cat "${SELENIUM_TEMPDIR}/php-fpm.pid")
fi
if [ ! -z "${SELENIUM_TEMPDIR}" ] && [ -d "${SELENIUM_TEMPDIR}" ]; then
# Delete the temporary folder
rm -rf "${SELENIUM_TEMPDIR}"
echo "Deleted temporary dir: ${SELENIUM_TEMPDIR}"
fi