Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrantfile for integration tests #234

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# You can use this file to easily run integration test. In order to run them,
# build RPM using `make rpm` and then run `vagrant up`. If all went just fine,
# you can run `vagrant destroy` to clean up the VM.
#
# If anything went wrong, you can `vagrant ssh` into the machine and try to
# tweak the tests by hand there, or you can fix them locally and run `vagrant
# rsync-auto` to sync new RPMs, then ssh into the machine,
# `dnf remove 'golang-github-osbuild-composer-*'`, log out of the machine, and
# run `vagrant provision` (yes, it was not intended for this use case, but works
# just fine).

Vagrant.configure("2") do |config|
config.vm.box = "fedora/31-cloud-base"

# This is needed for dnf, without all the RAM OOM killer will kill it during
# depsolving :)
config.vm.provider :libvirt do |libvirt|
libvirt.memory = 4096
libvirt.cpus = 2
end

# :-O what the sed?!
config.vm.provision "shell", inline: <<-SHELL
dnf install /vagrant/output/x86_64/*.rpm -y && \
sed -i 's|31|30|' /etc/os-release && \
systemctl start osbuild-composer.socket && \
pushd /usr/libexec/osbuild-composer && \
su vagrant -c /usr/libexec/tests/osbuild-composer/osbuild-tests
SHELL
end