generic/386: check the correct field from df output
authorTheodore Ts'o <tytso@mit.edu>
Sun, 22 Dec 2019 21:27:30 +0000 (16:27 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sun, 29 Dec 2019 15:55:35 +0000 (23:55 +0800)
commitea726c4a55c98d1c37cea63fbe30f5ecee64c7dc
tree3458584449f70331893c4a125b87beb2506d7141
parentdb6de9645d1932114ed5573e54e619d967ef422e
generic/386: check the correct field from df output

The generic/386 test was checking the "Available" field when it
should have been checking the "1k-blocks" field, which represents
the project quota's hard limit.  On xfs, an empty directory takes no
space, so it doesn't matter.  But for ext4, an empty directory still
takes 4k (or whatever the file system's block size happens to be):

Filesystem           1K-blocks       Used  Available  Use% Pathname
/dev/vdc                512000          4     511996    0% /vdc/test

This causes generic/386 to falsely fail.

This fix is needed to fix generic/386 from failing on ext4:

    hard limit 524283904 bytes, expected 524288000

[Eryu: Used $(NF-4) instead of $2 as Eric Sandeen and Yang Xu
suggested]

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/386