4 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5 VAGRANTFILE_API_VERSION = "2"
6 Vagrant.require_version ">=1.7.0"
8 $bootstrap_fedora = <<SCRIPT
10 dnf -y install autoconf automake openssl-devel libtool \
11 python-devel python3-devel \
12 python-twisted python-zope-interface \
13 desktop-file-utils groff graphviz rpmdevtools nc curl \
14 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
15 libcap-ng-devel kernel-devel-`uname -r` ethtool python-tftpy \
17 echo "search extra update built-in" >/etc/depmod.d/search_path.conf
20 $bootstrap_debian = <<SCRIPT
23 aptitude -y install -R \
24 build-essential dpkg-dev lintian devscripts fakeroot \
25 debhelper dh-autoreconf uuid-runtime \
26 autoconf automake libtool \
27 python-all python-twisted-core python-twisted-conch \
28 xdg-utils groff graphviz netcat curl \
29 wget python-six ethtool \
30 libcap-ng-dev libssl-dev python-dev openssl \
31 python-pyftpdlib python-flake8 python-tftpy \
32 linux-headers-`uname -r` \
36 $bootstrap_centos = <<SCRIPT
38 yum -y install autoconf automake openssl-devel libtool \
39 python-twisted-core python-zope-interface \
40 desktop-file-utils groff graphviz rpmdevtools nc curl \
41 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
42 libcap-ng-devel kernel-devel-`uname -r` ethtool net-tools \
46 $configure_ovs = <<SCRIPT
49 [ -f Makefile ] && ./configure && make distclean
52 /vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
62 make check-kmod RECHECK=yes
65 $install_rpm = <<SCRIPT
67 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
70 cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
71 rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
72 rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
74 rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm
75 systemctl enable openvswitch
76 systemctl start openvswitch
77 systemctl status openvswitch
80 $install_centos_rpm = <<SCRIPT
82 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
85 cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
86 rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
87 rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
89 rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.x86_64.rpm
90 systemctl enable openvswitch
91 systemctl start openvswitch
92 systemctl status openvswitch
95 $install_deb = <<SCRIPT
97 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
100 ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz
101 rm -rf ~/openvswitch-$PACKAGE_VERSION
102 tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz
103 cd ~/openvswitch-$PACKAGE_VERSION
105 dpkg -i ../openvswitch-{common,switch}*deb
106 systemctl enable openvswitch-switch
107 systemctl start openvswitch-switch
108 systemctl status openvswitch-switch
111 $test_ovs_system_userspace = <<SCRIPT
113 make check-system-userspace RECHECK=yes
116 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
117 config.vm.define "debian-8" do |debian|
118 debian.vm.box = "debian/jessie64"
119 debian.vm.synced_folder ".", "/vagrant", type: "rsync"
120 debian.vm.provision "bootstrap", type: "shell", inline: $bootstrap_debian
121 debian.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
122 debian.vm.provision "build_ovs", type: "shell", inline: $build_ovs
123 debian.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
124 debian.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
125 debian.vm.provision "install_deb", type: "shell", inline: $install_deb
127 config.vm.define "fedora-23" do |fedora|
128 fedora.vm.box = "fedora/23-cloud-base"
129 fedora.vm.synced_folder ".", "/vagrant", type: "rsync"
130 fedora.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora
131 fedora.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
132 fedora.vm.provision "build_ovs", type: "shell", inline: $build_ovs
133 fedora.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
134 fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
135 fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm
137 config.vm.define "centos-7" do |centos|
138 centos.vm.box = "centos/7"
139 centos.vm.synced_folder ".", "/vagrant", type: "rsync"
140 centos.vm.provision "bootstrap", type: "shell", inline: $bootstrap_centos
141 centos.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
142 centos.vm.provision "build_ovs", type: "shell", inline: $build_ovs
143 centos.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
144 centos.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
145 centos.vm.provision "install_rpm", type: "shell", inline: $install_centos_rpm