diff --git a/Vagrantfile b/Vagrantfile index a0ea6e1..4f85721 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -23,10 +23,8 @@ Vagrant.configure("2") do |config| apt-get install -y borgbackup duplicity rdiff-backup restic rsync sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config systemctl reload sshd - mkdir /tmp/backups - mount -t tmpfs tmpfs /tmp/backups - chown vagrant: /tmp/backups echo -e "vagrant\nvagrant" | passwd vagrant + chown vagrant: /var/backups SHELL end @@ -45,9 +43,6 @@ Vagrant.configure("2") do |config| ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --libexecdir=/usr/lib make make install - mkdir /tmp/backups - mount -t tmpfs tmpfs /tmp/backups - chown vagrant: /tmp/backups mkdir -p /root/.ssh yes y | ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N '' echo "StrictHostKeyChecking accept-new" >> /root/.ssh/config diff --git a/test/common.bash b/test/common.bash index 530692c..b1ae748 100644 --- a/test/common.bash +++ b/test/common.bash @@ -80,3 +80,17 @@ setconfig() { crudini --set "${BATS_TMPDIR}/$1" $2 $3 "$4" fi } + +remote_command() { + ssh vagrant@bntest1 "$1" +} + +cleanup_backups() { + umount /var/backups + mount -t tmpfs tmpfs /var/backups +} + +cleanup_remote_backups() { + remote_command "sudo umount /var/backups" + remote_command "sudo mount -t tmpfs tmpfs /var/backups" +} diff --git a/test/rdiff.bats b/test/rdiff.bats index 0b4612a..1608639 100644 --- a/test/rdiff.bats +++ b/test/rdiff.bats @@ -5,10 +5,6 @@ begin_rdiff() { if [ ! -d /var/cache/bntest ]; then debootstrap --variant=minbase testing /var/cache/bntest fi - if [ ! -d /tmp/backups ]; then - mkdir /tmp/backups - mount -t tmpfs tmpfs /tmp/backups - fi } setup_rdiff() { @@ -31,7 +27,7 @@ exclude = /var/cache/bntest/var [dest] type = local -directory = /tmp/backups +directory = /var/backups host = user = sshoptions = -4 @@ -41,8 +37,8 @@ EOF } finish_rdiff() { - rm -rf /tmp/backups/rdifftest - ssh vagrant@bntest1 "rm -rf /tmp/backups/rdifftest" + rm -rf /var/backups/rdifftest + ssh vagrant@bntest1 "rm -rf /var/backups/rdifftest" } @test "local source/dest backup action runs without errors" {