]>
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 \ |
db8dcbaf | 12 | python-twisted python-zope-interface \ |
40c7b2fc | 13 | desktop-file-utils groff graphviz rpmdevtools nc curl \ |
6a6b35fc | 14 | wget python-six pyftpdlib checkpolicy selinux-policy-devel \ |
253e4dc0 DM |
15 | libcap-ng-devel kernel-devel-`uname -r` ethtool python-tftpy \ |
16 | lftp | |
b56b2566 | 17 | echo "search extra update built-in" >/etc/depmod.d/search_path.conf |
7c127f28 TLSC |
18 | SCRIPT |
19 | ||
20 | $bootstrap_debian = <<SCRIPT | |
21 | aptitude -y update | |
22 | aptitude -y upgrade | |
23 | aptitude -y install -R \ | |
5a0e4aec BP |
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 \ | |
253e4dc0 DM |
32 | linux-headers-`uname -r` \ |
33 | lftp | |
b56b2566 AZ |
34 | SCRIPT |
35 | ||
888e071e TLSC |
36 | $bootstrap_centos = <<SCRIPT |
37 | yum -y update | |
38 | yum -y install autoconf automake openssl-devel libtool \ | |
39 | python-twisted-core python-zope-interface \ | |
40c7b2fc | 40 | desktop-file-utils groff graphviz rpmdevtools nc curl \ |
888e071e | 41 | wget python-six pyftpdlib checkpolicy selinux-policy-devel \ |
253e4dc0 DM |
42 | libcap-ng-devel kernel-devel-`uname -r` ethtool net-tools \ |
43 | lftp | |
888e071e TLSC |
44 | SCRIPT |
45 | ||
b56b2566 | 46 | $configure_ovs = <<SCRIPT |
7c127f28 TLSC |
47 | cd /vagrant |
48 | ./boot.sh | |
3d982663 | 49 | [ -f Makefile ] && ./configure && make distclean |
b56b2566 AZ |
50 | mkdir -p ~/build |
51 | cd ~/build | |
1a523ec4 | 52 | /vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules |
b56b2566 AZ |
53 | SCRIPT |
54 | ||
55 | $build_ovs = <<SCRIPT | |
56 | cd ~/build | |
57 | make | |
58 | SCRIPT | |
59 | ||
3314f01e AZ |
60 | $test_kmod = <<SCRIPT |
61 | cd ~/build | |
960e99dc | 62 | make check-kmod RECHECK=yes |
3314f01e AZ |
63 | SCRIPT |
64 | ||
b56b2566 AZ |
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 | |
d06c1ff8 | 71 | rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec |
b56b2566 | 72 | rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec |
3314f01e | 73 | rpm -e openvswitch |
53de7528 | 74 | rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm |
3314f01e AZ |
75 | systemctl enable openvswitch |
76 | systemctl start openvswitch | |
77 | systemctl status openvswitch | |
b56b2566 AZ |
78 | SCRIPT |
79 | ||
888e071e TLSC |
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 | |
db8dcbaf LM |
86 | rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec |
87 | rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec | |
888e071e TLSC |
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 | ||
7c127f28 TLSC |
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 | ||
548f9fe7 DDP |
111 | $test_ovs_system_userspace = <<SCRIPT |
112 | cd ~/build | |
960e99dc | 113 | make check-system-userspace RECHECK=yes |
548f9fe7 DDP |
114 | SCRIPT |
115 | ||
b56b2566 | 116 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
7c127f28 TLSC |
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 | |
53de7528 | 127 | config.vm.define "fedora-23" do |fedora| |
2fde4546 TR |
128 | fedora.vm.box = "fedora/23-cloud-base" |
129 | fedora.vm.synced_folder ".", "/vagrant", type: "rsync" | |
3314f01e AZ |
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 | |
548f9fe7 | 134 | fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace |
3314f01e AZ |
135 | fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm |
136 | end | |
2fde4546 TR |
137 | config.vm.define "centos-7" do |centos| |
138 | centos.vm.box = "centos/7" | |
888e071e TLSC |
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 | |
b56b2566 | 147 | end |