fstests: faster group file creation
authorDave Chinner <dchinner@redhat.com>
Fri, 6 May 2022 05:10:17 +0000 (15:10 +1000)
committerZorro Lang <zlang@kernel.org>
Sat, 7 May 2022 07:16:21 +0000 (15:16 +0800)
commit441606d2868165ad19a3e32caade9c0a3b2e84f4
tree5702309d351cd5a63c5f6d191e40ba4e66167e11
parent28c52b15c6e245734d7f375bc04e1a71f1578842
fstests: faster group file creation

We don't need to execute every test just to check it's groups are
valid. Just grab all the groups with grep, pull out the unique ones,
then check them.

This also avoids the problem of editor swap files being present in
the test directory and breaking the build because they are not
executable.

Building on a clean, already built tree so it only builds the
group lists:

$ time make
....
Building udf
 [GROUP] /home/dave/src/xfstests-dev/tests/udf/group.list
Building xfs
 [GROUP] /home/dave/src/xfstests-dev/tests/xfs/group.list

real    0m36.917s
user    0m15.032s
sys     0m26.219s
$

Patched:

$ time make
....
Building udf
 [GROUP] /home/dave/src/xfstests-dev/tests/udf/group.list
Building xfs
 [GROUP] /home/dave/src/xfstests-dev/tests/xfs/group.list
groups "frobnozzle" not mentioned in documentation.
gmake[3]: *** [../../include/buildgrouplist:8: group.list] Error 1
gmake[2]: *** [../include/buildrules:31: xfs] Error 2
gmake[1]: *** [include/buildrules:31: tests] Error 2
make: *** [Makefile:51: default] Error 2

real    0m1.751s
user    0m0.863s
sys     0m1.067s

$

Just a little bit faster, and as you can see that it still detects
groups that are not documented. There was also an open .001.swp file
in the XFS directory and that doesn't throw a failure anymore,
either.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro Lang <zlang@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/preamble
tools/mkgroupfile