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