aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/vagrant
diff options
context:
space:
mode:
authorMatej Klotton <mklotton@cisco.com>2016-06-29 16:03:02 +0200
committerDave Wallace <dwallacelf@gmail.com>2016-07-01 16:09:12 +0000
commitd73918448ce23f52479008c6a61601abb24415ea (patch)
tree2a535038a1f4bbb65b1e28af094783c93117dfa6 /resources/tools/vagrant
parentcd4a740dd2967cf0a6f8f3bb1f420482733fa5c3 (diff)
CSIT-186: Add multilink to Vagrant file
Change-Id: I8ecc2be5771f46b46d4ac31880861db2482c2b1c Signed-off-by: Matej Klotton <mklotton@cisco.com>
Diffstat (limited to 'resources/tools/vagrant')
-rw-r--r--resources/tools/vagrant/Vagrantfile53
1 files changed, 31 insertions, 22 deletions
diff --git a/resources/tools/vagrant/Vagrantfile b/resources/tools/vagrant/Vagrantfile
index 46e214693d..86e78602aa 100644
--- a/resources/tools/vagrant/Vagrantfile
+++ b/resources/tools/vagrant/Vagrantfile
@@ -41,7 +41,8 @@ $install_vpp = <<-SHELL
SHELL
-def add_dut(config, name, mgmt_ip, net1, net2)
+def add_dut(config, name, mgmt_ip, port1, port2, port3, port4)
+ config.vm.box_check_update = false
config.vm.define name do |node|
node.vm.box = "fdio-csit/ubuntu-14.04.4_2016-05-25_1.0"
node.vm.hostname = name
@@ -50,17 +51,18 @@ def add_dut(config, name, mgmt_ip, net1, net2)
node.vm.provision "shell", inline: $install_vpp
node.vm.network "private_network", ip: mgmt_ip
- node.vm.network "private_network", type: "dhcp", auto_config: false,
- virtualbox__intnet: net1
- node.vm.network "private_network", type: "dhcp", auto_config: false,
- virtualbox__intnet: net2
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port1
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port2
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port3
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port4
node.vm.provider "virtualbox" do |vb|
vb.memory = "3232"
vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
vb.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"]
+ vb.customize ["modifyvm", :id, "--nicpromisc5", "allow-all"]
+ vb.customize ["modifyvm", :id, "--nicpromisc6", "allow-all"]
end
end
-
end
net_prefix = ''
@@ -68,9 +70,9 @@ if ENV.key?('VPP_VAGRANT_NET_PREFIX')
net_prefix = ENV['VPP_VAGRANT_NET_PREFIX'] + '_'
end
-Vagrant.configure(2) do |config|
+def add_tg(config, name, mgmt_ip, port1, port2, port3, port4, port5, port6)
config.vm.box_check_update = false
- config.vm.define "tg" do |tg|
+ config.vm.define name do |node|
if Vagrant.has_plugin?("vagrant-proxyconf")
if ENV["http_proxy"]
config.proxy.http = ENV["http_proxy"]
@@ -82,25 +84,32 @@ Vagrant.configure(2) do |config|
config.proxy.no_proxy = ENV["no_proxy"]
end
end
- tg.vm.box = "fdio-csit/ubuntu-14.04.4_2016-05-25_1.0"
- tg.vm.hostname = "tg"
+ node.vm.box = "fdio-csit/ubuntu-14.04.4_2016-05-25_1.0"
+ node.vm.hostname = name
+ node.vm.provision "shell", inline: $user_addition
+ node.vm.provision "shell", inline: $install_prereqs
- tg.vm.provision "shell", inline: $user_addition
- tg.vm.provision "shell", inline: $install_prereqs
- tg.vm.network "private_network", ip: '192.168.255.100/24'
- tg.vm.network "private_network", type: "dhcp", auto_config: false,
- virtualbox__intnet: net_prefix + "tg_dut1"
- tg.vm.network "private_network", type: "dhcp", auto_config: false,
- virtualbox__intnet: net_prefix + "tg_dut2"
- tg.vm.provider "virtualbox" do |vb|
+ node.vm.network "private_network", ip: mgmt_ip
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port1
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port2
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port3
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port4
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port5
+ node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port6
+ node.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
vb.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"]
+ vb.customize ["modifyvm", :id, "--nicpromisc5", "allow-all"]
+ vb.customize ["modifyvm", :id, "--nicpromisc6", "allow-all"]
+ vb.customize ["modifyvm", :id, "--nicpromisc7", "allow-all"]
+ vb.customize ["modifyvm", :id, "--nicpromisc8", "allow-all"]
end
-
end
-
- add_dut(config, "dut1", "192.168.255.101/24", net_prefix + "tg_dut1", net_prefix + "dut1_dut2")
- add_dut(config, "dut2", "192.168.255.102/24", net_prefix + "tg_dut2", net_prefix + "dut1_dut2")
end
+Vagrant.configure(2) do |config|
+ add_tg(config, "tg", "192.168.255.100/24", net_prefix + "tg_tg", net_prefix + "tg_tg", net_prefix + "tg_dut1_1", net_prefix + "tg_dut1_2", net_prefix + "tg_dut2_1", net_prefix + "tg_dut2_2")
+ add_dut(config, "dut1", "192.168.255.101/24", net_prefix + "tg_dut1_1", net_prefix + "tg_dut1_2", net_prefix + "dut1_dut2_1", net_prefix + "dut1_dut2_2")
+ add_dut(config, "dut2", "192.168.255.102/24", net_prefix + "tg_dut2_1", net_prefix + "tg_dut2_2", net_prefix + "dut1_dut2_1", net_prefix + "dut1_dut2_2")
+end