mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-05 15:57:23 +01:00
Add a major upgrade test - bionic to jammy
This commit is contained in:
54
tests/system-setup/from-backup.sh
Executable file
54
tests/system-setup/from-backup.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# setup system using backup data
|
||||
#
|
||||
|
||||
# ensure working directory
|
||||
if [ ! -d "tests/system-setup" ]; then
|
||||
echo "This script must be run from the MiaB root directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# load helper scripts
|
||||
. "tests/lib/all.sh" "tests/lib" || die "Could not load lib scripts"
|
||||
. "tests/system-setup/setup-defaults.sh" || die "Could not load setup-defaults"
|
||||
. "tests/system-setup/setup-funcs.sh" || die "Could not load setup-funcs"
|
||||
|
||||
# ensure running as root
|
||||
if [ "$EUID" != "0" ]; then
|
||||
die "This script must be run as root (sudo)"
|
||||
fi
|
||||
|
||||
|
||||
init() {
|
||||
H1 "INIT"
|
||||
init_test_system
|
||||
init_miab_testing "$@" || die "Initialization failed"
|
||||
}
|
||||
|
||||
|
||||
# initialize test system
|
||||
init "$@"
|
||||
|
||||
|
||||
if [ $# -lt 3 ]; then
|
||||
die "usage: $0 storage-user /path/to/encrypted /path/to/secret_key /path/to/restore-dir"
|
||||
fi
|
||||
storage_user="$1" # eg. "user-data"
|
||||
duplicity_files="$2" # /path/to/encrypted
|
||||
secret_key="$3" # /path/to/secret_key.txt
|
||||
restore_to="$4" # eg. /home/user-data
|
||||
shift; shift; shift; shift;
|
||||
|
||||
tests/bin/restore_backup.sh \
|
||||
"$storage_user" \
|
||||
"$duplicity_files" \
|
||||
"$secret_key" \
|
||||
"$restore_to" \
|
||||
|| die "Restore failed"
|
||||
|
||||
|
||||
# run setup
|
||||
miab_ldap_install "$@"
|
||||
|
||||
Reference in New Issue
Block a user