diff --git a/test/borg.bats b/test/borg.bats index 0a454ac..10fc7e2 100644 --- a/test/borg.bats +++ b/test/borg.bats @@ -1,7 +1,7 @@ load common begin_borg() { - apt-get -qq install debootstrap borgbackup + install_pkgs debootstrap borgbackup if [ ! -d "$BN_SRCDIR" ]; then debootstrap --variant=minbase testing "$BN_SRCDIR" fi diff --git a/test/common.bash b/test/common.bash index 45c193f..7280180 100644 --- a/test/common.bash +++ b/test/common.bash @@ -241,3 +241,7 @@ makegpgkeys() { BN_SIGNKEY=$(gpg --keyid-format long -k sign@bntest0 | sed -n '2p' | grep -o '\S\+') export BN_SIGNKEY } + +install_pkgs() { + TMPDIR=/tmp DEBIAN_FRONTEND=noninteractive apt-get -qq install $@ +} diff --git a/test/dup.bats b/test/dup.bats index 71ce4f5..8136709 100644 --- a/test/dup.bats +++ b/test/dup.bats @@ -1,7 +1,7 @@ load common begin_dup() { - apt-get -qq install debootstrap duplicity trickle + install_pkgs debootstrap duplicity trickle if [ ! -d /var/cache/bntest ]; then debootstrap --variant=minbase testing "$BN_SRCDIR" fi diff --git a/test/mysql.bats b/test/mysql.bats index 205a94f..ca73656 100644 --- a/test/mysql.bats +++ b/test/mysql.bats @@ -1,7 +1,7 @@ load common begin_mysql() { - apt-get -qq install default-mysql-server + install_pkgs install default-mysql-server systemctl is-active mysql || systemctl start mysql zcat "${BATS_TEST_DIRNAME}/samples/bntest_p8Cz8k.sql.gz" | mysql --defaults-file=/etc/mysql/debian.cnf zcat "${BATS_TEST_DIRNAME}/samples/bntest_v11vJj.sql.gz" | mysql --defaults-file=/etc/mysql/debian.cnf diff --git a/test/pgsql.bats b/test/pgsql.bats index 163fe8c..3f995d3 100644 --- a/test/pgsql.bats +++ b/test/pgsql.bats @@ -1,7 +1,7 @@ load common begin_pgsql() { - apt-get -qq install postgresql + install_pkgs postgresql systemctl is-active postgresql || systemctl start postgresql sudo -u postgres createuser --superuser root createdb bntest_p8Cz8k diff --git a/test/rdiff.bats b/test/rdiff.bats index 8a70b77..8f5a450 100644 --- a/test/rdiff.bats +++ b/test/rdiff.bats @@ -1,7 +1,7 @@ load common begin_rdiff() { - apt-get -qq install debootstrap rdiff-backup cstream + install_pkgs install debootstrap rdiff-backup cstream if [ ! -d /var/cache/bntest ]; then debootstrap --variant=minbase testing /var/cache/bntest fi diff --git a/test/rsync.bats b/test/rsync.bats index 903518d..b33cf5b 100644 --- a/test/rsync.bats +++ b/test/rsync.bats @@ -1,7 +1,7 @@ load common begin_rsync() { - apt-get -qq install debootstrap rsync + install_pkgs debootstrap rsync if [ ! -d "$BN_SRCDIR" ]; then debootstrap --variant=minbase testing "$BN_SRCDIR" fi diff --git a/test/sys.bats b/test/sys.bats index 439fa35..7e1b67f 100644 --- a/test/sys.bats +++ b/test/sys.bats @@ -1,7 +1,7 @@ load common begin_sys() { - apt-get -qq install debconf-utils hwinfo lvm2 cryptsetup-bin parted + install_pkgs debconf-utils hwinfo lvm2 cryptsetup-bin parted cat << EOF > "${BATS_TMPDIR}/backup.d/test.sys" when = manual diff --git a/test/tar.bats b/test/tar.bats index a593c84..0846941 100644 --- a/test/tar.bats +++ b/test/tar.bats @@ -1,7 +1,7 @@ load common begin_tar() { - apt-get -qq install debootstrap ncompress zstd + install_pkgs debootstrap ncompress zstd if [ ! -d "$BN_SRCDIR" ]; then debootstrap --variant=minbase testing "$BN_SRCDIR" fi