From: Jan Kara Date: Thu, 21 Jul 2016 08:55:06 +0000 (+0200) Subject: generic/235: Fix false failures for some quota formats X-Git-Tag: v2022.05.01~2420 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6721ab08bd2772da9f3aa1ae7b46b7cb5c0e8308;p=users%2Fhch%2Fxfstests-dev.git generic/235: Fix false failures for some quota formats 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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/tests/generic/235 b/tests/generic/235 index 59456b67c..309540ac1 100755 --- a/tests/generic/235 +++ b/tests/generic/235 @@ -46,6 +46,11 @@ _require_scratch _require_quota _require_user +do_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 +do_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 +do_repquota _scratch_unmount 2>/dev/null diff --git a/tests/generic/235.out b/tests/generic/235.out index 95c10058d..601fa2fa3 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 - -