Skip to content

kola: add sysext.bcachefs tests#883

Open
ananthb wants to merge 2 commits into
flatcar:mainfrom
ananthb:add-bcachefs-sysext-tests
Open

kola: add sysext.bcachefs tests#883
ananthb wants to merge 2 commits into
flatcar:mainfrom
ananthb:add-bcachefs-sysext-tests

Conversation

@ananthb

@ananthb ananthb commented Jul 12, 2026

Copy link
Copy Markdown

Summary

Add kola tests for the bcachefs sysext + in-tree kernel module proposed in flatcar/scripts#4136, modeled on the existing sysext.zfs.* tests in kola/tests/sysext/zfs.go.

Two tests are registered:

  • sysext.bcachefs.reboot — boots a machine with a virtio-bcachefs disk, enables the bcachefs sysext via /etc/flatcar/enabled-sysext.conf, runs an idempotent bcachefs-setup.service that mkfs.bcachefses and mounts /var/lib/bcachefs, asserts the mount + lsmod bcachefs + /proc/filesystems, writes a file, reboots, then asserts the file, module, and mount survive.
  • sysext.bcachefs.nfs — same base plus nfs-server.service and /etc/exports exporting /var/lib/bcachefs; a second machine (reusing the existing nfsClientUserData) NFS-mounts and reads back the file.

Notes

  • Unlike ZFS, bcachefs has no auto-import/auto-mount service, so the setup unit runs on every boot and is guarded by blkid (skip mkfs if already bcachefs) and ConditionPathIsMountPoint=!/var/lib/bcachefs (skip mount if already mounted). This mirrors the same persistence guarantees the ZFS test relies on.
  • skipBcachefs skips arm64 because scripts#4136 keeps the sysext amd64-only for the initial rollout, and reuses skipOnGha + kola.SkipSecureboot from zfs.go.
  • MinVersion is a placeholder — should be bumped to the first Flatcar release that carries the bcachefs sysext and in-tree module.

Test plan

Related

These tests cover the bcachefs sysext + in-tree module added by
flatcar/scripts#4136:
- fetching the sysext from bincache / release server
- mkfs.bcachefs and mount -t bcachefs work on a virtio disk
- bcachefs.ko is loaded and persistence survives a reboot
- NFS-exporting a bcachefs mount works

Skipped for arm64 for now since the initial sysext is amd64-only,
and skipped in GHA and release-channel runs like the zfs test.

Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
Copilot AI review requested due to automatic review settings July 12, 2026 13:57
@ananthb ananthb requested a review from a team as a code owner July 12, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new kola sysext coverage for bcachefs, modeled after the existing ZFS sysext tests, to validate both reboot persistence and basic NFS export/mount behavior when the bcachefs userspace tools are provided via sysext and the kernel module is in-tree.

Changes:

  • Introduces sysext.bcachefs.reboot to verify bcachefs formatting/mounting and persistence across reboot.
  • Introduces sysext.bcachefs.nfs to verify exporting a bcachefs-backed path over NFS and reading it from a second machine.
  • Adds Butane user-data configs and helper logic to provision an extra virtio disk and run an idempotent setup unit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kola/tests/sysext/bcachefs.go Outdated
Comment thread kola/tests/sysext/bcachefs.go Outdated
Comment thread kola/tests/sysext/bcachefs.go Outdated
Comment thread kola/tests/sysext/bcachefs.go Outdated
- Assert on findmnt's FSTYPE column instead of raw output; the mount
  point path and source device both contain the substring "bcachefs",
  so the previous check would have passed even for a wrong FS type.
- Drop no_root_squash from the NFS export in the test; the client only
  reads the file as the default user and it's better not to codify an
  insecure example.

Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
Copilot AI review requested due to automatic review settings July 12, 2026 15:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

Comment on lines +150 to +155
m := createBcachefsMachine(c, bcachefsUserData)
// Assert on the FSTYPE column rather than the raw findmnt output — the
// mount point and source device both contain the substring "bcachefs"
// and would match even if the FS were mounted as something else.
c.AssertCmdOutputContains(m, "findmnt -n -o FSTYPE /var/lib/bcachefs", "bcachefs")
c.AssertCmdOutputContains(m, "lsmod", "bcachefs")
Comment on lines +158 to +163
err := m.Reboot()
if err != nil {
c.Fatalf("could not reboot: %v", err)
}
c.AssertCmdOutputContains(m, "lsmod", "bcachefs")
c.AssertCmdOutputContains(m, "findmnt -n -o FSTYPE /var/lib/bcachefs", "bcachefs")
Comment on lines +168 to +170
m := createBcachefsMachine(c, bcachefsNfsUserData)
c.AssertCmdOutputContains(m, "findmnt -n -o FSTYPE /var/lib/bcachefs", "bcachefs")
c.MustSSH(m, "sudo chown core /var/lib/bcachefs/")
c.Fatalf("Cluster.NewMachine: %s", err)
}
c.MustSSH(m2, "sudo mkdir /mnt/nfs")
c.MustSSH(m2, fmt.Sprintf("sudo mount -t nfs -o nfsvers=4 %s:/var/lib/bcachefs /mnt/nfs", m.PrivateIP()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants