]> git.proxmox.com Git - mirror_ovs.git/blame - Vagrantfile
vagrant: use RECHECK=yes for system checks
[mirror_ovs.git] / Vagrantfile
CommitLineData
b56b2566
AZ
1# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5VAGRANTFILE_API_VERSION = "2"
3314f01e 6Vagrant.require_version ">=1.7.0"
b56b2566
AZ
7
8$bootstrap_fedora = <<SCRIPT
d64c5e86
MG
9dnf -y update
10dnf -y install autoconf automake openssl-devel libtool \
06c58061 11 python-twisted-core python-zope-interface \
e259119c 12 desktop-file-utils groff graphviz rpmdevtools nc \
6a6b35fc 13 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
e4f2c621 14 libcap-ng-devel kernel-devel-`uname -r` ethtool
b56b2566 15echo "search extra update built-in" >/etc/depmod.d/search_path.conf
7c127f28
TLSC
16SCRIPT
17
18$bootstrap_debian = <<SCRIPT
19aptitude -y update
20aptitude -y upgrade
21aptitude -y install -R \
22 build-essential dpkg-dev lintian devscripts fakeroot \
23 debhelper dh-autoreconf uuid-runtime \
24 autoconf automake libtool \
25 python-all python-twisted-core python-twisted-conch \
26 xdg-utils groff graphviz netcat \
27 wget python-six ethtool \
28 libcap-ng-dev libssl-dev python-dev openssl \
29 python-pyftpdlib python-flake8 \
30 linux-headers-`uname -r`
b56b2566
AZ
31SCRIPT
32
33$configure_ovs = <<SCRIPT
7c127f28
TLSC
34cd /vagrant
35./boot.sh
b56b2566
AZ
36mkdir -p ~/build
37cd ~/build
1a523ec4 38/vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
b56b2566
AZ
39SCRIPT
40
41$build_ovs = <<SCRIPT
42cd ~/build
43make
44SCRIPT
45
3314f01e
AZ
46$test_kmod = <<SCRIPT
47cd ~/build
960e99dc 48make check-kmod RECHECK=yes
3314f01e
AZ
49SCRIPT
50
b56b2566
AZ
51$install_rpm = <<SCRIPT
52cd ~/build
53PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
54make && make dist
55rpmdev-setuptree
56cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
d06c1ff8 57rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
b56b2566 58rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
3314f01e 59rpm -e openvswitch
53de7528 60rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm
3314f01e
AZ
61systemctl enable openvswitch
62systemctl start openvswitch
63systemctl status openvswitch
b56b2566
AZ
64SCRIPT
65
7c127f28
TLSC
66$install_deb = <<SCRIPT
67cd ~/build
68PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
69make dist
70cd ~/
71ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz
72rm -rf ~/openvswitch-$PACKAGE_VERSION
73tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz
74cd ~/openvswitch-$PACKAGE_VERSION
75debuild -us -uc
76dpkg -i ../openvswitch-{common,switch}*deb
77systemctl enable openvswitch-switch
78systemctl start openvswitch-switch
79systemctl status openvswitch-switch
80SCRIPT
81
548f9fe7
DDP
82$test_ovs_system_userspace = <<SCRIPT
83cd ~/build
960e99dc 84make check-system-userspace RECHECK=yes
548f9fe7
DDP
85SCRIPT
86
b56b2566 87Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7c127f28
TLSC
88 config.vm.define "debian-8" do |debian|
89 debian.vm.box = "debian/jessie64"
90 debian.vm.synced_folder ".", "/vagrant", type: "rsync"
91 debian.vm.provision "bootstrap", type: "shell", inline: $bootstrap_debian
92 debian.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
93 debian.vm.provision "build_ovs", type: "shell", inline: $build_ovs
94 debian.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
95 debian.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
96 debian.vm.provision "install_deb", type: "shell", inline: $install_deb
97 end
53de7528
JS
98 config.vm.define "fedora-23" do |fedora|
99 fedora.vm.box = "bento/fedora-23"
3314f01e
AZ
100 fedora.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora
101 fedora.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
102 fedora.vm.provision "build_ovs", type: "shell", inline: $build_ovs
103 fedora.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
548f9fe7 104 fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
3314f01e
AZ
105 fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm
106 end
b56b2566 107end