quota: test Q_GETNEXTQUOTA
authorEric Sandeen <sandeen@sandeen.net>
Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)
commit1dfb50585c091ee1d4bc6beb105967b10fb46d26
tree9d0933e10d6d5dcdca67be37c4d93b2f7c3e2d1e
parent234f51ebbde2f64050430c53168afadb819c22d2
quota: test Q_GETNEXTQUOTA

The new Q_GETNEXTQUOTA quotactl (not yet merged) is designed
to take an ID as input ala Q_GETQUOTA, and return the quota
for the next active ID >= the input ID.  This lets us quickly
iterate over all existing quotas by leveraging the kernel's
knowledge of which quotas are allocated and active.

The test contains a new helper binary, test-nextquota, which
tests both the "vfs" and "xfs" versions of the quotactl.
It accepts an ID, and outputs the returned ID, ihard, and
isoft values for that quota.  It doesn't return block information
simply because that can vary depending on fs, block size, etc,
and we want something very consistent as output, for verifiation.

The test harness sets quotas for 100 random IDs, remounts,
and uses these quotactls to iterate over all the IDs we set,
using the test binary, making sure we get back what we expect.

Not the prettiest thing, but it works!

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
src/Makefile
src/test-nextquota.c [new file with mode: 0644]
tests/generic/244 [new file with mode: 0755]
tests/generic/244.out [new file with mode: 0644]
tests/generic/group