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
Failed to generate hash of commit
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

View file

@ -1,70 +1,43 @@
---
boxes:
defaults:
uefi: true
ram: '6144'
cpu: '6'
boxes:
- name: arch-gnome
box: aa-archlinux-gnome
uefi: false
ram: '6144'
cpu: '6'
- name: arch-kde
box: aa-archlinux-kde
uefi: false
ram: '6144'
cpu: '6'
- name: arch-server
box: aa-archlinux-server
uefi: false
ram: '6144'
cpu: '6'
- name: ubuntu-desktop
box: aa-ubuntu-desktop
uefi: true
ram: '6144'
cpu: '6'
- name: ubuntu-desktop24
box: aa-ubuntu-desktop24
uefi: true
ram: '6144'
cpu: '6'
- name: ubuntu-server
box: aa-ubuntu-server
uefi: true
ram: '6144'
cpu: '6'
- name: ubuntu-server24
box: aa-ubuntu-server24
uefi: true
ram: '6144'
cpu: '6'
- name: debian-server
box: aa-debian-server
uefi: true
ram: '6144'
cpu: '6'
- name: debian-gnome
box: aa-debian-gnome
uefi: true
ram: '6144'
cpu: '6'
- name: debian-kde
box: aa-debian-kde
uefi: true
ram: '6144'
cpu: '6'
- name: opensuse-kde
box: aa-opensuse-kde
uefi: true
ram: '6144'
cpu: '6'