public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] xfstests: 219: ignore duplicates reported by repquota
@ 2010-01-10 19:26 Alex Elder
  2010-01-10 21:18 ` Christoph Hellwig
  2010-01-29  5:09 ` Eric Sandeen
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Elder @ 2010-01-10 19:26 UTC (permalink / raw)
  To: xfs

(Re-sending; I misaddressed it the first time.)

Arrange to ignore duplicate entries reported by the repquota command.
This can happen if an id is used more than once (such as when two user
names are assigned the same uid).

Do this here by simply dropping any reported entries whose id number
has already been seen in the output.

Signed-off-by: Alex Elder <aelder@sgi.com>

---
 219 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: b/219
===================================================================
--- a/219
+++ b/219
@@ -85,7 +85,8 @@ test_accounting()
 		$here/src/lstat64 $file | head -3 | filter_scratch
 	done
 
-	repquota -$type -s -n $SCRATCH_MNT  | grep -v "^#0" | filter_scratch
+	repquota -$type -s -n $SCRATCH_MNT  | grep -v "^#0" | filter_scratch |
+	awk '/^#/ { if (! seen[$1]) { seen[$1]++; next; } } { print }'
 }
 
 # real QA test starts here

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] xfstests: 219: ignore duplicates reported by repquota
  2010-01-10 19:26 [PATCH 2/2] xfstests: 219: ignore duplicates reported by repquota Alex Elder
@ 2010-01-10 21:18 ` Christoph Hellwig
  2010-01-29  5:09 ` Eric Sandeen
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2010-01-10 21:18 UTC (permalink / raw)
  To: Alex Elder; +Cc: xfs

On Sun, Jan 10, 2010 at 01:26:32PM -0600, Alex Elder wrote:
> (Re-sending; I misaddressed it the first time.)
> 
> Arrange to ignore duplicate entries reported by the repquota command.
> This can happen if an id is used more than once (such as when two user
> names are assigned the same uid).
> 
> Do this here by simply dropping any reported entries whose id number
> has already been seen in the output.
> 
> Signed-off-by: Alex Elder <aelder@sgi.com>
> 
> ---
>  219 |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: b/219
> ===================================================================
> --- a/219
> +++ b/219
> @@ -85,7 +85,8 @@ test_accounting()
>  		$here/src/lstat64 $file | head -3 | filter_scratch
>  	done
>  
> -	repquota -$type -s -n $SCRATCH_MNT  | grep -v "^#0" | filter_scratch
> +	repquota -$type -s -n $SCRATCH_MNT  | grep -v "^#0" | filter_scratch |
> +	awk '/^#/ { if (! seen[$1]) { seen[$1]++; next; } } { print }'

Looks good,


Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] xfstests: 219: ignore duplicates reported by repquota
  2010-01-10 19:26 [PATCH 2/2] xfstests: 219: ignore duplicates reported by repquota Alex Elder
  2010-01-10 21:18 ` Christoph Hellwig
@ 2010-01-29  5:09 ` Eric Sandeen
  2010-01-30 10:30   ` Christoph Hellwig
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2010-01-29  5:09 UTC (permalink / raw)
  To: Alex Elder; +Cc: xfs

Alex Elder wrote:
> (Re-sending; I misaddressed it the first time.)
> 
> Arrange to ignore duplicate entries reported by the repquota command.
> This can happen if an id is used more than once (such as when two user
> names are assigned the same uid).
> 
> Do this here by simply dropping any reported entries whose id number
> has already been seen in the output.
> 
> Signed-off-by: Alex Elder <aelder@sgi.com>

again with the late review ;)

This is causing failures for me:

--- 219.out	2009-11-12 17:27:40.209152659 -0600
+++ 219.out.bad	2010-01-28 23:03:05.933323333 -0600
@@ -27,7 +27,6 @@
                         Block limits                File limits
 User            used    soft    hard  grace    used  soft  hard  grace
 ----------------------------------------------------------------------
-#1        --     144       0       0              3     0     0       

raw output looks like:

                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
#0        --       0       0       0              3     0     0       
#1        --     144       0       0              3     0     0       

there's probably better awk to be written than this, but I think this
fixes it:

Alex, you look like an awk-master, can you fix it?

-Eric


> ---
>  219 |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: b/219
> ===================================================================
> --- a/219
> +++ b/219
> @@ -85,7 +85,8 @@ test_accounting()
>  		$here/src/lstat64 $file | head -3 | filter_scratch
>  	done
>  
> -	repquota -$type -s -n $SCRATCH_MNT  | grep -v "^#0" | filter_scratch
> +	repquota -$type -s -n $SCRATCH_MNT  | grep -v "^#0" | filter_scratch |
> +	awk '/^#/ { if (! seen[$1]) { seen[$1]++; next; } } { print }'
>  }
>  
>  # real QA test starts here
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] xfstests: 219: ignore duplicates reported by repquota
  2010-01-29  5:09 ` Eric Sandeen
@ 2010-01-30 10:30   ` Christoph Hellwig
  2010-01-30 16:09     ` Eric Sandeen
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2010-01-30 10:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs, Alex Elder

On Thu, Jan 28, 2010 at 11:09:20PM -0600, Eric Sandeen wrote:
> there's probably better awk to be written than this, but I think this
> fixes it:
> 
> Alex, you look like an awk-master, can you fix it?

No fix included..

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] xfstests: 219: ignore duplicates reported by repquota
  2010-01-30 10:30   ` Christoph Hellwig
@ 2010-01-30 16:09     ` Eric Sandeen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2010-01-30 16:09 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs, Alex Elder

Christoph Hellwig wrote:
> On Thu, Jan 28, 2010 at 11:09:20PM -0600, Eric Sandeen wrote:
>> there's probably better awk to be written than this, but I think this
>> fixes it:
>>
>> Alex, you look like an awk-master, can you fix it?
> 
> No fix included..
> 

right, was asking Alex for one ;)

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-30 16:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-10 19:26 [PATCH 2/2] xfstests: 219: ignore duplicates reported by repquota Alex Elder
2010-01-10 21:18 ` Christoph Hellwig
2010-01-29  5:09 ` Eric Sandeen
2010-01-30 10:30   ` Christoph Hellwig
2010-01-30 16:09     ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox