diff --git a/tests/Vagrantfile b/tests/Vagrantfile index 78e3b6bbb..f345ba089 100644 --- a/tests/Vagrantfile +++ b/tests/Vagrantfile @@ -24,10 +24,12 @@ Vagrant.configure("2") do |config| srv.vm.box_check_update = false srv.vm.post_up_message = instance.to_yaml srv.vm.synced_folder '../', '/home/user/Projects/apparmor.d', type: 'virtiofs' + srv.vm.synced_folder '.', '/vagrant', disabled: true # 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 = 'default' libvirt.memory = instance['ram'] diff --git a/tests/packer/debian.pkr.hcl b/tests/packer/debian.pkr.hcl index 5f0a806a5..43e7851ba 100644 --- a/tests/packer/debian.pkr.hcl +++ b/tests/packer/debian.pkr.hcl @@ -22,7 +22,7 @@ source "qemu" "debian-server" { output_directory = "${var.output}/" vm_name = "${var.prefix}${source.name}.qcow2" boot_wait = "10s" - firmware = "/usr/share/edk2-ovmf/x64/OVMF_CODE.fd" + firmware = "${var.firmware}" shutdown_command = "echo ${var.password} | sudo -S /sbin/shutdown -hP now" cd_label = "cidata" cd_content = { diff --git a/tests/packer/init/clean.sh b/tests/packer/init/clean.sh old mode 100755 new mode 100644 index 26f59b7b8..0e7b08568 --- a/tests/packer/init/clean.sh +++ b/tests/packer/init/clean.sh @@ -122,7 +122,7 @@ impersonalize() { # Remove itself "$(readlink -f "$SELF")" ) - rm -rvf "${remove[@]}" + rm -rf "${remove[@]}" } diff --git a/tests/packer/init/init.sh b/tests/packer/init/init.sh index 56b133974..e51c74ace 100644 --- a/tests/packer/init/init.sh +++ b/tests/packer/init/init.sh @@ -21,6 +21,7 @@ main() { install -Dm0644 $SRC/parser.conf /etc/apparmor/parser.conf install -Dm0644 $SRC/site.local /etc/apparmor.d/tunables/multiarch.d/site.local install -Dm0755 $SRC/aa-update /usr/bin/aa-update + install -Dm0755 $SRC/aa-log-clean /usr/bin/aa-log-clean chown -R "$SUDO_USER:$SUDO_USER" "/home/$SUDO_USER/.config/" case "$DISTRIBUTION" in arch) pacman --noconfirm -U $SRC/apparmor.d-*-x86_64.pkg.tar.zst ;; diff --git a/tests/packer/opensuse.pkr.hcl b/tests/packer/opensuse.pkr.hcl index f86a463b9..e32374e13 100644 --- a/tests/packer/opensuse.pkr.hcl +++ b/tests/packer/opensuse.pkr.hcl @@ -28,7 +28,7 @@ source "qemu" "opensuse-kde" { output_directory = "${var.iso_dir}/packer/" vm_name = "${var.prefix}${source.name}.qcow2" boot_wait = "10s" - firmware = "/usr/share/edk2-ovmf/x64/OVMF_CODE.fd" + firmware = "${var.firmware}" shutdown_command = "echo ${var.password} | sudo shutdown -hP now" cd_label = "cidata" cd_content = { diff --git a/tests/packer/src/aa-log-clean b/tests/packer/src/aa-log-clean new file mode 100644 index 000000000..9f3ebd818 --- /dev/null +++ b/tests/packer/src/aa-log-clean @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -eu +rm -rf /var/log/audit/* +touch /var/log/audit/audit.log diff --git a/tests/packer/variables.pkr.hcl b/tests/packer/variables.pkr.hcl index 34bd650a4..a6a50553c 100644 --- a/tests/packer/variables.pkr.hcl +++ b/tests/packer/variables.pkr.hcl @@ -29,7 +29,7 @@ variable "ssh_privatekey" { } variable "disk_size" { - description = "Disk size of the App VM to build" + description = "Disk size of the VM to build" type = string default = "10G" } @@ -46,6 +46,12 @@ variable "base_dir" { default = "/var/lib/libvirt/images" } +variable "firmware" { + description = "Path to the UEFI firmware" + type = string + default = "/usr/share/edk2-ovmf/x64/OVMF_CODE.fd" +} + variable "output" { description = "Output build directory" type = string @@ -82,8 +88,8 @@ variable "release" { version = "22.04.2", }, "debian" : { - codename = "bullseye", - version = "11", + codename = "bookworm", + version = "12", } "opensuse" : { codename = "tumbleweed",