2015-01-07 19:42:41 -08:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
|
|
|
VAGRANTFILE_API_VERSION = "2"
|
2015-01-13 16:36:00 -08:00
|
|
|
Vagrant.require_version ">=1.7.0"
|
2015-01-07 19:42:41 -08:00
|
|
|
|
|
|
|
$bootstrap_fedora = <<SCRIPT
|
2015-11-24 19:39:38 +00:00
|
|
|
dnf -y update
|
|
|
|
dnf -y install autoconf automake openssl-devel libtool \
|
2017-02-21 16:29:51 +01:00
|
|
|
python-devel python3-devel \
|
2017-03-06 15:46:43 -05:00
|
|
|
python-twisted python-zope-interface \
|
2016-12-22 10:58:25 -08:00
|
|
|
desktop-file-utils groff graphviz rpmdevtools nc curl \
|
2016-05-20 11:49:55 -07:00
|
|
|
wget python-six pyftpdlib checkpolicy selinux-policy-devel \
|
2019-01-15 18:58:15 -08:00
|
|
|
libcap-ng-devel kernel-devel-`uname -r` ethtool python-tftpy \
|
|
|
|
lftp
|
2015-01-07 19:42:41 -08:00
|
|
|
echo "search extra update built-in" >/etc/depmod.d/search_path.conf
|
2016-09-13 12:46:30 -03:00
|
|
|
SCRIPT
|
|
|
|
|
|
|
|
$bootstrap_debian = <<SCRIPT
|
|
|
|
aptitude -y update
|
|
|
|
aptitude -y upgrade
|
|
|
|
aptitude -y install -R \
|
2018-05-25 17:11:07 -07:00
|
|
|
build-essential dpkg-dev lintian devscripts fakeroot \
|
|
|
|
debhelper dh-autoreconf uuid-runtime \
|
|
|
|
autoconf automake libtool \
|
|
|
|
python-all python-twisted-core python-twisted-conch \
|
|
|
|
xdg-utils groff graphviz netcat curl \
|
|
|
|
wget python-six ethtool \
|
|
|
|
libcap-ng-dev libssl-dev python-dev openssl \
|
|
|
|
python-pyftpdlib python-flake8 python-tftpy \
|
2019-01-15 18:58:15 -08:00
|
|
|
linux-headers-`uname -r` \
|
|
|
|
lftp
|
2015-01-07 19:42:41 -08:00
|
|
|
SCRIPT
|
|
|
|
|
2016-09-27 16:13:11 -03:00
|
|
|
$bootstrap_centos = <<SCRIPT
|
|
|
|
yum -y update
|
|
|
|
yum -y install autoconf automake openssl-devel libtool \
|
|
|
|
python-twisted-core python-zope-interface \
|
2016-12-22 10:58:25 -08:00
|
|
|
desktop-file-utils groff graphviz rpmdevtools nc curl \
|
2016-09-27 16:13:11 -03:00
|
|
|
wget python-six pyftpdlib checkpolicy selinux-policy-devel \
|
2019-01-15 18:58:15 -08:00
|
|
|
libcap-ng-devel kernel-devel-`uname -r` ethtool net-tools \
|
|
|
|
lftp
|
2016-09-27 16:13:11 -03:00
|
|
|
SCRIPT
|
|
|
|
|
2015-01-07 19:42:41 -08:00
|
|
|
$configure_ovs = <<SCRIPT
|
2016-09-13 12:46:30 -03:00
|
|
|
cd /vagrant
|
|
|
|
./boot.sh
|
2016-10-08 07:27:17 -03:00
|
|
|
[ -f Makefile ] && ./configure && make distclean
|
2015-01-07 19:42:41 -08:00
|
|
|
mkdir -p ~/build
|
|
|
|
cd ~/build
|
2016-05-20 11:49:59 -07:00
|
|
|
/vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
|
2015-01-07 19:42:41 -08:00
|
|
|
SCRIPT
|
|
|
|
|
|
|
|
$build_ovs = <<SCRIPT
|
|
|
|
cd ~/build
|
|
|
|
make
|
|
|
|
SCRIPT
|
|
|
|
|
2015-01-13 16:36:00 -08:00
|
|
|
$test_kmod = <<SCRIPT
|
|
|
|
cd ~/build
|
2016-09-19 16:31:04 -03:00
|
|
|
make check-kmod RECHECK=yes
|
2015-01-13 16:36:00 -08:00
|
|
|
SCRIPT
|
|
|
|
|
2015-01-07 19:42:41 -08:00
|
|
|
$install_rpm = <<SCRIPT
|
|
|
|
cd ~/build
|
|
|
|
PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
|
|
|
|
make && make dist
|
|
|
|
rpmdev-setuptree
|
|
|
|
cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
|
2015-01-09 16:13:06 +01:00
|
|
|
rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
|
2015-01-07 19:42:41 -08:00
|
|
|
rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
|
2015-01-13 16:36:00 -08:00
|
|
|
rpm -e openvswitch
|
2016-05-25 17:17:37 -07:00
|
|
|
rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm
|
2015-01-13 16:36:00 -08:00
|
|
|
systemctl enable openvswitch
|
|
|
|
systemctl start openvswitch
|
|
|
|
systemctl status openvswitch
|
2015-01-07 19:42:41 -08:00
|
|
|
SCRIPT
|
|
|
|
|
2016-09-27 16:13:11 -03:00
|
|
|
$install_centos_rpm = <<SCRIPT
|
|
|
|
cd ~/build
|
|
|
|
PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
|
|
|
|
make && make dist
|
|
|
|
rpmdev-setuptree
|
|
|
|
cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
|
2017-03-06 15:46:43 -05:00
|
|
|
rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
|
|
|
|
rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
|
2016-09-27 16:13:11 -03:00
|
|
|
rpm -e openvswitch
|
|
|
|
rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.x86_64.rpm
|
|
|
|
systemctl enable openvswitch
|
|
|
|
systemctl start openvswitch
|
|
|
|
systemctl status openvswitch
|
|
|
|
SCRIPT
|
|
|
|
|
2016-09-13 12:46:30 -03:00
|
|
|
$install_deb = <<SCRIPT
|
|
|
|
cd ~/build
|
|
|
|
PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
|
|
|
|
make dist
|
|
|
|
cd ~/
|
|
|
|
ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz
|
|
|
|
rm -rf ~/openvswitch-$PACKAGE_VERSION
|
|
|
|
tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz
|
|
|
|
cd ~/openvswitch-$PACKAGE_VERSION
|
|
|
|
debuild -us -uc
|
|
|
|
dpkg -i ../openvswitch-{common,switch}*deb
|
|
|
|
systemctl enable openvswitch-switch
|
|
|
|
systemctl start openvswitch-switch
|
|
|
|
systemctl status openvswitch-switch
|
|
|
|
SCRIPT
|
|
|
|
|
2015-08-07 19:40:37 +01:00
|
|
|
$test_ovs_system_userspace = <<SCRIPT
|
|
|
|
cd ~/build
|
2016-09-19 16:31:04 -03:00
|
|
|
make check-system-userspace RECHECK=yes
|
2015-08-07 19:40:37 +01:00
|
|
|
SCRIPT
|
|
|
|
|
2015-01-07 19:42:41 -08:00
|
|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
2016-09-13 12:46:30 -03:00
|
|
|
config.vm.define "debian-8" do |debian|
|
|
|
|
debian.vm.box = "debian/jessie64"
|
|
|
|
debian.vm.synced_folder ".", "/vagrant", type: "rsync"
|
|
|
|
debian.vm.provision "bootstrap", type: "shell", inline: $bootstrap_debian
|
|
|
|
debian.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
|
|
|
|
debian.vm.provision "build_ovs", type: "shell", inline: $build_ovs
|
|
|
|
debian.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
|
|
|
|
debian.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
|
|
|
|
debian.vm.provision "install_deb", type: "shell", inline: $install_deb
|
|
|
|
end
|
2016-05-25 17:17:37 -07:00
|
|
|
config.vm.define "fedora-23" do |fedora|
|
2017-02-09 15:00:36 +01:00
|
|
|
fedora.vm.box = "fedora/23-cloud-base"
|
|
|
|
fedora.vm.synced_folder ".", "/vagrant", type: "rsync"
|
2015-01-13 16:36:00 -08:00
|
|
|
fedora.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora
|
|
|
|
fedora.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
|
|
|
|
fedora.vm.provision "build_ovs", type: "shell", inline: $build_ovs
|
|
|
|
fedora.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
|
2015-08-07 19:40:37 +01:00
|
|
|
fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
|
2015-01-13 16:36:00 -08:00
|
|
|
fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm
|
|
|
|
end
|
2017-02-09 15:00:36 +01:00
|
|
|
config.vm.define "centos-7" do |centos|
|
|
|
|
centos.vm.box = "centos/7"
|
2016-09-27 16:13:11 -03:00
|
|
|
centos.vm.synced_folder ".", "/vagrant", type: "rsync"
|
|
|
|
centos.vm.provision "bootstrap", type: "shell", inline: $bootstrap_centos
|
|
|
|
centos.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
|
|
|
|
centos.vm.provision "build_ovs", type: "shell", inline: $build_ovs
|
|
|
|
centos.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
|
|
|
|
centos.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
|
|
|
|
centos.vm.provision "install_rpm", type: "shell", inline: $install_centos_rpm
|
|
|
|
end
|
2015-01-07 19:42:41 -08:00
|
|
|
end
|