tests: Declare useful global vars in common.bash

This commit is contained in:
Jerome Charaoui 2021-01-03 17:55:02 -05:00
parent 61b7fe44a2
commit 9332906386
2 changed files with 12 additions and 6 deletions

View File

@ -2,8 +2,8 @@ load common
begin_borg() {
apt-get -qq install debootstrap borgbackup
if [ ! -d /var/cache/bntest ]; then
debootstrap --variant=minbase testing /var/cache/bntest
if [ ! -d "$BN_SRCDIR" ]; then
debootstrap --variant=minbase testing "$BN_SRCDIR"
fi
}
@ -17,8 +17,8 @@ bwlimit =
[source]
init = yes
include = /var/cache/bntest
exclude = /var/cache/bntest/var
include = ${BN_SRCDIR}
exclude = ${BN_SRCDIR}/var
create_options =
prune = yes
keep = 30d
@ -27,9 +27,9 @@ cache_directory =
[dest]
user =
host =
host = localhost
port = 22
directory = /var/backups/testborg
directory = ${BN_BACKUPDIR}/testborg
archive =
compression = lz4
encryption = none

View File

@ -1,5 +1,11 @@
setup() {
# declare some constants
readonly BN_REMOTEUSER="vagrant"
readonly BN_REMOTEHOST="bntest1"
readonly BN_BACKUPDIR="/var/backups"
readonly BN_SRCDIR="/var/cache/bntest"
# Write a basic backupninja config file
cat << EOF > "${BATS_TMPDIR}/backupninja.conf"
when = manual