All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] generic/235: Fix false failures for some quota formats
@ 2016-07-21  8:55 Jan Kara
  2016-07-21 10:45 ` Eryu Guan
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2016-07-21  8:55 UTC (permalink / raw)
  To: fstests; +Cc: Jan Kara

Different quota format may print additional information in repquota(8)
output after standard quota information is printed. If format does
support this additional printouts, repquota(8) will separate possible
output by two empty lines even if format handler doesn't actually
printout anything (which is currently always the case for queries test
generic/235 does). If format doesn't support additional printouts, these
two empty lines are not present in the output. This inconsistency causes
false failures for some quota formats.

Fix the problem by filtering out empty lines out of repquota(8) output.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 tests/generic/235     | 9 +++++++--
 tests/generic/235.out | 8 --------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/tests/generic/235 b/tests/generic/235
index 59456b67c092..d42054efee91 100755
--- a/tests/generic/235
+++ b/tests/generic/235
@@ -46,6 +46,11 @@ _require_scratch
 _require_quota
 _require_user
 
+_repquota()
+{
+	repquota -u -g $SCRATCH_MNT  | grep -v -E '^root|^$' | _filter_scratch
+}
+
 # real QA test starts here
 rm -f $seqres.full
 
@@ -57,7 +62,7 @@ quotaon $SCRATCH_MNT 2>/dev/null
 touch $SCRATCH_MNT/testfile
 chown $qa_user:$qa_user $SCRATCH_MNT/testfile
 
-repquota -u -g $SCRATCH_MNT  | grep -v "^root" | _filter_scratch
+_repquota
 
 # If remount fails with this problem:
 #
@@ -70,7 +75,7 @@ _scratch_mount "-o remount,rw" 2>&1 | tee -a $seqres.full | _filter_scratch
 
 $XFS_IO_PROG -c 'pwrite 0 8k' -c 'fsync' \
 			$SCRATCH_MNT/testfile >>$seqres.full 2>&1
-repquota -u -g $SCRATCH_MNT  | grep -v "^root" | _filter_scratch
+_repquota
 
 _scratch_unmount 2>/dev/null
 
diff --git a/tests/generic/235.out b/tests/generic/235.out
index 95c10058d1cb..601fa2fa3de8 100644
--- a/tests/generic/235.out
+++ b/tests/generic/235.out
@@ -5,16 +5,12 @@ Block grace time: 7days; Inode grace time: 7days
 User            used    soft    hard  grace    used  soft  hard  grace
 ----------------------------------------------------------------------
 fsgqa     --       0       0       0              1     0     0       
-
-
 *** Report for group quotas on device SCRATCH_DEV
 Block grace time: 7days; Inode grace time: 7days
                         Block limits                File limits
 Group           used    soft    hard  grace    used  soft  hard  grace
 ----------------------------------------------------------------------
 fsgqa     --       0       0       0              1     0     0       
-
-
 touch: cannot touch 'SCRATCH_MNT/failed': Read-only file system
 *** Report for user quotas on device SCRATCH_DEV
 Block grace time: 7days; Inode grace time: 7days
@@ -22,13 +18,9 @@ Block grace time: 7days; Inode grace time: 7days
 User            used    soft    hard  grace    used  soft  hard  grace
 ----------------------------------------------------------------------
 fsgqa     --       8       0       0              1     0     0       
-
-
 *** Report for group quotas on device SCRATCH_DEV
 Block grace time: 7days; Inode grace time: 7days
                         Block limits                File limits
 Group           used    soft    hard  grace    used  soft  hard  grace
 ----------------------------------------------------------------------
 fsgqa     --       8       0       0              1     0     0       
-
-
-- 
2.6.6


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

* Re: [PATCH v2] generic/235: Fix false failures for some quota formats
  2016-07-21  8:55 [PATCH v2] generic/235: Fix false failures for some quota formats Jan Kara
@ 2016-07-21 10:45 ` Eryu Guan
  2016-07-21 12:21   ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Eryu Guan @ 2016-07-21 10:45 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests

On Thu, Jul 21, 2016 at 10:55:06AM +0200, Jan Kara wrote:
> Different quota format may print additional information in repquota(8)
> output after standard quota information is printed. If format does
> support this additional printouts, repquota(8) will separate possible
> output by two empty lines even if format handler doesn't actually
> printout anything (which is currently always the case for queries test
> generic/235 does). If format doesn't support additional printouts, these
> two empty lines are not present in the output. This inconsistency causes
> false failures for some quota formats.
> 
> Fix the problem by filtering out empty lines out of repquota(8) output.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  tests/generic/235     | 9 +++++++--
>  tests/generic/235.out | 8 --------
>  2 files changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/generic/235 b/tests/generic/235
> index 59456b67c092..d42054efee91 100755
> --- a/tests/generic/235
> +++ b/tests/generic/235
> @@ -46,6 +46,11 @@ _require_scratch
>  _require_quota
>  _require_user
>  
> +_repquota()
> +{
> +	repquota -u -g $SCRATCH_MNT  | grep -v -E '^root|^$' | _filter_scratch
> +}

Usually we name local functions without the leading "_", which is for
common helpers from common/rc etc. Do you mind if I rename it to
"do_repquota"?

Thanks,
Eryu

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

* Re: [PATCH v2] generic/235: Fix false failures for some quota formats
  2016-07-21 10:45 ` Eryu Guan
@ 2016-07-21 12:21   ` Jan Kara
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2016-07-21 12:21 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Jan Kara, fstests

On Thu 21-07-16 18:45:13, Eryu Guan wrote:
> On Thu, Jul 21, 2016 at 10:55:06AM +0200, Jan Kara wrote:
> > Different quota format may print additional information in repquota(8)
> > output after standard quota information is printed. If format does
> > support this additional printouts, repquota(8) will separate possible
> > output by two empty lines even if format handler doesn't actually
> > printout anything (which is currently always the case for queries test
> > generic/235 does). If format doesn't support additional printouts, these
> > two empty lines are not present in the output. This inconsistency causes
> > false failures for some quota formats.
> > 
> > Fix the problem by filtering out empty lines out of repquota(8) output.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> >  tests/generic/235     | 9 +++++++--
> >  tests/generic/235.out | 8 --------
> >  2 files changed, 7 insertions(+), 10 deletions(-)
> > 
> > diff --git a/tests/generic/235 b/tests/generic/235
> > index 59456b67c092..d42054efee91 100755
> > --- a/tests/generic/235
> > +++ b/tests/generic/235
> > @@ -46,6 +46,11 @@ _require_scratch
> >  _require_quota
> >  _require_user
> >  
> > +_repquota()
> > +{
> > +	repquota -u -g $SCRATCH_MNT  | grep -v -E '^root|^$' | _filter_scratch
> > +}
> 
> Usually we name local functions without the leading "_", which is for
> common helpers from common/rc etc. Do you mind if I rename it to
> "do_repquota"?

I don't mind so go ahead.

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2016-07-21 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21  8:55 [PATCH v2] generic/235: Fix false failures for some quota formats Jan Kara
2016-07-21 10:45 ` Eryu Guan
2016-07-21 12:21   ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.