install packages with explicit TMPDIR

For package installation, the runner $TMPDIR may not be big enough, eg
when rebuilding an initramfs it runs out of space, so use a new function
that sets it explicitly.
This commit is contained in:
Jérôme Charaoui 2023-02-12 12:14:42 -05:00
parent 8f381b6415
commit ed55eaab73
No known key found for this signature in database
GPG Key ID: 69C52F658E988542
9 changed files with 12 additions and 8 deletions

View File

@ -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

View File

@ -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 $@
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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