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-twisted-core python-zope-interface \
12 desktop-file-utils groff graphviz rpmdevtools nc \
13 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
14 libcap-ng-devel kernel-devel-`uname -r` ethtool
15 echo "search extra update built-in" >/etc/depmod.d/search_path.conf
18 $bootstrap_debian = <<SCRIPT
21 aptitude -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`
33 $configure_ovs = <<SCRIPT
36 [ -f Makefile ] && ./configure && make distclean
39 /vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
49 make check-kmod RECHECK=yes
52 $install_rpm = <<SCRIPT
54 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
57 cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
58 rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
59 rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
61 rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm
62 systemctl enable openvswitch
63 systemctl start openvswitch
64 systemctl status openvswitch
67 $install_deb = <<SCRIPT
69 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
72 ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz
73 rm -rf ~/openvswitch-$PACKAGE_VERSION
74 tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz
75 cd ~/openvswitch-$PACKAGE_VERSION
77 dpkg -i ../openvswitch-{common,switch}*deb
78 systemctl enable openvswitch-switch
79 systemctl start openvswitch-switch
80 systemctl status openvswitch-switch
83 $test_ovs_system_userspace = <<SCRIPT
85 make check-system-userspace RECHECK=yes
88 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
89 config.vm.define "debian-8" do |debian|
90 debian.vm.box = "debian/jessie64"
91 debian.vm.synced_folder ".", "/vagrant", type: "rsync"
92 debian.vm.provision "bootstrap", type: "shell", inline: $bootstrap_debian
93 debian.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
94 debian.vm.provision "build_ovs", type: "shell", inline: $build_ovs
95 debian.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
96 debian.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
97 debian.vm.provision "install_deb", type: "shell", inline: $install_deb
99 config.vm.define "fedora-23" do |fedora|
100 fedora.vm.box = "bento/fedora-23"
101 fedora.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora
102 fedora.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
103 fedora.vm.provision "build_ovs", type: "shell", inline: $build_ovs
104 fedora.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
105 fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
106 fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm