diff --git a/test/vm/Vagrantfile b/test/vm/Vagrantfile index 6e9ee9b66..1aad60ccd 100644 --- a/test/vm/Vagrantfile +++ b/test/vm/Vagrantfile @@ -33,6 +33,7 @@ Vagrant.configure(2) do |config| # Setup SSH adduser --ingroup=vagrant --disabled-password --gecos "" backrest /backrest/test/vm/ssh/setup.sh + /backrest/test/vm/ssh/setup-cm.sh # Install required Perl modules apt-get install -y libdbd-pg-perl @@ -71,6 +72,7 @@ Vagrant.configure(2) do |config| # Setup SSH adduser --ingroup=vagrant --disabled-password --gecos "" backrest /backrest/test/vm/ssh/setup.sh + /backrest/test/vm/ssh/setup-cm.sh # Install required Perl modules apt-get install -y libdbd-pg-perl @@ -110,6 +112,31 @@ Vagrant.configure(2) do |config| SHELL end + config.vm.define "co7" do |co7| + co7.vm.box = "chef/centos-7.1" + + co7.vm.provider :virtualbox do |vb| + vb.name = "backrest-test-centos-7.1" + end + + # Provision the VM + co7.vm.provision "shell", inline: <<-SHELL + # Install db + sudo rpm -ivh http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm + sudo rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm + yum -y install postgresql93-server + yum -y install postgresql94-server + + # Install Perl and required modules + yum -y install perl perl-IO-String perl-Thread-Queue perl-JSON-PP perl-Digest-SHA perl-DBD-Pg + + # Setup SSH + adduser -gvagrant -n backrest + /backrest/test/vm/ssh/setup.sh + /backrest/test/vm/ssh/setup-cm.sh + SHELL + end + # Don't share the default vagrant folder config.vm.synced_folder ".", "/vagrant", disabled: true diff --git a/test/vm/ssh/config b/test/vm/ssh/config index 399b18cf2..f30d239b6 100644 --- a/test/vm/ssh/config +++ b/test/vm/ssh/config @@ -1,2 +1,2 @@ Host * - StrictHostKeyChecking no + StrictHostKeyChecking no diff --git a/test/vm/ssh/config-cm b/test/vm/ssh/config-cm new file mode 100644 index 000000000..6da0fb0f2 --- /dev/null +++ b/test/vm/ssh/config-cm @@ -0,0 +1,5 @@ +Host 127.0.0.1 + StrictHostKeyChecking no + ControlMaster auto + ControlPath /tmp/%r@%h:%p + ControlPersist 30 diff --git a/test/vm/ssh/setup-cm.sh b/test/vm/ssh/setup-cm.sh new file mode 100755 index 000000000..cab8dc0f5 --- /dev/null +++ b/test/vm/ssh/setup-cm.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Copy ControlMaster ssh configs when the OS supports it + +cp -f /backrest/test/vm/ssh/config-cm /home/vagrant/.ssh/config +cp -f /backrest/test/vm/ssh/config-cm /home/backrest/.ssh/config