tests: support default value in vagrant boxes.

This commit is contained in:
Alexandre Pujol 2024-02-24 14:11:59 +00:00
parent a1ce144e1c
commit cefd372099
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
2 changed files with 10 additions and 36 deletions

9
tests/Vagrantfile vendored
View file

@ -6,6 +6,7 @@
require 'yaml'
machines = YAML.load_file(File.join(File.dirname(__FILE__), 'boxes.yml'))
default = machines['defaults']
Vagrant.require_version '>= 2.0.0'
@ -33,9 +34,9 @@ Vagrant.configure("2") do |config|
libvirt.driver = 'kvm'
libvirt.default_prefix = 'aa-'
libvirt.connect_via_ssh = false
libvirt.storage_pool_name = 'default'
libvirt.memory = instance['ram']
libvirt.cpus = instance['cpu']
libvirt.storage_pool_name = 'ssd'
libvirt.memory = instance.fetch('ram', default['ram'])
libvirt.cpus = instance.fetch('cpu', default['cpu'])
libvirt.cpu_mode = 'host-passthrough'
libvirt.machine_type = 'q35'
libvirt.video_type = 'virtio'
@ -51,7 +52,7 @@ Vagrant.configure("2") do |config|
(1..2).each do
libvirt.redirdev :type => "spicevmc"
end
if instance['uefi']
if instance.fetch('uefi', default['uefi'])
libvirt.loader = '/usr/share/edk2-ovmf/x64/OVMF_CODE.fd'
end
end