|
|
@@ -333,7 +333,7 @@ function validate_database(){
|
|
|
|
|
|
run v-add-cron-job $user 1 1 1 1 1 echo 1
|
|
|
assert_failure $E_EXISTS
|
|
|
- assert_output --partial 'JOB=1 is already exists'
|
|
|
+ assert_output --partial 'JOB=1 already exists'
|
|
|
}
|
|
|
|
|
|
@test "Cron: Second cron job" {
|
|
|
@@ -510,6 +510,12 @@ function validate_database(){
|
|
|
refute_output
|
|
|
}
|
|
|
|
|
|
+@test "WEB: Delete web domain wildcard alias" {
|
|
|
+ run v-delete-web-domain-alias $user $domain "*.$domain"
|
|
|
+ assert_success
|
|
|
+ refute_output
|
|
|
+}
|
|
|
+
|
|
|
@test "WEB: Add web domain stats" {
|
|
|
run v-add-web-domain-stats $user $domain awstats
|
|
|
assert_success
|
|
|
@@ -838,205 +844,6 @@ function validate_database(){
|
|
|
refute_output
|
|
|
}
|
|
|
|
|
|
-#----------------------------------------------------------#
|
|
|
-# MULTIPHP #
|
|
|
-#----------------------------------------------------------#
|
|
|
-
|
|
|
-@test "Multiphp: Default php Backend version" {
|
|
|
- def_phpver=$(multiphp_default_version)
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- run v-add-web-domain $user $multi_domain 198.18.0.125
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- echo -e "<?php\necho PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;" > "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
- validate_web_domain $user $multi_domain "$def_phpver" 'php-test.php'
|
|
|
- rm "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-@test "Multiphp: Change backend version - PHP v5.6" {
|
|
|
- test_phpver='5.6'
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- if [ ! -d "/etc/php/${test_phpver}/fpm/pool.d/" ]; then
|
|
|
- skip "PHP ${test_phpver} not installed"
|
|
|
- fi
|
|
|
-
|
|
|
- run v-change-web-domain-backend-tpl $user $multi_domain 'PHP-5_6' 'yes'
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- # Changing web backend will create a php-fpm pool config in the corresponding php folder
|
|
|
- assert_file_exist "/etc/php/${test_phpver}/fpm/pool.d/${multi_domain}.conf"
|
|
|
-
|
|
|
- # A single php-fpm pool config file must be present
|
|
|
- num_fpm_config_files="$(find -L /etc/php/ -name "${multi_domain}.conf" | wc -l)"
|
|
|
- assert_equal "$num_fpm_config_files" '1'
|
|
|
-
|
|
|
- echo -e "<?php\necho 'hestia-multiphptest:'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;" > "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
- validate_web_domain $user $multi_domain "hestia-multiphptest:$test_phpver" 'php-test.php'
|
|
|
- rm "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
-}
|
|
|
-
|
|
|
-@test "Multiphp: Change backend version - PHP v7.0" {
|
|
|
- test_phpver='7.0'
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- if [ ! -d "/etc/php/${test_phpver}/fpm/pool.d/" ]; then
|
|
|
- skip "PHP ${test_phpver} not installed"
|
|
|
- fi
|
|
|
-
|
|
|
- run v-change-web-domain-backend-tpl $user $multi_domain 'PHP-7_0' 'yes'
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- # Changing web backend will create a php-fpm pool config in the corresponding php folder
|
|
|
- assert_file_exist "/etc/php/${test_phpver}/fpm/pool.d/${multi_domain}.conf"
|
|
|
-
|
|
|
- # A single php-fpm pool config file must be present
|
|
|
- num_fpm_config_files="$(find -L /etc/php/ -name "${multi_domain}.conf" | wc -l)"
|
|
|
- assert_equal "$num_fpm_config_files" '1'
|
|
|
-
|
|
|
- echo -e "<?php\necho 'hestia-multiphptest:'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;" > "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
- validate_web_domain $user $multi_domain "hestia-multiphptest:$test_phpver" 'php-test.php'
|
|
|
- rm "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
-}
|
|
|
-
|
|
|
-@test "Multiphp: Change backend version - PHP v7.1" {
|
|
|
- test_phpver='7.1'
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- if [ ! -d "/etc/php/${test_phpver}/fpm/pool.d/" ]; then
|
|
|
- skip "PHP ${test_phpver} not installed"
|
|
|
- fi
|
|
|
-
|
|
|
- run v-change-web-domain-backend-tpl $user $multi_domain 'PHP-7_1' 'yes'
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- # Changing web backend will create a php-fpm pool config in the corresponding php folder
|
|
|
- assert_file_exist "/etc/php/${test_phpver}/fpm/pool.d/${multi_domain}.conf"
|
|
|
-
|
|
|
- # A single php-fpm pool config file must be present
|
|
|
- num_fpm_config_files="$(find -L /etc/php/ -name "${multi_domain}.conf" | wc -l)"
|
|
|
- assert_equal "$num_fpm_config_files" '1'
|
|
|
-
|
|
|
- echo -e "<?php\necho 'hestia-multiphptest:'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;" > "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
- validate_web_domain $user $multi_domain "hestia-multiphptest:$test_phpver" 'php-test.php'
|
|
|
- rm "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
-}
|
|
|
-
|
|
|
-@test "Multiphp: Change backend version - PHP v7.2" {
|
|
|
- test_phpver='7.2'
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- if [ ! -d "/etc/php/${test_phpver}/fpm/pool.d/" ]; then
|
|
|
- skip "PHP ${test_phpver} not installed"
|
|
|
- fi
|
|
|
-
|
|
|
- run v-change-web-domain-backend-tpl $user $multi_domain 'PHP-7_2' 'yes'
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- # Changing web backend will create a php-fpm pool config in the corresponding php folder
|
|
|
- assert_file_exist "/etc/php/${test_phpver}/fpm/pool.d/${multi_domain}.conf"
|
|
|
-
|
|
|
- # A single php-fpm pool config file must be present
|
|
|
- num_fpm_config_files="$(find -L /etc/php/ -name "${multi_domain}.conf" | wc -l)"
|
|
|
- assert_equal "$num_fpm_config_files" '1'
|
|
|
-
|
|
|
- echo -e "<?php\necho 'hestia-multiphptest:'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;" > "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
- validate_web_domain $user $multi_domain "hestia-multiphptest:$test_phpver" 'php-test.php'
|
|
|
- rm "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
-}
|
|
|
-
|
|
|
-@test "Multiphp: Change backend version - PHP v7.3" {
|
|
|
- test_phpver='7.3'
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- if [ ! -d "/etc/php/${test_phpver}/fpm/pool.d/" ]; then
|
|
|
- skip "PHP ${test_phpver} not installed"
|
|
|
- fi
|
|
|
-
|
|
|
- run v-change-web-domain-backend-tpl $user $multi_domain 'PHP-7_3' 'yes'
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- # Changing web backend will create a php-fpm pool config in the corresponding php folder
|
|
|
- assert_file_exist "/etc/php/${test_phpver}/fpm/pool.d/${multi_domain}.conf"
|
|
|
-
|
|
|
- # A single php-fpm pool config file must be present
|
|
|
- num_fpm_config_files="$(find -L /etc/php/ -name "${multi_domain}.conf" | wc -l)"
|
|
|
- assert_equal "$num_fpm_config_files" '1'
|
|
|
-
|
|
|
- echo -e "<?php\necho 'hestia-multiphptest:'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;" > "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
- validate_web_domain $user $multi_domain "hestia-multiphptest:$test_phpver" 'php-test.php'
|
|
|
- rm "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
-}
|
|
|
-
|
|
|
-@test "Multiphp: Change backend version - PHP v7.4" {
|
|
|
- test_phpver='7.4'
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- if [ ! -d "/etc/php/${test_phpver}/fpm/pool.d/" ]; then
|
|
|
- skip "PHP ${test_phpver} not installed"
|
|
|
- fi
|
|
|
-
|
|
|
- run v-change-web-domain-backend-tpl $user $multi_domain 'PHP-7_4' 'yes'
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- # Changing web backend will create a php-fpm pool config in the corresponding php folder
|
|
|
- assert_file_exist "/etc/php/${test_phpver}/fpm/pool.d/${multi_domain}.conf"
|
|
|
-
|
|
|
- # A single php-fpm pool config file must be present
|
|
|
- num_fpm_config_files="$(find -L /etc/php/ -name "${multi_domain}.conf" | wc -l)"
|
|
|
- assert_equal "$num_fpm_config_files" '1'
|
|
|
-
|
|
|
- echo -e "<?php\necho 'hestia-multiphptest:'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;" > "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
- validate_web_domain $user $multi_domain "hestia-multiphptest:$test_phpver" 'php-test.php'
|
|
|
- rm "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
-}
|
|
|
-
|
|
|
-@test "Multiphp: Change backend version - PHP v8.0" {
|
|
|
- test_phpver='8.0'
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- if [ ! -d "/etc/php/${test_phpver}/fpm/pool.d/" ]; then
|
|
|
- skip "PHP ${test_phpver} not installed"
|
|
|
- fi
|
|
|
-
|
|
|
- run v-change-web-domain-backend-tpl $user $multi_domain 'PHP-8_0' 'yes'
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- # Changing web backend will create a php-fpm pool config in the corresponding php folder
|
|
|
- assert_file_exist "/etc/php/${test_phpver}/fpm/pool.d/${multi_domain}.conf"
|
|
|
-
|
|
|
- # A single php-fpm pool config file must be present
|
|
|
- num_fpm_config_files="$(find -L /etc/php/ -name "${multi_domain}.conf" | wc -l)"
|
|
|
- assert_equal "$num_fpm_config_files" '1'
|
|
|
-
|
|
|
- echo -e "<?php\necho 'hestia-multiphptest:'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;" > "$HOMEDIR/$user/web/$multi_domain/public_html/php-test.php"
|
|
|
- validate_web_domain $user $multi_domain "hestia-multiphptest:$test_phpver" 'php-test.php'
|
|
|
- rm $HOMEDIR/$user/web/$multi_domain/public_html/php-test.php
|
|
|
-}
|
|
|
-
|
|
|
-@test "Multiphp: Cleanup" {
|
|
|
- multi_domain="multiphp.${domain}"
|
|
|
-
|
|
|
- run v-delete-web-domain $user $multi_domain 'yes'
|
|
|
- assert_success
|
|
|
- refute_output
|
|
|
-
|
|
|
- # No php-fpm pool config file must be present
|
|
|
- num_fpm_config_files="$(find -L /etc/php/ -name "${multi_domain}.conf" | wc -l)"
|
|
|
- assert_equal "$num_fpm_config_files" '0'
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
#----------------------------------------------------------#
|
|
|
# DNS #
|
|
|
#----------------------------------------------------------#
|