diff --git a/test/33-ftp.bats b/test/33-ftp.bats index 7c35f96..59297c0 100644 --- a/test/33-ftp.bats +++ b/test/33-ftp.bats @@ -18,7 +18,7 @@ setup() { pasv_enable=NO _FTP - ${CODE_DIR}/test/restart-ftpd + ${CODE_DIR}/test/restart-ftpd start fi } @@ -27,7 +27,7 @@ teardown() { [ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip if [ -n "${VSFTPD_CONF}" ]; then cp ${VSFTPD_CONF}.getssl $VSFTPD_CONF - ${CODE_DIR}/test/restart-ftpd + ${CODE_DIR}/test/restart-ftpd stop fi } diff --git a/test/34-ftp-passive.bats b/test/34-ftp-passive.bats index 5648771..71e6ed0 100644 --- a/test/34-ftp-passive.bats +++ b/test/34-ftp-passive.bats @@ -21,7 +21,7 @@ pasv_min_port=10090 connect_from_port_20=NO _FTP - ${CODE_DIR}/test/restart-ftpd + ${CODE_DIR}/test/restart-ftpd start fi } @@ -30,7 +30,7 @@ teardown() { [ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip if [ -n "${VSFTPD_CONF}" ]; then cp ${VSFTPD_CONF}.getssl $VSFTPD_CONF - ${CODE_DIR}/test/restart-ftpd + ${CODE_DIR}/test/restart-ftpd stop fi } diff --git a/test/restart-ftpd b/test/restart-ftpd index 5bdc3cd..6bb780c 100755 --- a/test/restart-ftpd +++ b/test/restart-ftpd @@ -1,11 +1,17 @@ #!/usr/bin/env bash +if [ -z "$1" ]; then + arg="restart" +else + arg=$1 +fi + if [ "$GETSSL_OS" = "alpine" ]; then killall -HUP vsftpd >&3- elif [[ "$GETSSL_OS" == "centos"[78] || "$GETSSL_OS" == "rockylinux"* ]]; then pgrep vsftpd | head -1 | xargs kill -HUP elif [[ "$GETSSL_OS" == "centos6" ]]; then - service vsftpd restart >&3- >/dev/null + service vsftpd "$arg" else service vsftpd restart >/dev/null >&3- fi diff --git a/test/restart-nginx b/test/restart-nginx index ca402f3..ee49af4 100755 --- a/test/restart-nginx +++ b/test/restart-nginx @@ -7,7 +7,8 @@ elif [[ "$GETSSL_OS" == "centos"[78] || "$GETSSL_OS" == "rockylinux"* ]]; then pgrep nginx | head -1 | xargs kill -HUP sleep 5 elif [[ "$GETSSL_OS" == "centos6" ]]; then - service nginx restart >&3- >/dev/null + service nginx restart 3>&- + # service nginx restart else service nginx restart >/dev/null >&3- fi diff --git a/test/test_helper.bash b/test/test_helper.bash index efc52fa..e8d68b0 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -74,10 +74,10 @@ if [[ -f /usr/bin/supervisord && -f /etc/supervisord.conf ]]; then fi elif [[ "$GETSSL_OS" == "centos"[78] || "$GETSSL_OS" == "rockylinux"* ]]; then if [ -z "$(pgrep nginx)" ]; then - nginx >&3- + nginx 3>&- fi if [ -z "$(pgrep vsftpd)" ] && [ "$(command -v vsftpd)" ]; then - vsftpd >&3- + vsftpd 3>&- fi fi