CSIT-186: Add multilink to Vagrant file 07/1807/4
authorMatej Klotton <mklotton@cisco.com>
Wed, 29 Jun 2016 14:03:02 +0000 (16:03 +0200)
committerDave Wallace <dwallacelf@gmail.com>
Fri, 1 Jul 2016 16:09:12 +0000 (16:09 +0000)
Change-Id: I8ecc2be5771f46b46d4ac31880861db2482c2b1c
Signed-off-by: Matej Klotton <mklotton@cisco.com>
resources/tools/vagrant/Vagrantfile
topologies/available/vagrant.yaml

index 46e2146..86e7860 100644 (file)
@@ -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
index 6c724c4..a5a5ed5 100644 (file)
@@ -14,16 +14,36 @@ nodes:
     username: csit
     password: csit
     interfaces:
-      port3:
+      port1:
         mac_address: ""
         pci_address: "0000:00:09.0"
+        link: link0
+        driver: e1000
+      port2:
+        mac_address: ""
+        pci_address: "0000:00:0a.0"
+        link: link0
+        driver: e1000
+      port3:
+        mac_address: ""
+        pci_address: "0000:00:10.0"
         link: link1
         driver: e1000
+      port4:
+        mac_address: ""
+        pci_address: "0000:00:11.0"
+        link: link4
+        driver: e1000
       port5:
         mac_address: ""
-        pci_address: "0000:00:0a.0"
+        pci_address: "0000:00:12.0"
         link: link2
         driver: e1000
+      port6:
+        mac_address: ""
+        pci_address: "0000:00:13.0"
+        link: link5
+        driver: e1000
   DUT1:
     type: DUT
     host: "192.168.255.101"
@@ -36,11 +56,21 @@ nodes:
         pci_address: "0000:00:09.0"
         link: link1
         driver: e1000
-      port3:
+      port2:
         mac_address: ""
         pci_address: "0000:00:0a.0"
+        link: link4
+        driver: e1000
+      port3:
+        mac_address: ""
+        pci_address: "0000:00:10.0"
         link: link3
         driver: e1000
+      port4:
+        mac_address: ""
+        pci_address: "0000:00:11.0"
+        link: link6
+        driver: e1000
   DUT2:
     type: DUT
     host: "192.168.255.102"
@@ -53,8 +83,18 @@ nodes:
         pci_address: "0000:00:09.0"
         link: link2
         driver: e1000
-      port3:
+      port2:
         mac_address: ""
         pci_address: "0000:00:0a.0"
+        link: link5
+        driver: e1000
+      port3:
+        mac_address: ""
+        pci_address: "0000:00:10.0"
         link: link3
         driver: e1000
+      port4:
+        mac_address: ""
+        pci_address: "0000:00:11.0"
+        link: link6
+        driver: e1000

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.