]>
Commit | Line | Data |
---|---|---|
ef9c432c WT |
1 | # -*- mode: ruby -*- |
2 | # vi: set ft=ruby : | |
3 | ||
4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure | |
5 | # configures the configuration version (we support older styles for | |
6 | # backwards compatibility). Please don't change it unless you know what | |
7 | # you're doing. | |
8 | ||
9 | VAGRANTFILE_API_VERSION = "2" | |
10 | Vagrant.require_version ">=1.7.0" | |
11 | ||
12 | $bootstrap_freebsd = <<SCRIPT | |
13 | sed -e 's/\#DEFAULT_ALWAYS_YES = false/DEFAULT_ALWAYS_YES = true/g' -e 's/\#ASSUME_ALWAYS_YES = false/ASSUME_ALWAYS_YES = true/g' /usr/local/etc/pkg.conf > /tmp/pkg.conf | |
14 | mv -f /tmp/pkg.conf /usr/local/etc/pkg.conf | |
15 | pkg install automake libtool wget python py27-six gmake | |
16 | SCRIPT | |
17 | ||
18 | $configure_ovs = <<SCRIPT | |
19 | cd /vagrant | |
20 | ./boot.sh | |
21 | mkdir -p ~/build | |
22 | cd ~/build | |
23 | sudo /vagrant/configure --disable-libcapng --enable-silent-rules | |
24 | SCRIPT | |
25 | ||
26 | $build_ovs = <<SCRIPT | |
27 | cd ~/build | |
28 | gmake | |
29 | SCRIPT | |
30 | ||
31 | $test_userspace = <<SCRIPT | |
32 | cd ~/build | |
33 | gmake check | |
34 | SCRIPT | |
35 | ||
36 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
37 | # Use NFS due to capability 'mount_virtualbox_shared_folder' | |
38 | # does not work on FreeBSD. | |
39 | config.vm.network :private_network, ip: "10.0.0.2" | |
40 | config.vm.synced_folder ".", "/vagrant", :nfs => true | |
41 | ||
42 | config.vm.define "freebsd-10.2" do |freebsd| | |
43 | freebsd.vm.box = "bento/freebsd-10.2" | |
44 | freebsd.vm.provision "bootstrap", type: "shell", inline: $bootstrap_freebsd | |
45 | freebsd.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs | |
46 | freebsd.vm.provision "build_ovs", type: "shell", inline: $build_ovs | |
47 | freebsd.vm.provision "test_userspace", type: "shell", inline: $test_userspace | |
48 | end | |
49 | end |