]>
Commit | Line | Data |
---|---|---|
b56b2566 AZ |
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" | |
3314f01e | 6 | Vagrant.require_version ">=1.7.0" |
b56b2566 AZ |
7 | |
8 | $bootstrap_fedora = <<SCRIPT | |
d64c5e86 MG |
9 | dnf -y update |
10 | dnf -y install autoconf automake openssl-devel libtool \ | |
bb1a7ca2 | 11 | python-devel python3-devel \ |
06c58061 | 12 | python-twisted-core python-zope-interface \ |
40c7b2fc | 13 | desktop-file-utils groff graphviz rpmdevtools nc curl \ |
6a6b35fc | 14 | wget python-six pyftpdlib checkpolicy selinux-policy-devel \ |
40c7b2fc | 15 | libcap-ng-devel kernel-devel-`uname -r` ethtool python-tftpy |
b56b2566 | 16 | echo "search extra update built-in" >/etc/depmod.d/search_path.conf |
7c127f28 TLSC |
17 | SCRIPT |
18 | ||
19 | $bootstrap_debian = <<SCRIPT | |
20 | aptitude -y update | |
21 | aptitude -y upgrade | |
22 | aptitude -y install -R \ | |
23 | build-essential dpkg-dev lintian devscripts fakeroot \ | |
24 | debhelper dh-autoreconf uuid-runtime \ | |
25 | autoconf automake libtool \ | |
26 | python-all python-twisted-core python-twisted-conch \ | |
40c7b2fc | 27 | xdg-utils groff graphviz netcat curl \ |
7c127f28 TLSC |
28 | wget python-six ethtool \ |
29 | libcap-ng-dev libssl-dev python-dev openssl \ | |
40c7b2fc | 30 | python-pyftpdlib python-flake8 python-tftpy \ |
7c127f28 | 31 | linux-headers-`uname -r` |
b56b2566 AZ |
32 | SCRIPT |
33 | ||
888e071e TLSC |
34 | $bootstrap_centos = <<SCRIPT |
35 | yum -y update | |
36 | yum -y install autoconf automake openssl-devel libtool \ | |
37 | python-twisted-core python-zope-interface \ | |
40c7b2fc | 38 | desktop-file-utils groff graphviz rpmdevtools nc curl \ |
888e071e TLSC |
39 | wget python-six pyftpdlib checkpolicy selinux-policy-devel \ |
40 | libcap-ng-devel kernel-devel-`uname -r` ethtool | |
41 | SCRIPT | |
42 | ||
b56b2566 | 43 | $configure_ovs = <<SCRIPT |
7c127f28 TLSC |
44 | cd /vagrant |
45 | ./boot.sh | |
3d982663 | 46 | [ -f Makefile ] && ./configure && make distclean |
b56b2566 AZ |
47 | mkdir -p ~/build |
48 | cd ~/build | |
1a523ec4 | 49 | /vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules |
b56b2566 AZ |
50 | SCRIPT |
51 | ||
52 | $build_ovs = <<SCRIPT | |
53 | cd ~/build | |
54 | make | |
55 | SCRIPT | |
56 | ||
3314f01e AZ |
57 | $test_kmod = <<SCRIPT |
58 | cd ~/build | |
960e99dc | 59 | make check-kmod RECHECK=yes |
3314f01e AZ |
60 | SCRIPT |
61 | ||
b56b2566 AZ |
62 | $install_rpm = <<SCRIPT |
63 | cd ~/build | |
64 | PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac` | |
65 | make && make dist | |
66 | rpmdev-setuptree | |
67 | cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES | |
d06c1ff8 | 68 | rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec |
b56b2566 | 69 | rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec |
3314f01e | 70 | rpm -e openvswitch |
53de7528 | 71 | rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm |
3314f01e AZ |
72 | systemctl enable openvswitch |
73 | systemctl start openvswitch | |
74 | systemctl status openvswitch | |
b56b2566 AZ |
75 | SCRIPT |
76 | ||
888e071e TLSC |
77 | $install_centos_rpm = <<SCRIPT |
78 | cd ~/build | |
79 | PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac` | |
80 | make && make dist | |
81 | rpmdev-setuptree | |
82 | cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES | |
83 | rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-rhel6.spec | |
84 | rpmbuild --bb --without check /vagrant/rhel/openvswitch.spec | |
85 | rpm -e openvswitch | |
86 | rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.x86_64.rpm | |
87 | systemctl enable openvswitch | |
88 | systemctl start openvswitch | |
89 | systemctl status openvswitch | |
90 | SCRIPT | |
91 | ||
7c127f28 TLSC |
92 | $install_deb = <<SCRIPT |
93 | cd ~/build | |
94 | PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac` | |
95 | make dist | |
96 | cd ~/ | |
97 | ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz | |
98 | rm -rf ~/openvswitch-$PACKAGE_VERSION | |
99 | tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz | |
100 | cd ~/openvswitch-$PACKAGE_VERSION | |
101 | debuild -us -uc | |
102 | dpkg -i ../openvswitch-{common,switch}*deb | |
103 | systemctl enable openvswitch-switch | |
104 | systemctl start openvswitch-switch | |
105 | systemctl status openvswitch-switch | |
106 | SCRIPT | |
107 | ||
548f9fe7 DDP |
108 | $test_ovs_system_userspace = <<SCRIPT |
109 | cd ~/build | |
960e99dc | 110 | make check-system-userspace RECHECK=yes |
548f9fe7 DDP |
111 | SCRIPT |
112 | ||
b56b2566 | 113 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
7c127f28 TLSC |
114 | config.vm.define "debian-8" do |debian| |
115 | debian.vm.box = "debian/jessie64" | |
116 | debian.vm.synced_folder ".", "/vagrant", type: "rsync" | |
117 | debian.vm.provision "bootstrap", type: "shell", inline: $bootstrap_debian | |
118 | debian.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs | |
119 | debian.vm.provision "build_ovs", type: "shell", inline: $build_ovs | |
120 | debian.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod | |
121 | debian.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace | |
122 | debian.vm.provision "install_deb", type: "shell", inline: $install_deb | |
123 | end | |
53de7528 JS |
124 | config.vm.define "fedora-23" do |fedora| |
125 | fedora.vm.box = "bento/fedora-23" | |
3314f01e AZ |
126 | fedora.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora |
127 | fedora.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs | |
128 | fedora.vm.provision "build_ovs", type: "shell", inline: $build_ovs | |
129 | fedora.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod | |
548f9fe7 | 130 | fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace |
3314f01e AZ |
131 | fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm |
132 | end | |
888e071e TLSC |
133 | config.vm.define "centos-7.2" do |centos| |
134 | centos.vm.box = "bento/centos-7.2" | |
135 | centos.vm.synced_folder ".", "/vagrant", type: "rsync" | |
136 | centos.vm.provision "bootstrap", type: "shell", inline: $bootstrap_centos | |
137 | centos.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs | |
138 | centos.vm.provision "build_ovs", type: "shell", inline: $build_ovs | |
139 | centos.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod | |
140 | centos.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace | |
141 | centos.vm.provision "install_rpm", type: "shell", inline: $install_centos_rpm | |
142 | end | |
b56b2566 | 143 | end |