diff mbox series

[01/13] fstests: fix group check in new script

Message ID 162317276776.653489.15862429375974956030.stgit@locust (mailing list archive)
State New, archived
Headers show
Series fstests: move test group lists into test files | expand

Commit Message

Darrick J. Wong June 8, 2021, 5:19 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

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>
---
 new |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Chandan Babu R June 10, 2021, 8:43 a.m. UTC | #1
On 08 Jun 2021 at 22:49, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> 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.

Looks good to me.

Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>

>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  new |    5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
>
> diff --git a/new b/new
> index bb427f0d..357983d9 100755
> --- 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
Allison Henderson June 11, 2021, 9:54 p.m. UTC | #2
On 6/10/21 1:43 AM, Chandan Babu R wrote:
> On 08 Jun 2021 at 22:49, Darrick J. Wong wrote:
>> From: Darrick J. Wong <djwong@kernel.org>
>>
>> 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.
> 
> Looks good to me.
> 
> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
> 
>>
>> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Looks ok
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>

>> ---
>>   new |    5 +----
>>   1 file changed, 1 insertion(+), 4 deletions(-)
>>
>>
>> diff --git a/new b/new
>> index bb427f0d..357983d9 100755
>> --- 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
> 
>
diff mbox series

Patch

diff --git a/new b/new
index bb427f0d..357983d9 100755
--- 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