CSIT-117: CSIT Vagrant+Virtualbox dev environment inoperative on Ubuntu 69/1269/2
authorDave Wallace <dwallacelf@gmail.com>
Wed, 25 May 2016 22:15:00 +0000 (18:15 -0400)
committerJan Gelety <jgelety@cisco.com>
Thu, 2 Jun 2016 15:27:15 +0000 (15:27 +0000)
Change-Id: I05ea675a2eb6d0b240008efa0d27166616c6e741
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
resources/tools/vagrant/Vagrantfile
resources/tools/vagrant/install_debs.sh

index 3e18192..0355ad7 100644 (file)
@@ -30,10 +30,17 @@ $install_prereqs = <<-SHELL
 SHELL
 
 $install_vpp = <<-SHELL
-    sudo apt-get -y purge vpp\*
     cd /vagrant
-    if [ -e /vagrant/vpp-*.deb ]; then
-        sudo dpkg -i vpp-*.deb
+    vpp_pkgs="$(echo vpp*.deb)"
+    if [ "$vpp_pkgs" != "vpp*.deb" ]; then
+      if [ "$(dpkg -l | grep vpp)" != "" ] ; then
+        sudo apt-get -y purge vpp\*
+      fi
+      sudo dpkg -i vpp*.deb
+      vppcfg="/etc/vpp/startup.conf"
+      sudo rm -f $vppcfg.orig
+      sudo cp $vppcfg $vppcfg.orig
+      echo -e '\nheapsize 512M' | sudo tee -a $vppcfg
     fi
 SHELL
 
@@ -61,6 +68,17 @@ def add_dut(config, name, mgmt_ip, net1, net2)
 end
 
 Vagrant.configure(2) do |config|
+  if Vagrant.has_plugin?("vagrant-proxyconf")
+    if ENV["http_proxy"]
+      config.proxy.http     = ENV["http_proxy"]
+    end
+    if ENV["https_proxy"]
+      config.proxy.https    = ENV["https_proxy"]
+    end
+    if ENV["no_proxy"]
+      config.proxy.no_proxy = ENV["no_proxy"]
+    end
+  end
   config.vm.define "tg" do |tg|
     tg.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
     tg.vm.hostname = "tg"
index 5ace4ba..b3ef9ec 100755 (executable)
@@ -25,13 +25,8 @@ rsync -avz ${@} ${USERNAME}@192.168.255.102:/tmp/ || exit
 
 ssh_do_duts "sudo apt-get -y purge 'vpp.*' ; exit 0"
 ssh_do_duts "sudo dpkg -i /tmp/vpp*.deb"
-ssh_do_duts "echo 128 | sudo tee /proc/sys/vm/nr_hugepages"
-ssh_do_duts "sudo rm -f /etc/vpp/startup.conf.orig ; sudo cp /etc/vpp/startup.conf /etc/vpp/startup.conf.orig"
-ssh_do_duts "sudo rm /etc/vpp/startup.conf"
-ssh_do_duts "sudo sed -e 's/socket-mem [0-9]*/socket-mem 128/' /etc/vpp/startup.conf.orig | sudo tee /etc/vpp/startup.conf"
-ssh_do_duts "echo heapsize 512M | sudo tee -a /etc/vpp/startup.conf"
-ssh_do_duts "sudo sed -e 's/vm.nr_hugepages=.*/vm.nr_hugepages=128/' -i /etc/sysctl.d/80-vpp.conf"
-ssh_do_duts "sudo sed -e 's/vm.max_map_count=.*/vm.max_map_count=256/' -i /etc/sysctl.d/80-vpp.conf"
-
+vppcfg="/etc/vpp/startup.conf"
+ssh_do_duts "sudo rm -f $vppcfg.orig; sudo cp $vppcfg $vppcfg.orig"
+ssh_do_duts "echo -e '\nheapsize 512M' | sudo tee -a $vppcfg"
 
 echo Success!

©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.