Hi Jeff,
thanks a lot for sending this patch!
> I'd like to introduce a new test to verify something like this, it is
> intended to run as a negative test
> collections for project quota. It only verify the above issue for now, maybe
> its better to wrap the steps in a individual function?
We should have one testcase for one thing to test - by that defintion
this bug should really stay a test case on it's own. Some more comments
below.
> +_create_pquota_config_files()
> +{
> + echo "1:$tmpdir" > /etc/projects
> + echo "$project_name:1" > /etc/projid
> +}
We can use numeric ids for projects directly, and the -p object to
various xfs_quota subcommands also allows refering to a path instead
of a project name, that way we don't have to rewrite the config files
in /etc.
> +echo "*** create loopback image file ***"
> +dd if=/dev/zero of=$tmpfile bs=4k count=4096 >/dev/null 2>&1
> +
> +echo "*** mkfs.xfs ***"
> +mkfs.xfs -b size=4096 $tmpfile >/dev/null 2>&1
> +
> +# mount loopback image but without pquota option
> +mount -o loop $tmpfile $tmpdir || _fail "!!! failed to loopback mount"
This should use _scratch_mkfs _scratch_mount and so on instead of
opencoding it.
|