From 04a24b69b6212dac4d0584581ec8d4b39f9d9a49 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 3 Aug 2018 23:37:18 +0200 Subject: [PATCH] Skip test for PHP 5.2 --- tests/prod/07-test-mount-custom_fpm_conf.sh | 85 +++++++++------------ 1 file changed, 35 insertions(+), 50 deletions(-) diff --git a/tests/prod/07-test-mount-custom_fpm_conf.sh b/tests/prod/07-test-mount-custom_fpm_conf.sh index fe1b7723..9f81d454 100755 --- a/tests/prod/07-test-mount-custom_fpm_conf.sh +++ b/tests/prod/07-test-mount-custom_fpm_conf.sh @@ -18,6 +18,11 @@ FLAVOUR="${3}" ############################################################ # Tests ############################################################ +if [ "${VERSION}" != "5.2" ]; then + echo "Skipping tests for PHP 5.2" + exit 0 +fi + ### ### Test Nginx with PHP-FPM @@ -34,24 +39,7 @@ PHP_CNF_CONT="/etc/php-fpm-custom.d" CONTAINER="nginx:stable" -if [ "${VERSION}" = "5.2" ]; then - { - echo ''; - echo ''; - echo ' '; - echo '
'; - echo ' '; - echo ' 17M'; - echo ' 17M'; - echo ' 17M'; - echo ' '; - echo '
'; - echo '
'; - echo '
'; - } > "${PHP_CNF_HOST}/post.conf" -else - printf "[www]\nphp_admin_value[memory_limit] = 17M\n" > "${PHP_CNF_HOST}/post.conf" -fi +printf "[www]\nphp_admin_value[memory_limit] = 17M\n" > "${PHP_CNF_HOST}/post.conf" echo " "${DOC_ROOT_HOST}/index.php" # Fix mount permissions @@ -139,38 +127,35 @@ fi # Check modified php-fpm.conf -# Does not work with PHP 5.2 -if [ "${VERSION}" != "5.2" ]; then - if ! run "curl -q -4 http://127.0.0.1:${WWW_PORT}/index.php 2>/dev/null | grep memory_limit | grep '17M'"; then - # Info - run "netstat -tuln" - run "curl -4 http://127.0.0.1:${WWW_PORT}/index.php | grep memory_limit" || true - run "docker ps --no-trunc" - docker_exec "${ndid}" "nginx -t" - - # Show logs - docker_logs "${ndid}" || true - docker_logs "${did}" || true - - # Ensure file is available - docker_exec "${ndid}" "ls -la ${DOC_ROOT_CONT}/" - docker_exec "${did}" "ls -la ${DOC_ROOT_CONT}/" - - docker_exec "${ndid}" "cat ${DOC_ROOT_CONT}/index.php" - docker_exec "${did}" "cat ${DOC_ROOT_CONT}/index.php" - - # Nginx configuration - docker_exec "${ndid}" "cat ${CONFIG_CONT}/php.conf" - - # Shutdown - docker_stop "${ndid}" || true - docker_stop "${did}" || true - rm -rf "${DOC_ROOT_HOST}" - rm -rf "${CONFIG_HOST}" - rm -rf "${PHP_CNF_HOST}" - echo "Failed" - exit 1 - fi +if ! run "curl -q -4 http://127.0.0.1:${WWW_PORT}/index.php 2>/dev/null | grep memory_limit | grep '17M'"; then + # Info + run "netstat -tuln" + run "curl -4 http://127.0.0.1:${WWW_PORT}/index.php | grep memory_limit" || true + run "docker ps --no-trunc" + docker_exec "${ndid}" "nginx -t" + + # Show logs + docker_logs "${ndid}" || true + docker_logs "${did}" || true + + # Ensure file is available + docker_exec "${ndid}" "ls -la ${DOC_ROOT_CONT}/" + docker_exec "${did}" "ls -la ${DOC_ROOT_CONT}/" + + docker_exec "${ndid}" "cat ${DOC_ROOT_CONT}/index.php" + docker_exec "${did}" "cat ${DOC_ROOT_CONT}/index.php" + + # Nginx configuration + docker_exec "${ndid}" "cat ${CONFIG_CONT}/php.conf" + + # Shutdown + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${DOC_ROOT_HOST}" + rm -rf "${CONFIG_HOST}" + rm -rf "${PHP_CNF_HOST}" + echo "Failed" + exit 1 fi