All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/235: Use CSV format for repquota output
@ 2016-07-18 12:00 Jan Kara
  2016-07-19  4:07 ` Eryu Guan
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2016-07-18 12:00 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 and this information
is separated by two empty lines. For quota formats that don't support
printing any additional information these lines are not present in the
output which causes false failures of the test. Switch the test to use
repquota(8) CSV output format which does not have these formatting
issues and in general should be more stable.

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

diff --git a/tests/generic/235 b/tests/generic/235
index 59456b67c092..e2a66fd312f6 100755
--- a/tests/generic/235
+++ b/tests/generic/235
@@ -57,7 +57,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 -O csv -u -g $SCRATCH_MNT  | grep -v "^root" | _filter_scratch
 
 # If remount fails with this problem:
 #
@@ -70,7 +70,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 -O csv -u -g $SCRATCH_MNT  | grep -v "^root" | _filter_scratch
 
 _scratch_unmount 2>/dev/null
 
diff --git a/tests/generic/235.out b/tests/generic/235.out
index 95c10058d1cb..3053c48ce535 100644
--- a/tests/generic/235.out
+++ b/tests/generic/235.out
@@ -1,34 +1,10 @@
 QA output created by 235
-*** Report for user quotas on device SCRATCH_DEV
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-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       
-
-
+User,BlockStatus,FileStatus,BlockUsed,BlockSoftLimit,BlockHardLimit,BlockGrace,FileUsed,FileSoftLimit,FileHardLimit,FileGrace
+fsgqa,ok,ok,0,0,0,,1,0,0,
+Group,BlockStatus,FileStatus,BlockUsed,BlockSoftLimit,BlockHardLimit,BlockGrace,FileUsed,FileSoftLimit,FileHardLimit,FileGrace
+fsgqa,ok,ok,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
-                        Block limits                File limits
-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       
-
-
+User,BlockStatus,FileStatus,BlockUsed,BlockSoftLimit,BlockHardLimit,BlockGrace,FileUsed,FileSoftLimit,FileHardLimit,FileGrace
+fsgqa,ok,ok,8,0,0,,1,0,0,
+Group,BlockStatus,FileStatus,BlockUsed,BlockSoftLimit,BlockHardLimit,BlockGrace,FileUsed,FileSoftLimit,FileHardLimit,FileGrace
+fsgqa,ok,ok,8,0,0,,1,0,0,
-- 
2.6.6


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

* Re: [PATCH] generic/235: Use CSV format for repquota output
  2016-07-18 12:00 [PATCH] generic/235: Use CSV format for repquota output Jan Kara
@ 2016-07-19  4:07 ` Eryu Guan
  2016-07-20  5:13   ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: Eryu Guan @ 2016-07-19  4:07 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests

On Mon, Jul 18, 2016 at 02:00:24PM +0200, Jan Kara wrote:
> Different quota format may print additional information in repquota(8)
> output after standard quota information is printed and this information
> is separated by two empty lines. For quota formats that don't support
> printing any additional information these lines are not present in the
> output which causes false failures of the test. Switch the test to use
> repquota(8) CSV output format which does not have these formatting
> issues and in general should be more stable.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>

This breaks tests on distributions with older version of repquota (e.g.
RHEL6 and RHEL7) where there's no "-O" support, and test failed because
of "invalid option -- 'O'".

Thanks,
Eryu

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

* Re: [PATCH] generic/235: Use CSV format for repquota output
  2016-07-19  4:07 ` Eryu Guan
@ 2016-07-20  5:13   ` Jan Kara
  2016-07-20 23:02     ` Dave Chinner
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2016-07-20  5:13 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Jan Kara, fstests, dchinner

On Tue 19-07-16 12:07:38, Eryu Guan wrote:
> On Mon, Jul 18, 2016 at 02:00:24PM +0200, Jan Kara wrote:
> > Different quota format may print additional information in repquota(8)
> > output after standard quota information is printed and this information
> > is separated by two empty lines. For quota formats that don't support
> > printing any additional information these lines are not present in the
> > output which causes false failures of the test. Switch the test to use
> > repquota(8) CSV output format which does not have these formatting
> > issues and in general should be more stable.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> 
> This breaks tests on distributions with older version of repquota (e.g.
> RHEL6 and RHEL7) where there's no "-O" support, and test failed because
> of "invalid option -- 'O'".

Hum, support for -O option is in repquota for three years. That isn't much
for enterprise distros, I agree. I can fix the problem with output
filtering. That will be less future-proof but it will work for old
repquota. I'm not sure what's more desirable. Dave?

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

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

* Re: [PATCH] generic/235: Use CSV format for repquota output
  2016-07-20  5:13   ` Jan Kara
