From fda5195be7dc84ad5c2a76d0899e11efed06766f Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 8 Feb 2021 22:45:08 +0100 Subject: Fix logs system and temp dir for tests Signed-off-by: William Desportes --- test/stop-local-server | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/stop-local-server') diff --git a/test/stop-local-server b/test/stop-local-server index f187848f97..d7fb884e06 100755 --- a/test/stop-local-server +++ b/test/stop-local-server @@ -14,6 +14,8 @@ if [ "$CI_MODE" != "selenium" ] ; then 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 @@ -24,3 +26,19 @@ if [ -f ~/selenium-standalone.pid~ ] ; then 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 -- cgit v1.2.3