]> git.proxmox.com Git - mirror_ovs.git/blob - Vagrantfile
ofproto-dpif-xlate: Translate timeout policy in ct action
[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-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 \
16 lftp
17 echo "search extra update built-in" >/etc/depmod.d/search_path.conf
18 SCRIPT
19
20 $bootstrap_debian = <<SCRIPT
21 aptitude -y update
22 aptitude -y upgrade
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` \
33 lftp
34 SCRIPT
35
36 $bootstrap_centos = <<SCRIPT
37 yum -y update
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 \
43 lftp
44 SCRIPT
45
46 $configure_ovs = <<SCRIPT
47 cd /vagrant
48 ./boot.sh
49 [ -f Makefile ] && ./configure && make distclean
50 mkdir -p ~/build
51 cd ~/build
52 /vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
53 SCRIPT
54
55 $build_ovs = <<SCRIPT
56 cd ~/build
57 make
58 SCRIPT
59
60 $test_kmod = <<SCRIPT
61 cd ~/build
62 make check-kmod RECHECK=yes
63 SCRIPT
64
65 $install_rpm = <<SCRIPT
66 cd ~/build
67 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
68 make && make dist
69 rpmdev-setuptree
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
73 rpm -e openvswitch
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
78 SCRIPT
79
80 $install_centos_rpm = <<SCRIPT
81 cd ~/build
82 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
83 make && make dist
84 rpmdev-setuptree
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
88 rpm -e openvswitch
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
93 SCRIPT
94
95 $install_deb = <<SCRIPT
96 cd ~/build
97 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
98 make dist
99 cd ~/
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
104 debuild -us -uc
105 dpkg -i ../openvswitch-{common,switch}*deb
106 systemctl enable openvswitch-switch
107 systemctl start openvswitch-switch
108 systemctl status openvswitch-switch
109 SCRIPT
110
111 $test_ovs_system_userspace = <<SCRIPT
112 cd ~/build
113 make check-system-userspace RECHECK=yes
114 SCRIPT
115
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
126 end
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
136 end
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
146 end
147 end