@ 2016-07-20 23:02     ` Dave Chinner
  2016-07-21  7:27       ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2016-07-20 23:02 UTC (permalink / raw)
  To: Jan Kara; +Cc: Eryu Guan, fstests, dchinner

On Wed, Jul 20, 2016 at 07:13:24AM +0200, Jan Kara wrote:
> On Tue 19-07-16 12:07:38, Eryu Guan wrote:
> > On Mon, Jul 18, 2016 at 02:00:24PM +0200, Jan Kara wrote:
> > > Different quota format may print additional information in repquota(8)
> > > output after standard quota information is printed and this information
> > > is separated by two empty lines. For quota formats that don't support
> > > printing any additional information these lines are not present in the
> > > output which causes false failures of the test. Switch the test to use
> > > repquota(8) CSV output format which does not have these formatting
> > > issues and in general should be more stable.
> > > 
> > > Signed-off-by: Jan Kara <jack@suse.cz>
> > 
> > This breaks tests on distributions with older version of repquota (e.g.
> > RHEL6 and RHEL7) where there's no "-O" support, and test failed because
> > of "invalid option -- 'O'".
> 
> Hum, support for -O option is in repquota for three years. That isn't much
> for enterprise distros, I agree. I can fix the problem with output
> filtering. That will be less future-proof but it will work for old
> repquota. I'm not sure what's more desirable. Dave?

What are the extra lines? Why can't an output filter be added to
strip the extra lines if they are emitted?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: [PATCH] generic/235: Use CSV format for repquota output
  2016-07-20 23:02     ` Dave Chinner
@ 2016-07-21  7:27       ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2016-07-21  7:27 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Jan Kara, Eryu Guan, fstests, dchinner

On Thu 21-07-16 09:02:31, Dave Chinner wrote:
> On Wed, Jul 20, 2016 at 07:13:24AM +0200, Jan Kara wrote:
> > On Tue 19-07-16 12:07:38, Eryu Guan wrote:
> > > On Mon, Jul 18, 2016 at 02:00:24PM +0200, Jan Kara wrote:
> > > > Different quota format may print additional information in repquota(8)
> > > > output after standard quota information is printed and this information
> > > > is separated by two empty lines. For quota formats that don't support
> > > > printing any additional information these lines are not present in the
> > > > output which causes false failures of the test. Switch the test to use
> > > > repquota(8) CSV output format which does not have these formatting
> > > > issues and in general should be more stable.
> > > > 
> > > > Signed-off-by: Jan Kara <jack@suse.cz>
> > > 
> > > This breaks tests on distributions with older version of repquota (e.g.
> > > RHEL6 and RHEL7) where there's no "-O" support, and test failed because
> > > of "invalid option -- 'O'".
> > 
> > Hum, support for -O option is in repquota for three years. That isn't much
> > for enterprise distros, I agree. I can fix the problem with output
> > filtering. That will be less future-proof but it will work for old
> > repquota. I'm not sure what's more desirable. Dave?
> 
> What are the extra lines? Why can't an output filter be added to
> strip the extra lines if they are emitted?

Those extra lines can be stripped. If that's preferable I'll send a patch
doing that. I just thought using CSV output format of repquota may be less
prone to formatting changes in the future.

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

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-18 12:00 [PATCH] generic/235: Use CSV format for repquota output Jan Kara
2016-07-19  4:07 ` Eryu Guan
2016-07-20  5:13   ` Jan Kara
2016-07-20 23:02     ` Dave Chinner
2016-07-21  7:27       ` 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.