fstests: fix group check in new script
authorDarrick J. Wong <djwong@kernel.org>
Mon, 21 Jun 2021 15:54:53 +0000 (08:54 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 27 Jun 2021 14:48:54 +0000 (22:48 +0800)
In the tests/*/group files, group names are found in the Nth columns of
the file, where N > 1.  The grep expression to warn about unknown groups
is not correct (since it currently checks column 1), so fix this.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
new

diff --git a/new b/new
index bb427f0..357983d 100755 (executable)
--- a/new
+++ b/new
@@ -243,10 +243,7 @@ else
     #
     for g in $*
     do
-       if grep "^$g[   ]" $tdir/group >/dev/null
-       then
-           :
-       else
+       if ! grep -q "[[:space:]]$g" "$tdir/group"; then
            echo "Warning: group \"$g\" not defined in $tdir/group"
        fi
     done