zfsbootmenu/testing
Zach Dykstra 577ef3959d testing: add Makefile to install Void deps 2024-09-25 16:18:07 -05:00
..
helpers testing: fix debootstrap for ubuntu 2024-06-24 23:12:39 -04:00
initcpio testing/initcpio: add interactive mode, include ubuntu install deps 2023-12-01 10:17:25 -05:00
stubs Add licenses for binary objects 2021-10-14 13:14:02 -05:00
validation Record basic test script for space handling 2020-12-02 00:38:07 -05:00
.gitignore Flesh out testing to cover new features 2021-10-24 20:14:40 -04:00
Makefile testing: add Makefile to install Void deps 2024-09-25 16:18:07 -05:00
README.md De-prioritize Dracut as the primary generator 2022-01-27 12:56:11 -05:00
TPSReport.md TPSReport.md: add recovery image networking checks 2023-12-08 21:34:52 -06:00
rollup.pl testing: sanitize perfdata output and validate input 2023-12-11 11:09:43 -06:00
run.sh testing: sanitize perfdata output and validate input 2023-12-11 11:09:43 -06:00
setup.sh testing: allowing building testbeds in a virtual machine 2023-11-30 16:37:21 -05:00

README.md

Requirements

The testing environment setup and runtime depends on the following tools:

  • kpartx
  • qemu
  • yq-go
  • ZFS
  • kvm kernel module

Arch

  • m4
  • pacman
  • gpg

Ubuntu, Debian

  • debootstrap

Creating a ZFSBootMenu Test Pool for QEMU

First, run ./setup.sh -a; this will create, if necessary, a test directory (chosen automatically or specified with the -D command-line flag) and, within the test directory:

  • Create a test pool
    1. Create a 5GB RAW image file,
    2. Attach it to a loopback device,
    3. Create a GPT label and a ZFS pool ztest,
    4. Install Void base-minimal onto the pool,
    5. Configure the installation, and
    6. Set the bootfs property of ztest.
  • Create a local generate-zbm configuration file (local.yaml)
  • Create a local dracut.conf.d configuration directory (dracut.conf.d) with a default configuration file
  • Create a local dracut modules directory (modules.d) with symlinks to all of the system modules, and a symlink to the dracut directory in the current git checkout as the 90zfsbootmenu module.

These options can be individually executed if you need to reset any single portion of your testing environment.

The root password in the test installation will be set to zfsbootmenu.

Booting the Test Pool

To boot the test environment, invoke ./run.sh. This may be done as a regular user, but make sure your user is a member of the kvm group if you wish to leverate KVM.

The following defaults can be set to a local default in the .config:

DRIVE="format=raw,file=zfsbootmenu-pool.img"
INITRD="initramfs-bootmenu.img"
MEMORY="2048M"
SMP="2"
DISPLAY="gtk"
APPEND="loglevel=7 timeout=5 root=zfsbootmenu:POOL=ztest"

The ZFSBootMenu kernel command line (specified in the APPEND variable) can be overridden per run by passing an optional -a argument to ./run.sh. The -n argument can be used to skip image regeneration, allowing you to boot the existing initramfs.