-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add in Vagrantfiles for running tests in nested virt
This will allow one to bring up a clean env to run the tests in and then throw it away. Right now the nested virt for virtualbox doesn't work but hoping to work out the kinks with that one day.
- Loading branch information
Showing
4 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
To bring up vagrant host: | ||
|
||
vagrant up | ||
|
||
To run tests: | ||
|
||
vagrant ssh | ||
|
||
and then: | ||
|
||
cd /sharedfolder/code/github.com/dustymabe/vagrant-sshfs/ | ||
gem install bundler | ||
bundle install | ||
bundle exec rake features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
Vagrant.configure(2) do |config| | ||
|
||
config.ssh.insert_key = 'true' | ||
config.vm.synced_folder "/guests/sharedfolder", "/sharedfolder", type: "sshfs" | ||
|
||
config.vm.provider :libvirt do |domain| | ||
domain.memory = 4096 | ||
domain.cpus = 4 | ||
domain.nested = true | ||
end | ||
|
||
host = 'viv-libvirt' # vagrant in vagrant - to test libvirt | ||
box = 'fedora/24-cloud-base' | ||
|
||
config.vm.define host do | tmp | | ||
tmp.vm.hostname = host | ||
tmp.vm.box = box | ||
end | ||
config.vm.provision "shell", inline: <<-SHELL | ||
rpms=( | ||
libvirt-daemon-kvm # for vagrant libvirt support | ||
make gcc ruby ruby-devel redhat-rpm-config # for building gems | ||
gcc-c++ # for building unf_ext | ||
libvirt-devel # for building ruby-libvirt gem | ||
zlib-devel # for building nokogiri gem | ||
git # for the git ls-files in gemspec file | ||
bsdtar # used by vagrant to unpack box files | ||
) | ||
dnf install -y ${rpms[@]} | ||
usermod -a -G libvirt vagrant | ||
systemctl start libvirtd virtlogd | ||
SHELL | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# XXX Note this is not working right now as nested virt. I keep | ||
# getting kernel tracebacks on Fedora 24. | ||
|
||
To bring up vagrant host: | ||
|
||
vagrant up | ||
|
||
To run tests: | ||
|
||
vagrant ssh | ||
|
||
and then: | ||
|
||
cd /sharedfolder/code/github.com/dustymabe/vagrant-sshfs/ | ||
gem install bundler | ||
bundle install | ||
bundle exec rake features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
# | ||
# XXX Note this is not working right now as nested virt. I keep | ||
# getting kernel tracebacks on Fedora 24. | ||
# | ||
Vagrant.configure(2) do |config| | ||
|
||
config.ssh.insert_key = 'true' | ||
config.vm.synced_folder "/guests/sharedfolder", "/sharedfolder", type: "sshfs" | ||
|
||
config.vm.provider :libvirt do |domain| | ||
domain.memory = 4096 | ||
domain.cpus = 4 | ||
domain.nested = true | ||
end | ||
|
||
host = 'viv-virtbox' # vagrant in vagrant - to test virtbox | ||
box = 'fedora/24-cloud-base' | ||
|
||
config.vm.define host do | tmp | | ||
tmp.vm.hostname = host | ||
tmp.vm.box = box | ||
end | ||
# Must use VirtualBox-5.0 - 5.1 not supported by Vagrant yet | ||
config.vm.provision "shell", inline: <<-SHELL | ||
dnf config-manager --add-repo http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo | ||
rpms=( | ||
kernel-devel-$(uname -r) kernel-headers-$(uname -r) | ||
gcc make VirtualBox-5.0 # all for virtualbox support | ||
make gcc ruby ruby-devel redhat-rpm-config # for building gems | ||
gcc-c++ # for building unf_ext | ||
libvirt-devel # for building ruby-libvirt gem | ||
zlib-devel # for building nokogiri gem | ||
git # for the git ls-files in gemspec file | ||
bsdtar # used by vagrant to unpack box files | ||
) | ||
dnf install -y ${rpms[@]} | ||
/usr/lib/virtualbox/vboxdrv.sh setup | ||
usermod -a -G vboxusers vagrant | ||
SHELL | ||
end |