]> git.proxmox.com Git - mirror_ovs.git/blob - Vagrantfile
72f224c6ea4f499ca71759c6df06971d886a329d
[mirror_ovs.git] / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3
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"
7
8 $bootstrap_fedora = <<SCRIPT
9 dnf -y update
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
16 SCRIPT
17
18 $bootstrap_debian = <<SCRIPT
19 aptitude -y update
20 aptitude -y upgrade
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`
31 SCRIPT
32
33 $configure_ovs = <<SCRIPT
34 cd /vagrant
35 ./boot.sh
36 mkdir -p ~/build
37 cd ~/build
38 /vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
39 SCRIPT
40
41 $build_ovs = <<SCRIPT
42 cd ~/build
43 make
44 SCRIPT
45
46 $test_kmod = <<SCRIPT
47 cd ~/build
48 make check-kmod
49 SCRIPT
50
51 $install_rpm = <<SCRIPT
52 cd ~/build
53 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
54 make && make dist
55 rpmdev-setuptree
56 cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
57 rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
58 rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
59 rpm -e openvswitch
60 rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm
61 systemctl enable openvswitch
62 systemctl start openvswitch
63 systemctl status openvswitch
64 SCRIPT
65
66 $install_deb = <<SCRIPT
67 cd ~/build
68 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
69 make dist
70 cd ~/
71 ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz
72 rm -rf ~/openvswitch-$PACKAGE_VERSION
73 tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz
74 cd ~/openvswitch-$PACKAGE_VERSION
75 debuild -us -uc
76 dpkg -i ../openvswitch-{common,switch}*deb
77 systemctl enable openvswitch-switch
78 systemctl start openvswitch-switch
79 systemctl status openvswitch-switch
80 SCRIPT
81
82 $test_ovs_system_userspace = <<SCRIPT
83 cd ~/build
84 make check-system-userspace
85 SCRIPT
86
87 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
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
98 config.vm.define "fedora-23" do |fedora|
99 fedora.vm.box = "bento/fedora-23"
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
104 fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
105 fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm
106 end
107 end