@@ -146,6 +146,10 @@ function validate_database(){
146146
147147 refute [ -z " $HOST " ]
148148 refute [ -z " $PORT " ]
149+ refute [ -z " $database " ]
150+ refute [ -z " $dbuser " ]
151+ refute [ -z " $password " ]
152+
149153
150154 # Create an connection to verify correct username / password has been set correctly
151155 tmpfile=$( mktemp /tmp/mysql.XXXXXX)
@@ -725,7 +729,7 @@ function validate_database(){
725729# cron:
726730# - 1: /bin/true
727731# Hestia 1.3.1 archive contains (As zstd format)
728- # user: hestia111
732+ # user: hestia131
729733# web:
730734# - test.hestia.com (+SSL self-signed)
731735# dns:
@@ -735,7 +739,7 @@ function validate_database(){
735739# mail acc:
736740# - testaccount@test.hestia.com
737741# db:
738- # - hestia111_db
742+ # - hestia131_db
739743# cron:
740744# - 1: /bin/true
741745# Vesta 0.9.8-23 archive contains:
@@ -890,67 +894,67 @@ function validate_database(){
890894}
891895
892896@test " Restore[3]: Hestia (zstd) archive for a non-existing user" {
893- if [ -d " $HOMEDIR /$userbk " ]; then
894- run v-delete-user $userbk
897+ if [ -d " $HOMEDIR /$userbk " ]; then
898+ run v-delete-user $userbk
899+ assert_success
900+ refute_output
901+ fi
902+
903+ mkdir -p /backup
904+
905+ local archive_name=" hestia131.2020-12-12"
906+ run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache " https://dev.eris.nu/${archive_name} .tar" -O " /backup/${archive_name} .tar"
895907 assert_success
896- refute_output
897- fi
898-
899- mkdir -p /backup
900-
901- local archive_name=" hestia111.zstd"
902- run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache " https://hestiacp.com/testing/data/${archive_name} .tar" -O " /backup/${archive_name} .tar"
903- assert_success
904-
905- run v-restore-user $userbk " ${archive_name} .tar"
906- assert_success
907-
908- rm " /backup/${archive_name} .tar"
908+
909+ run v-restore-user $userbk " ${archive_name} .tar"
910+ assert_success
911+
912+ rm " /backup/${archive_name} .tar"
909913}
910914
911915@test " Restore[3]: From Hestia [WEB]" {
912- local domain=" test.hestia.com"
913- validate_web_domain $userbk $domain ' Hello Hestia'
916+ local domain=" test.hestia.com"
917+ validate_web_domain $userbk $domain ' Hello Hestia'
914918}
915919
916920@test " Restore[3]: From Hestia [DNS]" {
917- local domain=" test.hestia.com"
918-
919- run v-list-dns-domain $userbk $domain
920- assert_success
921-
922- run nslookup $domain 127.0.0.1
923- assert_success
921+ local domain=" test.hestia.com"
922+
923+ run v-list-dns-domain $userbk $domain
924+ assert_success
925+
926+ run nslookup $domain 127.0.0.1
927+ assert_success
924928}
925929
926930@test " Restore[3]: From Hestia [MAIL]" {
927- local domain=" test.hestia.com"
928-
929- run v-list-mail-domain $userbk $domain
930- assert_success
931+ local domain=" test.hestia.com"
932+
933+ run v-list-mail-domain $userbk $domain
934+ assert_success
931935}
932936
933937@test " Restore[3]: From Hestia [MAIL-Account]" {
934- local domain=" test.hestia.com"
935-
936- run v-list-mail-account $userbk $domain testaccount
937- assert_success
938+ local domain=" test.hestia.com"
939+
940+ run v-list-mail-account $userbk $domain testaccount
941+ assert_success
938942}
939943
940944@test " Restore[3]: From Hestia [DB]" {
941- run v-list-database $userbk " ${userbk} _db"
942- assert_success
945+ run v-list-database $userbk " ${userbk} _db"
946+ assert_success
943947}
944948
945949@test " Restore[3]: From Hestia [CRON]" {
946- run v-list-cron-job $userbk 1
947- assert_success
950+ run v-list-cron-job $userbk 1
951+ assert_success
948952}
949953
950954@test " Restore[3]: From Hestia Cleanup" {
951- run v-delete-user $userbk
952- assert_success
953- refute_output
955+ run v-delete-user $userbk
956+ assert_success
957+ refute_output
954958}
955959
956960@test " Restore[4]: Hestia (zstd) archive for a existing user" {
@@ -965,61 +969,61 @@ refute_output
965969 assert_success
966970 fi
967971
968- mkdir -p /backup
969-
970- local archive_name=" hestia111.zstd "
971- run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache " https://hestiacp.com/testing/data /${archive_name} .tar" -O " /backup/${archive_name} .tar"
972- assert_success
973-
974- run v-restore-user $userbk " ${archive_name} .tar"
975- assert_success
976-
977- rm " /backup/${archive_name} .tar"
972+ mkdir -p /backup
973+
974+ local archive_name=" hestia131.2020-12-12 "
975+ run wget --quiet --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache " https://dev.eris.nu /${archive_name} .tar" -O " /backup/${archive_name} .tar"
976+ assert_success
977+
978+ run v-restore-user $userbk " ${archive_name} .tar"
979+ assert_success
980+
981+ rm " /backup/${archive_name} .tar"
978982}
979983
980984@test " Restore[4]: From Hestia [WEB]" {
981- local domain=" test.hestia.com"
982- validate_web_domain $userbk $domain ' Hello Hestia'
985+ local domain=" test.hestia.com"
986+ validate_web_domain $userbk $domain ' Hello Hestia'
983987}
984988
985989@test " Restore[4]: From Hestia [DNS]" {
986- local domain=" test.hestia.com"
987-
988- run v-list-dns-domain $userbk $domain
989- assert_success
990-
991- run nslookup $domain 127.0.0.1
992- assert_success
990+ local domain=" test.hestia.com"
991+
992+ run v-list-dns-domain $userbk $domain
993+ assert_success
994+
995+ run nslookup $domain 127.0.0.1
996+ assert_success
993997}
994998
995999@test " Restore[4]: From Hestia [MAIL]" {
996- local domain=" test.hestia.com"
997-
998- run v-list-mail-domain $userbk $domain
999- assert_success
1000+ local domain=" test.hestia.com"
1001+
1002+ run v-list-mail-domain $userbk $domain
1003+ assert_success
10001004}
10011005
10021006@test " Restore[4]: From Hestia [MAIL-Account]" {
1003- local domain=" test.hestia.com"
1004-
1005- run v-list-mail-account $userbk $domain testaccount
1006- assert_success
1007+ local domain=" test.hestia.com"
1008+
1009+ run v-list-mail-account $userbk $domain testaccount
1010+ assert_success
10071011}
10081012
10091013@test " Restore[4]: From Hestia [DB]" {
1010- run v-list-database $userbk " ${userbk} _db"
1011- assert_success
1014+ run v-list-database $userbk " ${userbk} _db"
1015+ assert_success
10121016}
10131017
10141018@test " Restore[4]: From Hestia [CRON]" {
1015- run v-list-cron-job $userbk 1
1016- assert_success
1019+ run v-list-cron-job $userbk 1
1020+ assert_success
10171021}
10181022
10191023@test " Restore[4]: From Hestia Cleanup" {
1020- run v-delete-user $userbk
1021- assert_success
1022- refute_output
1024+ run v-delete-user $userbk
1025+ assert_success
1026+ refute_output
10231027}
10241028
10251029
0 commit comments