Added Vagrantfile for PostgreSQL integration tests
This commit is contained in:
parent
38ff024ad4
commit
9a45664b4b
34
Vagrantfile
vendored
Normal file
34
Vagrantfile
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
# Vagratnfile for running integration tests with PostgreSQL
|
||||||
|
|
||||||
|
VAGRANTFILE_API_VERSION = "2"
|
||||||
|
|
||||||
|
$ubuntu_setup_script = <<SETUP_SCRIPT
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y vim build-essential postgresql postgresql-contrib git
|
||||||
|
curl -o /tmp/go.tar.gz https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz
|
||||||
|
tar -C /usr/local -xzf /tmp/go.tar.gz
|
||||||
|
echo "export PATH=$PATH:/usr/local/go/bin" >> /home/vagrant/.profile
|
||||||
|
echo "export GOPATH=/home/vagrant" >> /home/vagrant/.profile
|
||||||
|
mkdir -p /home/vagrant/src/acme-dns
|
||||||
|
chown -R vagrant /home/vagrant/src
|
||||||
|
cp /vagrant/test/run_integration.sh /home/vagrant
|
||||||
|
bash /vagrant/test/pgsql.sh
|
||||||
|
echo "To run integration tests run /home/vagrant/run_integration.sh"
|
||||||
|
SETUP_SCRIPT
|
||||||
|
|
||||||
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
|
||||||
|
config.vm.define "ad-ubuntu-trusty", primary: true do |ad_ubuntu_trusty|
|
||||||
|
ad_ubuntu_trusty.vm.box = "ubuntu/trusty64"
|
||||||
|
ad_ubuntu_trusty.vm.provision "shell", inline: $ubuntu_setup_script
|
||||||
|
ad_ubuntu_trusty.vm.network "forwarded_port", guest: 8080, host: 8008
|
||||||
|
ad_ubuntu_trusty
|
||||||
|
ad_ubuntu_trusty.vm.provider "virtualbox" do |v|
|
||||||
|
v.memory = 2048
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
4
test/pgsql.sh
Executable file
4
test/pgsql.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
sudo -u postgres createdb acmedns
|
||||||
|
sudo -u postgres psql -c "CREATE USER acmedns WITH PASSWORD 'acmedns'"
|
||||||
|
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE acmedns TO acmedns"
|
||||||
7
test/run_integration.sh
Executable file
7
test/run_integration.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
source /home/vagrant/.profile
|
||||||
|
rm -rf /home/vagrant/src/acme-dns/*
|
||||||
|
cp -R /vagrant/* /home/vagrant/src/acme-dns/
|
||||||
|
cd /home/vagrant/src/acme-dns/
|
||||||
|
go get
|
||||||
|
go test -postgres
|
||||||
Loading…
x
Reference in New Issue
Block a user