On Wed, Jun 11, 2025 at 06:29:45PM +0100, Al Viro wrote: > On Wed, Jun 11, 2025 at 11:36:43AM +0200, Christian Brauner wrote: > > > Sigh. There's no need to get all high and mighty about this. For once I > > actually do write extensive selftests and they do actually catch a lot > > of bugs. It's a joke how little selftests we have given the importance > > of our apis. Nobody ever gives a flying fsck to review selftests when > > they're posted because nobody seems to actually care. > > Not quite - for me the problem is more on the logistics side; xfstests > is a lot more convenient in that respect. To be serious, the main > problems are > 1) many selftests have non-trivial dependencies on config > and spew a lot of noise when run on different configs. > 2) very much oriented to case when kernel tree (with build already > done) sitting on the box where they are going to be run. Sure, I can > tar c .|ssh kvm.virt "mkdir /tmp/linux; cd /tmp/linux; tar x ." and > then make kselftest there, but it's still a headache. > 3) unlike e.g. xfstests and ltp, you don't get a convenient > summary of the entire run. > > None of that is fatal, obviously, just bloody annoying to deal with at 4am... Al, please don't work until you drop from exhaustion. :D > Yes, I know how to use TARGETS, etc., but IME a test in xfstests is less > of a headache on my setup. A long time ago I had the plan of moving nearly all testing including the VFS bits into xfstests proper. After all I added the following years ago: brauner@so61|~/src/git/linux/fstests/xfstests-dev > ls -al src/vfs/ total 500 drwxrwxr-x 2 brauner brauner 4096 Aug 14 2024 . drwxrwxr-x 6 brauner brauner 8192 Nov 11 2024 .. -rw-rw-r-- 1 brauner brauner 96274 May 27 2022 btrfs-idmapped-mounts.c -rw-rw-r-- 1 brauner brauner 274 May 27 2022 btrfs-idmapped-mounts.h -rw-rw-r-- 1 brauner brauner 240071 Aug 14 2024 idmapped-mounts.c -rw-r--r-- 1 brauner brauner 3211 Feb 22 2024 idmapped-mounts.h -rw-rw-r-- 1 brauner brauner 1070 Aug 14 2024 Makefile -rw-rw-r-- 1 brauner brauner 3677 May 27 2022 missing.h -rw-rw-r-- 1 brauner brauner 5163 May 27 2022 mount-idmapped.c -rw-r--r-- 1 brauner brauner 13890 Feb 22 2024 tmpfs-idmapped-mounts.c -rw-r--r-- 1 brauner brauner 273 Feb 22 2024 tmpfs-idmapped-mounts.h -rw-r--r-- 1 brauner brauner 22310 Feb 22 2024 utils.c -rw-r--r-- 1 brauner brauner 10243 Feb 22 2024 utils.h -rw-r--r-- 1 brauner brauner 66253 Feb 22 2024 vfstest.c -rw-r--r-- 1 brauner brauner 198 Feb 22 2024 vfstest.h That tests the s**t out of idmapped mounts and setgid stripping for all filesystems and a bunch of other stuff. And I had always thought that it might be worth it to add other tests in there. But in reality adding selftests for stuff like the mount infra is often a lot easier in the selftests thanks to the FIXTURE_*() infrastructure that we have there. IOW, if I have a long series and I'm at the part of "Ok, I now need to do the boring testing part." I want it to be simple and imho that's currently where the selftests shine. The other part is that it all goes into the same place whereas the selftests for xfstests would need to go into a separate project.