zfsbootmenu/testing
Zach Dykstra 2eadd35077
testing: Add step for verifying keymap changes
Related to #255
2022-02-12 12:37:49 -06:00
..
helpers De-prioritize Dracut as the primary generator 2022-01-27 12:56:11 -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
README.md De-prioritize Dracut as the primary generator 2022-01-27 12:56:11 -05:00
TPSReport.md testing: Add step for verifying keymap changes 2022-02-12 12:37:49 -06:00
rollup.pl Enable profiling framework in core ZFSBootMenu tools 2022-01-12 21:10:28 -06:00
run.sh run.sh: initcpio should always log to kmsg 2022-02-04 15:23:54 -06:00
setup.sh testing: mkinitcpio enhancements 2022-01-27 12:56:11 -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.