From 05d484eba1a84129328bde823fab1fa62c05b648 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Thu, 26 Feb 2026 15:45:37 +1100 Subject: [PATCH] ci: run xfstests quick group in a nested VM Github hosted "ubuntu-latest" x86-64 runners have enough resources (KVM, 4 cores, 16G RAM, 14 GB SSD) to build and run mainline kernel + xfstests in a nested VM. This script uses rapido https://github.com/rapido-linux/rapido/pull/258 as a minimal initramfs generator and thin wrapper around QEMU. For simplicity it'd likely make sense to branch it under the btrfs namespace. The test VM currently uses btrfs-progs from the ubuntu-24.04 host system. This could also be changed to a source-compiled version. TEST and SCRATCH devices are backed by 8G zstd compressed qcow2 images. Signed-off-by: David Disseldorp --- .github/workflows/ci.yml | 81 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000000..401791315bbf3f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,81 @@ +name: CI + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: install toolchains, rapido and xfstests dependencies + run: | + sudo apt-get update -y + # cargo default package is v1.75, which doesn't support v4 lock files + sudo apt-get install -y --no-install-recommends --no-install-suggests \ + cargo-1.85 rustc qemu-system-x86 qemu-utils \ + make flex bison libelf-dev acl attr automake bc dbench dump \ + e2fsprogs fio gawk libtool sed libgdbm-compat-dev \ + gcc git indent libacl1-dev libaio-dev libcap-dev libgdbm-dev \ + libtool-bin liburing-dev libuuid1 lvm2 make psmisc python3 quota \ + uuid-dev uuid-runtime xfsprogs linux-headers-$(uname -r) sqlite3 \ + xfsdump xfslibs-dev btrfs-progs pkg-config + # chmod /dev/kvm to allow non-root QEMU to use it. + # chmod needs to go after install, as udev may be triggered. + sudo chmod 0666 /dev/kvm + # TODO: https://github.com/rapido-linux/rapido once rs_wip is merged + git clone --depth 1 -b rs_wip https://github.com/ddiss/rapido \ + ${HOME}/rapido + pushd ${HOME}/rapido + cargo-1.85 build --offline --release + popd + - name: build mainline kernel and xfstests + run: | + cp ${HOME}/rapido/kernel/fstests_btrfs_zram.defconfig .config + make olddefconfig + make -j$(nproc) + make modules_install INSTALL_MOD_PATH=./mods + # this gives us modules.dep, etc. which rapido needs. + # XXX should come with modules_install but doesn't... perhaps due to no modules? + objtree=./ INSTALL_MOD_PATH=./mods ./scripts/depmod.sh \ + "$(cat include/config/kernel.release)" + git clone --depth 1 -b master \ + https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git \ + ${HOME}/xfstests + pushd ${HOME}/xfstests + make -j$(nproc) + popd + - name: boot mainline kernel and run xfstests + run: | + linux_dir="${PWD}" + pushd ${HOME}/rapido + # rapido fstests-btrfs uses 5x guest-zram-dev by default (for raid), + # but we probably don't have enough memory. Use compressed qcow2: + test_img="${HOME}/fstests_test_zstd.qcow2" + scratch_img="${HOME}/fstests_scratch_zstd.qcow2" + qemu-img create -f qcow2 -o compression_type=zstd "$test_img" 8G + qemu-img create -f qcow2 -o compression_type=zstd "$scratch_img" 8G + mkdir -p "${HOME}/9p" + cat > rapido.conf <> rapido.conf + cat rapido.conf + ./rapido cut \ + -x "./check -R xunit -g quick; cp results/result.xml /host/; exit" \ + fstests-btrfs + popd + - name: dump results + run: | + cat "${HOME}/9p/result.xml" + - name: Archive xunit test results + uses: actions/upload-artifact@v4 + with: + name: xunit-results + path: ~/9p/result.xml + retention-days: 2