From 297cd44affca45bf03d3e5cccb72cf89ec671a2c Mon Sep 17 00:00:00 2001 From: Zygmunt Krynicki Date: Thu, 5 Dec 2024 13:14:03 +0100 Subject: [PATCH] Document spread tests in README.md Signed-off-by: Zygmunt Krynicki (cherry picked from commit d27377a62f8847da176125d4ee45d7a63f31d920) Signed-off-by: John Johansen --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 3612ecdb3..b5dba99f4 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,30 @@ usage and how to update and add tests. Below is a quick overview of their location and how to run them. +Using spread with local virtual machines +---------------------------------------- + +It may be convenient to use the spread tool to provision and run the test suite +in an ephemeral virtual machine. This allows testing in isolation from the +host, as well as testing across different commonly used distributions and their +real kernels. + +```sh +sudo apt install git golang whois ovmf genisoimage qemu-utils qemu-system +go install github.com/snapcore/spread/cmd/spread@latest +git clone https://gitlab.com/zygoon/image-garden +make -C image-garden +sudo make -C image-garden install +image-garden make ubuntu-cloud-24.10.x86_64.run +cd $APPARMOR_PATH +git clean -xdf +~/go/bin/spread -artifacts ./spread-artifacts -v ubuntu-cloud-24.10 +# or ~/go/bin/spread -v garden:ubuntu-cloud-24.04:tests/regression/apparmor:at_secure +``` + +Running the `run_spread.sh` script, with `spread` on `PATH` will run all the +tests across several supported systems (Debian, Ubuntu and openSUSE). + Regression tests ---------------- For details on structure and adding tests, see