kola: add sysext.bcachefs tests#883
Open
ananthb wants to merge 2 commits into
Open
Conversation
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>
There was a problem hiding this comment.
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.rebootto verify bcachefs formatting/mounting and persistence across reboot. - Introduces
sysext.bcachefs.nfsto 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.
5 tasks
- 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>
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())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add kola tests for the bcachefs sysext + in-tree kernel module proposed in flatcar/scripts#4136, modeled on the existing
sysext.zfs.*tests inkola/tests/sysext/zfs.go.Two tests are registered:
sysext.bcachefs.reboot— boots a machine with avirtio-bcachefsdisk, enables thebcachefssysext via/etc/flatcar/enabled-sysext.conf, runs an idempotentbcachefs-setup.servicethatmkfs.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 plusnfs-server.serviceand/etc/exportsexporting/var/lib/bcachefs; a second machine (reusing the existingnfsClientUserData) NFS-mounts and reads back the file.Notes
blkid(skip mkfs if already bcachefs) andConditionPathIsMountPoint=!/var/lib/bcachefs(skip mount if already mounted). This mirrors the same persistence guarantees the ZFS test relies on.skipBcachefsskipsarm64because scripts#4136 keeps the sysext amd64-only for the initial rollout, and reusesskipOnGha+kola.SkipSecurebootfromzfs.go.MinVersionis a placeholder — should be bumped to the first Flatcar release that carries the bcachefs sysext and in-tree module.Test plan
kola run sysext.bcachefs.reboot -p qemuon an amd64 image built from bcachefs: enable in-tree module and add userspace-tools sysext scripts#4136.kola run sysext.bcachefs.nfs -p qemuon the same image.Related