mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic/60[01]: fix test failure when setting new grace limit
The setquota command can extend a quota grace period by a certain number of seconds. The extension is provided as a number of seconds relative to right now. However, if the system clock increments the seconds count after this test assigns $now but before setquota gets called, the test will fail because $get and $set will be off by that 1 second. Allow for that. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
committed by
Eryu Guan
parent
d40de4f744
commit
4f9dd73596
+3
-1
@@ -60,7 +60,9 @@ let set=now+100
|
||||
setquota -T -u $qa_user 0 100 $SCRATCH_MNT 2>&1 | grep -v "^setquota"
|
||||
get=`repquota -up $SCRATCH_MNT | grep "^$qa_user" | awk '{print $NF}'`
|
||||
|
||||
if [ "$get" != "$set" ]; then
|
||||
# Either the new expiry must match; or be one second after the set time, to
|
||||
# deal with the seconds counter incrementing.
|
||||
if [ "$get" != "$set" ] && [ "$get" -ne "$((set + 1))" ]; then
|
||||
echo "set grace to $set but got grace $get"
|
||||
fi
|
||||
|
||||
|
||||
+3
-1
@@ -71,7 +71,9 @@ $XFS_QUOTA_PROG -x -c "timer -u -i 100 $qa_user" $SCRATCH_MNT
|
||||
# raw ("since epoch") grace expiry
|
||||
get=`repquota -up $SCRATCH_MNT | grep "^$qa_user" | awk '{print $NF}'`
|
||||
|
||||
if [ "$get" != "$set" ]; then
|
||||
# Either the new expiry must match; or be one second after the set time, to
|
||||
# deal with the seconds counter incrementing.
|
||||
if [ "$get" != "$set" ] && [ "$get" -ne "$((set + 1))" ]; then
|
||||
echo "set grace to $set but got grace $get"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user