| # -*- mode: ruby -*- |
| # vi: set ft=ruby : |
| |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! |
| VAGRANTFILE_API_VERSION = "2" |
| |
| $setup = <<SCRIPT |
| sudo apt-get update -qq |
| SCRIPT |
| |
| $setup_integ = <<SCRIPT |
| cp -R /vagrant integration-tests |
| cd integration-tests && ./install_apps.py install_all 2>&1 | tee install.log |
| rm -rf prepare |
| cd install_helpers/tools && make clean |
| SCRIPT |
| |
| $setup_ssh = <<SCRIPT |
| mkdir -p ~/.ssh |
| cp /vagrant/temp/sshkey ~/.ssh/id_rsa |
| cp /vagrant/temp/sshkey.pub ~/.ssh/id_rsa.pub |
| cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys |
| chown -R vagrant:vagrant ~/.ssh |
| chmod -R 700 ~/.ssh |
| SCRIPT |
| |
| $setup_a = <<SCRIPT |
| cat > ~/.ssh/config <<EOF |
| Host 192.168.*.* |
| StrictHostKeyChecking no |
| EOF |
| |
| sudo ip route add 192.168.3.0/24 via 192.168.2.3 |
| sudo ip -6 addr add fd01::3/64 dev enp0s8 |
| sudo ip -6 addr add fd02::2/64 dev enp0s9 |
| sudo ip -6 route add fd03::/64 via fd02::3 |
| SCRIPT |
| |
| $setup_d = <<SCRIPT |
| ip route add 192.168.2.0/24 via 192.168.3.2 |
| ip -6 addr add fd03::3/64 dev enp0s8 |
| ip -6 route add fd02::/64 via fd03::2 |
| SCRIPT |
| |
| $setup_router = <<SCRIPT |
| echo 1 > /proc/sys/net/ipv4/ip_forward |
| echo 1 > /proc/sys/net/ipv6/conf/all/forwarding |
| ip -6 addr add fd02::3/64 dev enp0s8 |
| ip -6 addr add fd03::2/64 dev enp0s9 |
| SCRIPT |
| |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| config.vm.box = "ndn-jenkins/ubuntu1604-amd64" |
| |
| config.vm.provider "virtualbox" do |vb| |
| vb.memory = "512" |
| vb.cpus = "1" |
| vb.customize ["storagectl", :id, "--name", "SATA Controller", "--hostiocache", "off"] |
| end |
| |
| config.vm.define "template" do |t| |
| t.vm.provision "shell", inline: $setup, privileged: false |
| t.vm.provision "shell", inline: $setup_ssh, privileged: false |
| t.vm.provision "shell", inline: $setup_integ, privileged: false |
| config.vm.provider "virtualbox" do |vb| |
| vb.memory = "6144" |
| vb.cpus = "4" |
| end |
| end |
| |
| config.vm.define "A" do |a| |
| a.vm.box = "nfd-integ" |
| a.vm.network "private_network", ip: "192.168.1.3", virtualbox__intnet: "ABC-switch" |
| a.vm.network "private_network", ip: "192.168.2.2", virtualbox__intnet: "AtoRouter" |
| a.vm.provision "shell", inline: $setup, privileged: false |
| a.vm.provision "shell", inline: $setup_a, privileged: false |
| end |
| |
| config.vm.define "B" do |b| |
| b.vm.box = "nfd-integ" |
| b.vm.network "private_network", ip: "192.168.1.2", virtualbox__intnet: "ABC-switch" |
| b.vm.provision "shell", inline: $setup, privileged: false |
| b.vm.provision "shell", inline: "ip -6 addr add fd01::2/64 dev enp0s8" |
| end |
| |
| config.vm.define "C" do |c| |
| c.vm.box = "nfd-integ" |
| c.vm.network "private_network", ip: "192.168.1.4", virtualbox__intnet: "ABC-switch" |
| c.vm.provision "shell", inline: $setup, privileged: false |
| c.vm.provision "shell", inline: "ip -6 addr add fd01::4/64 dev enp0s8" |
| end |
| |
| config.vm.define "D" do |d| |
| d.vm.box = "nfd-integ" |
| d.vm.network "private_network", ip: "192.168.3.3", virtualbox__intnet: "DtoRouter" |
| d.vm.provision "shell", inline: $setup, privileged: false |
| d.vm.provision "shell", inline: $setup_d |
| end |
| |
| config.vm.define "router" do |router| |
| router.vm.network "private_network", ip: "192.168.2.3", virtualbox__intnet: "AtoRouter" |
| router.vm.network "private_network", ip: "192.168.3.2", virtualbox__intnet: "DtoRouter" |
| router.vm.provision "shell", inline: $setup_router |
| router.vm.provider "virtualbox" do |vb| |
| vb.memory = "256" |
| vb.cpus = "1" |
| end |
| end |
| end |