tests: add Justile, used as integration environment helper.

This commit is contained in:
Alexandre Pujol 2025-03-01 16:15:55 +01:00
parent 0b029ec42f
commit 1392b078ab
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
4 changed files with 162 additions and 140 deletions

View file

@ -1,27 +0,0 @@
#!/usr/bin/make -f
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
# Usage:
# make archlinux flavor=gnome
# vagrant up arch-gnome
# vagrant ssh archl-gnome
# Build variables
flavor ?=
disk ?= 10G
BASE = archlinux debian ubuntu22 ubuntu24 opensuse fedora
.PHONY: ${BASE} lint
$(BASE):
@make --directory=../ package dist=${@}
@packer build -force \
-var disk_size=${disk} -var flavor="${flavor}" \
-only=qemu.${@} packer/
lint:
@packer fmt --check packer/
@packer validate --syntax-only packer/

62
tests/Vagrantfile vendored
View file

@ -1,62 +0,0 @@
# -*- mode: ruby -*-
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
require 'yaml'
machines = YAML.load_file(File.join(File.dirname(__FILE__), 'boxes.yml'))
default = machines['defaults']
Vagrant.require_version '>= 2.0.0'
Vagrant.configure("2") do |config|
config.ssh.keys_only = true
config.ssh.insert_key = false
config.ssh.private_key_path = [ '~/.ssh/id_ed25519' ]
config.ssh.username = 'user'
machines['boxes'].each do |instance|
# Configure the VMs per details in boxes.yml
config.vm.define instance['name'] do |srv|
srv.vm.box = instance['box']
srv.vm.box_check_update = false
srv.vm.post_up_message = instance.to_yaml
srv.vm.synced_folder '.', '/vagrant', disabled: true
if !ENV['AA_INTEGRATION']
srv.vm.synced_folder '../', '/home/user/Projects/apparmor.d', type: 'virtiofs', mount: false
end
# Configure Libvirt provider
srv.vm.provider 'libvirt' do |libvirt|
libvirt.driver = 'kvm'
libvirt.default_prefix = 'aa-'
libvirt.connect_via_ssh = false
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'
libvirt.graphics_type = 'spice'
libvirt.sound_type = 'ich9'
libvirt.tpm_model = 'tpm-crb'
libvirt.tpm_type = 'emulator'
libvirt.tpm_version = '2.0'
libvirt.random model: 'random'
libvirt.memorybacking 'source', type: 'memfd'
libvirt.memorybacking 'access', mode: 'shared'
libvirt.channel type: 'unix', target_name: 'org.qemu.guest_agent.0', target_type: 'virtio'
(1..2).each do
libvirt.redirdev :type => "spicevmc"
end
if instance.fetch('uefi', default['uefi'])
libvirt.loader = '/usr/share/edk2/x64/OVMF_CODE.fd'
end
end
end
end
end

View file

@ -1,51 +0,0 @@
---
defaults:
uefi: true
ram: '3072'
cpu: '6'
boxes:
- name: arch-gnome
box: aa-archlinux-gnome
uefi: false
- name: arch-kde
box: aa-archlinux-kde
uefi: false
- name: arch-xfce
box: aa-archlinux-xfce
uefi: false
- name: arch-cosmic
box: aa-archlinux-cosmic
uefi: false
- name: arch-server
box: aa-archlinux-server
uefi: false
- name: ubuntu22-desktop
box: aa-ubuntu22-desktop
- name: ubuntu24-desktop
box: aa-ubuntu24-desktop
- name: ubuntu22-server
box: aa-ubuntu22-server
- name: ubuntu24-server
box: aa-ubuntu24-server24
- name: debian-server
box: aa-debian-server
- name: debian-gnome
box: aa-debian-gnome
- name: debian-kde
box: aa-debian-kde
- name: opensuse-kde
box: aa-opensuse-kde